⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dd_delta_aic.m

📁 模式识别工具箱,希望对大家有用!
💻 M
字号:
function e = dd_delta_aic(w,x)%DD_DELTA_AIC compute the Akaike Information Criterion for MoG%% e = dd_delta_aic(w,x)%% Compute the (difference in) Akaike Information Criterion of a% trained model w on data x. In this version we compute:%%     e = -2 LL + 2 #param%% where LL is the loglikelihood on the set x, and *not* the deviance% between two models. In order to make it true AIC, you have to% subtract the LL for the saturated model.%% also see dd_error, dd_roc, dd_auc% Copyright: D. Tax, R.P.W. Duin, davidt@ph.tn.tudelft.nl% Faculty of Applied Physics, Delft University of Technology% P.O. Box 5046, 2600 GA Delft, The Netherlands[W,labl,map,d] = mapping(w);if ~is_occ(w)  error('DD_AIC: this AIC is only defined for one-class classifiers');endp = w*x; p = +p(:,1);switch map  case 'gauss_dd'    nrparam = d + d*(d+1)/2;  %mean and cov.matrix      case 'mog_dd'    c = size(W.m,1);    [n,d] = size(x);    covtype = ndims(W.c);    if ((covtype==2)&(size(W.c,2)==1)), covtype = 1; end    % the number of parameters    % for all covariance versions, the priors and the means are the same:    nrparam = c + c*d;    switch covtype      case 1        nrparam = nrparam + c;      case 2        nrparam = nrparam + c*d;      case 3        nrparam = nrparam + c*d*(d+1)/2;      otherwise        error('Type of covariance matrix not recognized')    end  otherwise    error('AIC cannot be computed for this mapping!');end% For the loglikelihood:e = -2*sum(log(p)) + 2*nrparam;%strangely this one does not seem to work!:%e = -2*sum(log(sum(p,2))) + 2*nrparam/n;return

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -