loglike.m
来自「含有多种ICA算法的eeglab工具箱」· M 代码 · 共 37 行
M
37 行
% loglike() - log likehood function to estimate dependence between components%% Usage: f = loglike(W, S);% % Computation of the log-likelihood function under the model% that the ICs are 1/cosh(s) distributed (according to the tanh% nonlinearity in ICA). It does not exactly match for the logistic% nonlinearity, but should be a decent approximation%% negative log likelihood function% f = -( log(abs(det(W))) - sum(sum(log( cosh(S) )))/N - M*log(pi) );%% With these meanings:% W: total unmixing matrix, ie, icaweights*icasphere% S: 2-dim Matrix of source estimates% N: number of time points% M: number of components%% Author: Arnaud Delorme and Jorn Anemullerfunction f=loglike(W, S); M = size(W,1); if ndims(S) == 3 S = reshape(S, size(S,1), size(S,3)*size(S,2)); end; N = size(S,2); % detect infinite and remove them tmpcoh = log( cosh(S) ); tmpinf = find(isinf(tmpcoh)); tmpcoh(tmpinf) = []; N = (N*M-length(tmpinf))/M; f=-( log(abs(det(W))) - sum(sum(tmpcoh))/N - M*log(pi) );
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?