Daniel@0: function p = matrix_normal_pdf(A, M, V, K) Daniel@0: % MATRIX_NORMAL_PDF Evaluate the density of a matrix under a Matrix-Normal distribution Daniel@0: % p = matrix_normal_pdf(A, M, V, K) Daniel@0: Daniel@0: % See "Bayesian Linear Regression", T. Minka, MIT Tech Report, 2001 Daniel@0: Daniel@0: [d m] = size(K); Daniel@0: c = det(K)^(d/2) / det(2*pi*V)^(m/2); Daniel@0: p = c * exp(-0.5*tr((A-M)'*inv(V)*(A-M)*K));