about summary refs log tree commit diff
path: root/sourcecodes/bnt-master/KPMstats/matrix_normal_pdf.m
blob: 5e8e9a789cd2d16e9e8a64750a8c89c859f64e92 (plain)
1
2
3
4
5
6
7
8
9
function p = matrix_normal_pdf(A, M, V, K)
% MATRIX_NORMAL_PDF Evaluate the density of a matrix under a Matrix-Normal distribution
% p = matrix_normal_pdf(A, M, V, K)

% See "Bayesian Linear Regression", T. Minka, MIT Tech Report, 2001

[d m] = size(K);
c = det(K)^(d/2) / det(2*pi*V)^(m/2);
p = c * exp(-0.5*tr((A-M)'*inv(V)*(A-M)*K));