blob: cfff98d2c642312dde389cbacbca1da92b58eb7d (
plain)
1
2
3
4
5
6
7
8
|
function y = logdet(A)
% log(det(A)) where A is positive-definite.
% This is faster and more stable than using log(det(A)).
% From Tom Minka's lightspeed toolbox
U = chol(A);
y = 2*sum(log(diag(U)));
|