<< Multivariate Normal Multivariate Normal distfun_mvnrnd >>

distfun >> distfun > Multivariate Normal > distfun_mvnpdf

distfun_mvnpdf

Normal PDF

Calling Sequence

y=distfun_mvnpdf(x,mu,sigma)

Parameters

x :

a n-by-d matrix of doubles

mu :

a 1-by-d matrix of doubles, the mean

sigma :

a d-by-d matrix of doubles, the covariance matrix

y :

a n-by-1 matrix of doubles, the density

Description

Computes the probability distribution function of the Multivariate Normal (Laplace-Gauss) function.

Any scalar input argument is expanded to a matrix of doubles of the same size as the other input arguments.

The function definition is:

Examples

x=[13.2,-33.7]
mu=[12 -31]
sigma = [
3.0  0.5
0.5  1.0
]
y=distfun_mvnpdf(x,mu,sigma)

// Plot the iso values of PDF
// A wrapper for contouring
function y=mvnpdfC(x1, x2, mu, sigma)
x=[x1',x2']
y=distfun_mvnpdf(x,mu,sigma)
endfunction
x1=linspace(-6,18,100);
x2=linspace(-35,-27,100);
levels=[0.1 0.05 0.02 0.005 0.001];
contour(x1,x2,mvnpdfC,levels)
legend(["Data","PDF"]);

Bibliography

http://en.wikipedia.org/wiki/Multivariate_normal_distribution

Authors


Report an issue
<< Multivariate Normal Multivariate Normal distfun_mvnrnd >>