Last change
on this file since 86 was
37,
checked in by (none), 15 years ago
|
Added original make3d
|
-
Property svn:executable set to
*
|
File size:
564 bytes
|
Line | |
---|
1 | function lp = wishpdfln(x,a,b,inverse)
|
---|
2 | %WISHPDFLN Logarithm of Wishart probability density function.
|
---|
3 | % See WISHPDF for argument description.
|
---|
4 |
|
---|
5 | % Written by Tom Minka
|
---|
6 | % (c) Microsoft Corporation. All rights reserved.
|
---|
7 |
|
---|
8 | if nargin < 3
|
---|
9 | B = [];
|
---|
10 | end
|
---|
11 | if nargin < 4
|
---|
12 | inverse = 0;
|
---|
13 | end
|
---|
14 |
|
---|
15 | if inverse
|
---|
16 | X = inv(X);
|
---|
17 | end
|
---|
18 | if isempty(B)
|
---|
19 | XB = X;
|
---|
20 | logDetB = 0;
|
---|
21 | else
|
---|
22 | XB = X*B;
|
---|
23 | logDetB = logdet(B);
|
---|
24 | end
|
---|
25 | d = rows(x);
|
---|
26 | d2 = (d+1)/2;
|
---|
27 | if inverse
|
---|
28 | d2 = -d2;
|
---|
29 | end
|
---|
30 | logDetXB = (a-d2)*logdet(XB);
|
---|
31 | lp = logDetXB - trace(XB) + d2*logDetB - gammaln(a,d);
|
---|
Note: See
TracBrowser
for help on using the repository browser.