Calculates probablities from the probability density function of the multivariate normal distribution \( \mathbf{X} \sim \mathcal{N}_{k} \left( \boldsymbol{\mu}, \boldsymbol{\Sigma} \right) . %(\#eq:dist-X-mvn) \)

mvnpdf(X, mu, Sigma)

Arguments

X

Numeric matrix. Values of the \(k\)-dimensional random variable \(\mathbf{X}\).

mu

Numeric vector. Location parameter mean vector \(\boldsymbol{\mu}\) of length \(k\).

Sigma

Numeric matrix. \(k \times k\) variance-covariance matrix \(\boldsymbol{\Sigma}\).

Details

The multivariate normal (or multivariate Gaussian, or joint normal) distribution is given by $$ \mathbf{X} \sim \mathcal{N}_{k} \left( \boldsymbol{\mu}, \boldsymbol{\Sigma} \right) %(\#eq:dist-X-mvn) $$ and has the probability density function (PDF) $$ f_{\mathbf{X}} \left( X_1, \dots, X_k \right) = \frac{ \exp \left[ - \frac{1}{2} \left( \mathbf{X} - \boldsymbol{\mu} \right)^{\prime} \boldsymbol{\Sigma}^{-1} \left( \mathbf{X} - \boldsymbol{\mu} \right) \right] }{ \sqrt{ \left( 2 \pi \right)^{k} | \boldsymbol{\Sigma} | } } %(\#eq:dist-mvnpdf) $$ with \(k\)-dimensional random vector \(\mathbf{X} \in \boldsymbol{\mu} + \textrm{span}\left(\boldsymbol{\Sigma}\right) \subseteq \mathbf{R}^k\), \(\boldsymbol{\mu}\) is the location parameter mean \(\left( \boldsymbol{\mu} \in \mathbf{R}^k \right)\), and \(\boldsymbol{\Sigma}\) is the variance-covariance matrix \(\left( \boldsymbol{\Sigma} \in \mathbf{R}^{k \times k} \right)\).

References

Wikipedia: Multivariate Normal Distribution

See also

Other mutivariate normal likelihood functions: mvn2ll(), mvnll()