Statistics Toolbox    
mvnpdf

Multivariate normal probability density function (pdf)

Syntax

Description

y = mvnpdf(X) returns the n-by-1 vector y, containing the probability density of the multivariate normal distribution with zero mean and identity covariance matrix, evaluated at each row of the n-by-d matrix X. Rows of X correspond to observations and columns correspond to variables or coordinates.

y = mvnpdf(X,MU) returns the density of the multivariate normal distribution with mean MU and identity covariance matrix, evaluated at each row of X. MU is a 1-by-d vector, or an n-by-d matrix. If MU is a matrix, the density is evaluated for each row of X with the corresponding row of MU. MU can also be a scalar value, which mvnpdf replicates to match the size of X.

y = mvnpdf(X,MU,SIGMA) returns the density of the multivariate normal distribution with mean MU and covariance SIGMA, evaluated at each row of X. SIGMA is a d-by-d matrix, or an d-by-d-by-n array, in which case the density is evaluated for each row of X with the corresponding page of SIGMA, i.e., mvnpdf computes y(i) using X(i,:) and SIGMA(:,:,i). Specify [] for MU to use its default value when you want to specify only SIGMA.

If X is a 1-by-d vector, mvnpdf replicates it to match the leading dimension of MU or the trailing dimension of SIGMA.

Example

See Also

mvnrnd, normpdf


  multcompare mvnrnd