Skip to content

MultinormalDistribution ​

The multivariate normal with mean vector μ\mu and covariance matrix Σ\Sigma; the one-argument form defaults μ\mu to the zero vector.

MultinormalDistribution(mu, Sigma)mean mu, covariance Sigma.
MultinormalDistribution(Sigma)mean the zero vector, covariance Sigma.
Typed signatures
TypePackageApplies
((list<list<real>>) -> distribution) & ((list<real>, list<list<real>>) -> distribution)statisticsalways

Domain: Statistics

Details
  • PDF(x)=(2π)−k/2∣Σ∣−1/2exp⁡(−12(x−μ)TΣ−1(x−μ))PDF(x) = (2\pi)^{-k/2} |\Sigma|^{-1/2} \exp\left(-\tfrac12 (x-\mu)^T \Sigma^{-1} (x-\mu)\right) — exact whenever Σ\Sigma is rational, via compute-engine's own native Determinant/Inverse/Dot, which stay exact over rationals.
  • Mean=μMean = \mu. VarianceVariance is the DIAGONAL of Σ\Sigma (a length-kk list) — Wolfram's own convention; the full matrix is Covariance (see below).
  • Covariance (compute-engine native over two collections) is widened to also accept a single MultinormalDistribution, answering Σ\Sigma itself.
  • RandomVariate draws x=μ+Lzx = \mu + Lz, zz iid standard normal, LL the (numeric) Cholesky factor of Σ\Sigma — the standard construction, seeded through the same SeedRandom stream every other distribution in this package uses.

Examples

Basic #
live ↗
Inmean(MultinormalDistribution([1,2],[[4,0],[0,9]]))\mathrm{mean}(\mathrm{MultinormalDistribution}(\bigl\lbrack1, 2\bigr\rbrack, \bigl\lbrack\bigl\lbrack4, 0\bigr\rbrack, \bigl\lbrack0, 9\bigr\rbrack\bigr\rbrack))Out[1,2]\bigl\lbrack1, 2\bigr\rbrack

the one-argument (Sigma-only) form defaults mu to the zero vector.

live ↗
Inmean(MultinormalDistribution([[1,0],[0,1]]))\mathrm{mean}(\mathrm{MultinormalDistribution}(\bigl\lbrack\bigl\lbrack1, 0\bigr\rbrack, \bigl\lbrack0, 1\bigr\rbrack\bigr\rbrack))Out[0,0]\bigl\lbrack0, 0\bigr\rbrack

the diagonal of Sigma, not the full matrix.

live ↗
InVariance(MultinormalDistribution([1,2],[[4,0],[0,9]]))\mathrm{Variance}(\mathrm{MultinormalDistribution}(\bigl\lbrack1, 2\bigr\rbrack, \bigl\lbrack\bigl\lbrack4, 0\bigr\rbrack, \bigl\lbrack0, 9\bigr\rbrack\bigr\rbrack))Out[4,9]\bigl\lbrack4, 9\bigr\rbrack

Covariance answers Sigma itself.

live ↗
InCovariance⁡(MultinormalDistribution([1,2],[[4,1],[1,9]]))\operatorname{Covariance}(\mathrm{MultinormalDistribution}(\bigl\lbrack1, 2\bigr\rbrack, \bigl\lbrack\bigl\lbrack4, 1\bigr\rbrack, \bigl\lbrack1, 9\bigr\rbrack\bigr\rbrack))Out[[4,1],[1,9]]\bigl\lbrack\bigl\lbrack4, 1\bigr\rbrack, \bigl\lbrack1, 9\bigr\rbrack\bigr\rbrack

the standard bivariate normal's peak density, 1/(2 pi).

live ↗
InPDF⁡(MultinormalDistribution([0,0],[[1,0],[0,1]]),[0,0])\operatorname{PDF}(\mathrm{MultinormalDistribution}(\bigl\lbrack0, 0\bigr\rbrack, \bigl\lbrack\bigl\lbrack1, 0\bigr\rbrack, \bigl\lbrack0, 1\bigr\rbrack\bigr\rbrack), \bigl\lbrack0, 0\bigr\rbrack)Out12π\frac{1}{2π}
About
Examples5

See also: MultinomialDistribution, NormalDistribution, Covariance, RandomVariate