
function [y] = mvNormalPdf(x, mu, Sigma)

% This function pdf values at point x from a multivariate normal
% density with mean 'mu' and covariance matrix 'Sigma'
%--------------------------------------------------------------------------
% Output
% y         : probability from multivariate normal pdf
% Input
% x         : column vector of points
% mu        : mean vector, column vector
% Sigma     : Covariance matrix
%--------------------------------------------------------------------------

d           = size(x,1);
logDetSigma = log( det(Sigma) );
invSigma    = Sigma\eye(d);

quadform    = (x-mu)'*invSigma*(x-mu);
y = exp(-0.5*quadform - 0.5*logDetSigma - (d/2)*log(2*pi));

end