?? mln.m
字號:
function [logL] = mln(X,MI,SIGMA,Pk)% MLN logarithm of value of the likelihood function.% [logL] = mln(X,MI,SIGMA,Pk)%% MLN computes logarithm of value of the likelihood% function which is defined as product of probabilities p(x) of% all vectors from the point set X. It is considered that% conditional p.d. functions p(x|k) are normaly distributed % and their parameters are given. Futher, it is considered that % apriori probabilities p(k) are known, then the logarithm holds % N K% logL = sum log sum p(x_i|k) p(k)% i=1 k=1%% % Input:% X [DxN] contains N vectors which are D-dimensional.% MI [DxK] contains K vectors of mean values, MI=[mi_1,mi_2,...mi_K].% SIGMA [(DxD)xK] contains K covariance matrices which are D-by-D% dimensional, SIGMA=[sigma_1,sigma_2,...,sigma_K].% The pair mi_1,sigma_1 describes the first normaly distributed % p.d. function p(x|k=1) and so one for k=1,2,...K. % Pk [1xK] contains K values of apriori probabilities.% % Output:% logL [1x1] logarithm of value of the Maximal-Likelihood function.% % See also UNSUNI, UNSUND, UNSUPER.%% Statistical Pattern Recognition Toolbox, Vojtech Franc, Vaclav Hlavac% (c) Czech Technical University Prague, http://cmp.felk.cvut.cz% Written Vojtech Franc (diploma thesis) 4.8.2000% Modifications D=size(MI,1); % dimensionK=size(MI,2); % % of classesN=size(X,2); % # of pointsA=zeros(N,K);for k=1:K, pxk=normald(X,MI(:,k),SIGMA(:,1+(k-1)*D:k*D)); A(:,k)=pxk(:)*Pk(k);endlogL=sum(log(sum(A,2)));
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -