getscalelike.m
来自「Continuous Profile Models (CPM) Matlab T」· M 代码 · 共 29 行
M
29 行
% function scaleLik = getScaleLike(G,u)%% Computes the log likelihood resulting from the log% prior on u_k's, which have a log-normal distribution.function scaleLik = getScaleLike(G,u)scaleLik=0;if G.uType==1 scaleLik=0;elseif G.uType==2 LOGSQRT2PI = log(sqrt(2*pi)); logSigma = log(G.w); twoSigma2Inv = (1/2)*(1./(G.w.^2)); u=u(:); %% in case using CPM2 for jj=1:length(u) newTerm = lognormpdf(log(u(jj)),0,logSigma,... twoSigma2Inv,LOGSQRT2PI,G.numBins); scaleLik = scaleLik + newTerm; end %% this is the other term I forgot from the log normal!!! (Aug 21,2006) scaleLik = scaleLik -sum(log(u));endreturn;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?