comparison toolboxes/FullBNT-1.0.7/KPMstats/student_t_prob.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 function p = student_t_pdf(X, mu, lambda, alpha)
2 % STUDENT_T_PDF Evaluate the multivariate student-t distribution at a point
3 % p = student_t_pdf(X, mu, lambda, alpha)
4 %
5 % Each column of X is evaluated.
6 % See Bernardo and Smith p435.
7
8 k = length(mu);
9 assert(size(X,1) == k);
10 [k N] = size(X);
11 numer = gamma(0.5*(alpha+k));
12 denom = gamma(0.5*alpha) * (alpha*pi)^(k/2);
13 c = (numer/denom) * det(lambda)^(0.5);
14 p = c*(1 + (1/alpha)*(X-mu)'*lambda*(X-mu))^(-(alpha+k)/2); % scalar version
15 %m = repmat(mu(:), 1, N);
16 %exponent = sum((X-m)'*lambda*(X-m), 2); % column vector
17 %p = c*(1 + (1/alpha)*exponent).^(-(alpha+k)/2);
18
19 keyboard