{{short description|Generalization of the one-dimensional normal distribution to higher dimensions}}

{{Probability distribution | name = Multivariate normal | type = multivariate | pdf_image = MultivariateNormal.png | pdf_caption=<small>Many sample points from a multivariate normal distribution with <math>\boldsymbol\mu = \left[\begin{smallmatrix}0 \\ 0\end{smallmatrix}\right]</math> and <math>\boldsymbol\Sigma = \left[\begin{smallmatrix}1 & 3/5 \\ 3/5 & 2\end{smallmatrix}\right]</math>, shown along with the 3-sigma ellipse, the two marginal distributions, and the two 1-d histograms.</small> | cdf_image = | notation = <math>\mathcal{N}(\boldsymbol\mu,\, \boldsymbol\Sigma)</math> | parameters = '''''μ''''' ∈ '''R'''<sup>''k''</sup> — location<br/>'''Σ''' ∈ '''R'''<sup>''k''&nbsp;×&nbsp;''k''</sup> — covariance (positive semi-definite matrix) | support = '''''x''''' ∈ '''''μ''''' + span('''Σ''') ⊆ '''R'''<sup>''k''</sup> | pdf = <math>(2\pi)^{-k/2}\det (\boldsymbol\Sigma)^{-1/2} \, \exp \left( -\frac{1}{2} (\mathbf{x} - \boldsymbol\mu)^\mathrm{T} \boldsymbol\Sigma^{-1}(\mathbf{x} - \boldsymbol\mu) \right),</math><br/>exists only when '''Σ''' is positive-definite <!--- | cdf = (no analytic expression) ---> | mean = '''''μ''''' | median = | mode = '''''μ''''' | variance = '''Σ''' | skewness = | kurtosis = | entropy = <math>\frac{k}{2} \log \mathord\left( 2\pi \mathrm{e} \right) + \frac{1}{2} \log \det\mathord\left( \boldsymbol\Sigma \right) </math> | mgf = <math>\exp\!\Big( \boldsymbol\mu^\mathrm{T} \mathbf{t} + \tfrac{1}{2} \mathbf{t}^\mathrm{T} \boldsymbol\Sigma \mathbf{t}\Big)</math> | char = <math>\exp\!\Big( i\boldsymbol\mu^\mathrm{T} \mathbf{t} - \tfrac{1}{2} \mathbf{t}^\mathrm{T} \boldsymbol\Sigma \mathbf{t}\Big)</math> | KLDiv = ''See {{section link||Kullback–Leibler divergence}}'' }} In probability theory and statistics, the '''multivariate normal distribution''', '''multivariate Gaussian distribution''', or '''joint normal distribution''' is a generalization of the one-dimensional (univariate) normal distribution to higher dimensions. One definition is that a random vector is said to be ''k''-variate normally distributed if every linear combination of its ''k'' components has a univariate normal distribution. Its importance derives mainly from the multivariate central limit theorem. The multivariate normal distribution is often used to describe, at least approximately, any set of (possibly) correlated real-valued random variables, each of which clusters around a mean value.

== Definitions == === Notation and parametrization === The multivariate normal distribution of a ''k''-dimensional random vector <math>\mathbf{X} = (X_1,\ldots,X_k)^{\mathrm T}</math> can be written in the following notation: : <math> \mathbf{X}\ \sim\ \mathcal{N}(\boldsymbol\mu,\, \boldsymbol\Sigma), </math> or to make it explicitly known that <math>\mathbf{X}</math> is ''k''-dimensional, : <math> \mathbf{X}\ \sim\ \mathcal{N}_k(\boldsymbol\mu,\, \boldsymbol\Sigma), </math> with ''k''-dimensional mean vector :<math> \boldsymbol\mu = \operatorname{E}[\mathbf{X}] = ( \operatorname{E}[X_1], \operatorname{E}[X_2], \ldots, \operatorname{E}[X_k] ) ^ \mathrm{T}, </math> and <math>k \times k</math> covariance matrix :<math> \Sigma_{i,j} = \operatorname{E} [(X_i - \mu_i)( X_j - \mu_j)] = \operatorname{Cov}[X_i, X_j] </math> such that <math>1 \le i \le k</math> and <math>1 \le j \le k</math>. The inverse of the covariance matrix is called the precision matrix, denoted by <math>\boldsymbol{Q}=\boldsymbol\Sigma^{-1}</math>.

===Standard normal random vector=== A real random vector <math>\mathbf{X} = (X_1,\ldots,X_k)^{\mathrm T}</math> is called a '''standard normal random vector''' if all of its components <math>X_i</math> are independent and each is a zero-mean unit-variance normally distributed random variable, i.e. if <math>X_i \sim\ \mathcal{N}(0,1)</math> for all <math>i=1\ldots k</math>.<ref name=Lapidoth>{{cite book |first=Amos |last=Lapidoth |year=2009 |title=A Foundation in Digital Communication |publisher=Cambridge University Press |isbn=978-0-521-19395-5}}</ref>{{rp|p. 454}}

===Centered normal random vector=== A real random vector <math>\mathbf{X} = (X_1,\ldots,X_k)^{\mathrm T}</math> is called a '''centered normal random vector''' if there exists a <math>k \times \ell</math> matrix <math>\boldsymbol{A}</math> such that <math>\boldsymbol{A} \mathbf{Z}</math> has the same distribution as <math>\mathbf{X}</math> where <math>\mathbf{Z}</math> is a standard normal random vector with <math>\ell</math> components.<ref name=Lapidoth/>{{rp|p. 454}}

===Normal random vector=== A real random vector <math>\mathbf{X} = (X_1,\ldots,X_k)^{\mathrm T}</math> is called a '''normal random vector''' if there exists a random <math>\ell</math>-vector <math>\mathbf{Z}</math>, which is a standard normal random vector, a <math>k</math>-vector <math>\boldsymbol\mu</math>, and a <math>k \times \ell</math> matrix <math>\boldsymbol{A}</math>, such that <math>\mathbf{X}=\boldsymbol{A} \mathbf{Z} + \boldsymbol\mu</math>.<ref name=Gut>{{cite book |first=Allan |last=Gut |year=2009 |title=An Intermediate Course in Probability |publisher=Springer |isbn=978-1-441-90161-3}}</ref>{{rp|p. 454}}<ref name=Lapidoth/>{{rp|p. 455}}

Formally:

{{Equation box 1 |indent = |title= |equation = <math> \mathbf{X}\ \sim\ \mathcal{N}_k(\boldsymbol\mu, \boldsymbol\Sigma) \iff \text{there exist } \boldsymbol\mu\in\mathbb{R}^k,\boldsymbol{A}\in\mathbb{R}^{k\times \ell} \text{ such that } \mathbf{X}=\boldsymbol{A} \mathbf{Z} + \boldsymbol\mu \text{ and } \forall n=1,\ldots,\ell : Z_n \sim\ \mathcal{N}(0, 1), \text{i.i.d.} </math> |cellpadding= 6 |border |border colour = #0073CF |background colour=#F5FFFA}}

Here the covariance matrix is <math>\boldsymbol\Sigma = \boldsymbol{A} \boldsymbol{A}^{\mathrm T}</math>.

In the degenerate case where the covariance matrix is singular, the corresponding distribution has no density; see the section below for details. This case arises frequently in statistics; for example, in the distribution of the vector of residuals in the ordinary least squares regression. The <math>X_i</math> are in general ''not'' independent; they can be seen as the result of applying the matrix <math>\boldsymbol{A}</math> to a collection of independent Gaussian variables <math>\mathbf{Z}</math>.

=== Equivalent definitions === The following definitions are equivalent to the definition given above. A random vector <math>\mathbf{X} = (X_1, \ldots, X_k)^\mathrm{T}</math> has a multivariate normal distribution if it satisfies one of the following equivalent conditions. * Every linear combination <math>Y=a_1 X_1 + \cdots + a_k X_k</math> of its components is normally distributed. That is, for any constant vector <math>\mathbf{a} \in \mathbb{R}^k</math>, the random variable <math>Y=\mathbf{a}^{\mathrm T}\mathbf{X}</math> has a univariate normal distribution, where a univariate normal distribution with zero variance is a point mass on its mean. * There is a ''k''-vector <math>\mathbf{\mu}</math> and a symmetric, positive semidefinite <math>k \times k</math> matrix <math>\boldsymbol\Sigma</math>, such that the characteristic function of <math>\mathbf{X}</math> is <math display="block"> \varphi_\mathbf{X}(\mathbf{u}) = \exp\Big( i\mathbf{u}^\mathrm{T}\boldsymbol\mu - \tfrac{1}{2} \mathbf{u}^\mathrm{T}\boldsymbol\Sigma \mathbf{u} \Big). </math>

The spherical normal distribution can be characterised as the unique distribution where components are independent in any orthogonal coordinate system.<ref>{{cite journal |last1=Kac |first1=M. |title=On a characterization of the normal distribution |journal=American Journal of Mathematics |date=1939 |volume=61 |issue=3 |pages=726–728 |jstor=2371328 |doi=10.2307/2371328 }}</ref><ref>{{cite journal |last1=Sinz |first1=Fabian |last2=Gerwinn |first2=Sebastian |last3=Bethge |first3=Matthias |title=Characterization of the p-generalized normal distribution |journal=Journal of Multivariate Analysis |date=2009 |volume=100 |issue=5 |pages=817–820 |doi=10.1016/j.jmva.2008.07.006 |doi-access=free }}</ref>

===Density function=== [[File:Multivariate Gaussian.png|thumb|right|324x324px|Bivariate normal joint density]]

====Non-degenerate case==== The multivariate normal distribution is said to be "non-degenerate" when the symmetric covariance matrix <math>\boldsymbol\Sigma</math> is positive definite. In this case the distribution has density<ref>Simon J.D. Prince(June 2012). [http://www.computervisionmodels.com/ Computer Vision: Models, Learning, and Inference] {{Webarchive|url=https://web.archive.org/web/20201028120753/http://computervisionmodels.com/ |date=2020-10-28 }}. Cambridge University Press. 3.7:"Multivariate normal distribution".</ref>

{{Equation box 1 |indent = |title= |equation = <math> f_{\mathbf X}(x_1,\ldots,x_k) = \frac{\exp\left(-\frac 1 2 \left({\mathbf x} - {\boldsymbol\mu}\right)^\mathrm{T}{\boldsymbol\Sigma}^{-1}\left({\mathbf x}-{\boldsymbol\mu}\right)\right)}{\sqrt{(2\pi)^k |\boldsymbol\Sigma|}} </math> |cellpadding= 6 |border |border colour = #0073CF |background colour=#F5FFFA}}

where <math>{\mathbf x}</math> is a real ''k''-dimensional column vector and <math>|\boldsymbol\Sigma|\equiv \det\boldsymbol\Sigma</math> is the determinant of <math>\boldsymbol\Sigma</math>, also known as the generalized variance. The equation above reduces to that of the univariate normal distribution if <math>\boldsymbol\Sigma</math> is a <math>1 \times 1</math> matrix (i.e., a single real number).

The circularly symmetric version of the complex normal distribution has a slightly different form.

Each iso-density locus — the locus of points in ''k''-dimensional space each of which gives the same particular value of the density — is an ellipse or its higher-dimensional generalization; hence the multivariate normal is a special case of the elliptical distributions.

The quantity <math>\sqrt{({\mathbf x}-{\boldsymbol\mu})^\mathrm{T}{\boldsymbol\Sigma}^{-1}({\mathbf x}-{\boldsymbol\mu})}</math> is known as the Mahalanobis distance, which represents the distance of the test point <math>{\mathbf x}</math> from the mean <math>{\boldsymbol\mu}</math>. The squared Mahalanobis distance <math>({\mathbf x}-{\boldsymbol\mu})^\mathrm{T}{\boldsymbol\Sigma}^{-1}({\mathbf x}-{\boldsymbol\mu})</math> is decomposed into a sum of ''k'' terms, each term being a product of three meaningful components.<ref>{{Cite journal |last=Kim |first=M.&nbsp;G. |year=2000 |title=Multivariate outliers and decompositions of Mahalanobis distance |journal=Communications in Statistics – Theory and Methods |volume=29 |issue=7 |pages=1511–1526 |doi=10.1080/03610920008832559}}</ref> Note that in the case when <math>k = 1</math>, the distribution reduces to a univariate normal distribution and the Mahalanobis distance reduces to the absolute value of the standard score. See also Interval below.

====Bivariate case==== In the 2-dimensional nonsingular case (<math>k = \operatorname{rank}\left(\Sigma\right) = 2</math>), the probability density function of a vector <math>\text{[XY]}\prime</math> is: <math display="block"> f(x,y) = \frac{1}{2 \pi \sigma_X \sigma_Y \sqrt{1-\rho^2}} \exp \left( -\frac{1}{2\left[1 - \rho^2\right]}\left[ \left(\frac{x-\mu_X}{\sigma_X}\right)^2 - 2\rho\left(\frac{x - \mu_X}{\sigma_X}\right)\left(\frac{y - \mu_Y}{\sigma_Y}\right) + \left(\frac{y - \mu_Y}{\sigma_Y}\right)^2 \right] \right) </math> where <math>\rho</math> is the correlation between <math>X</math> and <math>Y</math> and where <math> \sigma_X>0 </math> and <math> \sigma_Y>0 </math>. In this case, : <math> \boldsymbol\mu = \begin{pmatrix} \mu_X \\ \mu_Y \end{pmatrix}, \quad \boldsymbol\Sigma = \begin{pmatrix} \sigma_X^2 & \rho \sigma_X \sigma_Y \\ \rho \sigma_X \sigma_Y & \sigma_Y^2 \end{pmatrix}. </math> In the bivariate case, the first equivalent condition for multivariate reconstruction of normality can be made less restrictive as it is sufficient to verify that a countably infinite set of distinct linear combinations of <math>X</math> and <math>Y</math> are normal in order to conclude that the vector of <math>\text{[XY]}\prime</math> is bivariate normal.<ref name=HT/>

The bivariate iso-density loci plotted in the <math>x,y</math>-plane are ellipses, whose principal axes are defined by the eigenvectors of the covariance matrix <math>\boldsymbol\Sigma</math> (the major and minor semidiameters of the ellipse equal the square-root of the ordered eigenvalues). thumb|right|Bivariate normal distribution centered at <math>(1, 3)</math> with a standard deviation of 3 in roughly the <math>(0.878, 0.478)</math> direction and of&nbsp;1 in the orthogonal direction.

As the absolute value of the correlation parameter <math>\rho</math> increases, these loci are squeezed toward the following line :

: <math> y(x) = \sgn (\rho)\frac{\sigma_Y}{\sigma_X} (x - \mu _X) + \mu_Y. </math>

This is because this expression, with <math>\sgn(\rho)</math> (where sgn is the sign function) replaced by <math>\rho</math>, is the best linear unbiased prediction of <math>Y</math> given a value of <math>X</math>.<ref name=wyattlms/>

====Degenerate case==== If the covariance matrix <math>\boldsymbol\Sigma</math> is not full rank, then the multivariate normal distribution is degenerate and does not have a density. More precisely, it does not have a density with respect to ''k''-dimensional Lebesgue measure (which is the usual measure assumed in calculus-level probability courses). Only random vectors whose distributions are absolutely continuous with respect to a measure are said to have densities (with respect to that measure). To talk about densities but avoid dealing with measure-theoretic complications it can be simpler to restrict attention to a subset of <math>\operatorname{rank}(\boldsymbol\Sigma)</math> of the coordinates of <math>\mathbf{x}</math> such that the covariance matrix for this subset is positive definite; then the other coordinates may be thought of as an affine function of these selected coordinates.<ref>{{Cite web |title=linear algebra - Mapping between affine coordinate function |url=https://math.stackexchange.com/q/2727720 |access-date=2022-06-24 |website=Mathematics Stack Exchange |language=en}}</ref>

To talk about densities meaningfully in singular cases, then, we must select a different base measure. Using the disintegration theorem we can define a restriction of Lebesgue measure to the <math>\operatorname{rank}(\boldsymbol\Sigma)</math>-dimensional affine subspace of <math>\mathbb{R}^k</math> where the Gaussian distribution is supported, i.e. <math>\left\{\boldsymbol\mu + \boldsymbol{\Sigma^{1/2}}\mathbf{v} : \mathbf{v} \in \mathbb{R}^k\right\}</math>. With respect to this measure the distribution has the density of the following motif:

:<math>f(\mathbf{x}) = \frac{\exp\left( -\frac{1}{2}\left(\mathbf{x} - \boldsymbol\mu\right)^\mathrm{T} \boldsymbol\Sigma^+\left(\mathbf{x} - \boldsymbol\mu\right)\right) }\sqrt{\det\nolimits^*(2\pi\boldsymbol\Sigma)}</math>

where <math>\boldsymbol\Sigma^+</math> is the generalized inverse and <math>\det\nolimits^*</math> is the pseudo-determinant.<ref name=rao/>

=== Cumulative distribution function === The notion of cumulative distribution function (cdf) in dimension 1 can be extended in two ways to the multidimensional case, based on rectangular and ellipsoidal regions.

The first way is to define the cdf <math>F(\mathbf{x})</math> of a random vector <math>\mathbf{X}</math> as the probability that all components of <math>\mathbf{X}</math> are less than or equal to the corresponding values in the vector <math>\mathbf{x}</math>:<ref name="bo16">{{cite journal|last1=Botev|first1=Z. I.|title=The normal law under linear restrictions: simulation and estimation via minimax tilting|journal=Journal of the Royal Statistical Society, Series B|volume=79|pages=125–148|date=2016|doi=10.1111/rssb.12162|arxiv=1603.04166|bibcode=2016arXiv160304166B|s2cid=88515228}}</ref>

:<math> F(\mathbf{x}) = \mathbb{P}(\mathbf{X}\leq \mathbf{x}), \quad \text{where } \mathbf{X} \sim \mathcal{N}(\boldsymbol\mu,\, \boldsymbol\Sigma).</math>

Though there is no closed form for <math>F(\mathbf{x})</math>, there are a number of algorithms that estimate it numerically.<ref name="bo16"/><ref name=Genz>{{cite book|last=Genz|first=Alan|title=Computation of Multivariate Normal and t Probabilities|date=2009|publisher=Springer|isbn=978-3-642-01689-9|url=https://www.springer.com/statistics/computational+statistics/book/978-3-642-01688-2}}</ref>

Another way is to define the cdf <math>F(r)</math> as the probability that a sample lies inside the ellipsoid determined by its Mahalanobis distance <math>r</math> from the Gaussian, a direct generalization of the standard deviation.<ref name=Bensimhoun>[https://upload.wikimedia.org/wikipedia/commons/a/a2/Cumulative_function_n_dimensional_Gaussians_12.2013.pdf Bensimhoun Michael, ''N-Dimensional Cumulative Function, And Other Useful Facts About Gaussians and Normal Densities'' (2006)]</ref> In order to compute the values of this function, closed analytic formula exist,<ref name="Bensimhoun"/> as follows.

====Interval==== {{further|Confidence region|Hotelling t-squared statistic}}

The interval for the multivariate normal distribution yields a region consisting of those vectors '''x''' satisfying

:<math>({\mathbf x}-{\boldsymbol\mu})^\mathrm{T}{\boldsymbol\Sigma}^{-1}({\mathbf x}-{\boldsymbol\mu}) \leq \chi^2_k(p).</math>

Here <math>{\mathbf x}</math> is a <math>k</math>-dimensional vector, <math>{\boldsymbol\mu}</math> is the known <math>k</math>-dimensional mean vector, <math>\boldsymbol\Sigma</math> is the known covariance matrix and <math>\chi^2_k(p)</math> is the quantile function for probability <math>p</math> of the chi-squared distribution with <math>k</math> degrees of freedom.<ref name=Siotani/> When <math>k = 2,</math> the expression defines the interior of an ellipse and the chi-squared distribution simplifies to an exponential distribution with mean equal to two (rate equal to half).

=== Complementary cumulative distribution function (tail distribution) === The complementary cumulative distribution function (ccdf) or the '''tail distribution''' is defined as <math>\overline F(\mathbf{x}) = 1 - \mathbb P\left(\mathbf X\leq \mathbf x\right)</math>. When <math> \mathbf{X} \sim \mathcal{N}(\boldsymbol\mu,\, \boldsymbol\Sigma)</math>, then the ccdf can be written as a probability the maximum of dependent Gaussian variables:<ref name="bmr15">{{cite conference |title=Tail distribution of the maximum of correlated Gaussian random variables |last1=Botev |first1=Z. I. |last2=Mandjes |first2=M. |last3=Ridder |first3=A. |publisher=IEEE|isbn=978-1-4673-9743-8 |book-title= 2015 Winter Simulation Conference (WSC) |pages=633–642 |location=Huntington Beach, Calif., USA |date=6–9 December 2015 |doi= 10.1109/WSC.2015.7408202 |hdl=10419/130486 |hdl-access=free }} </ref>

:<math> \overline F(\mathbf{x}) = \mathbb P\left(\bigcup_i\{X_i\geq x_i\}\right) = \mathbb P\left(\max_i Y_i\geq 0\right), \quad \text{where } \mathbf{Y} \sim \mathcal{N}\left(\boldsymbol\mu - \mathbf{x},\, \boldsymbol\Sigma\right).</math> While no simple closed formula exists for computing the ccdf, the maximum of dependent Gaussian variables can be estimated accurately via the Monte Carlo method.<ref name="bmr15"/><ref name="abl08">{{cite conference |title=Efficient simulation for tail probabilities of Gaussian random fields |last1=Adler |first1=R. J. |last2=Blanchet |first2=J. |last3=Liu |first3=J. |publisher=IEEE|isbn=978-1-4244-2707-9 |book-title= 2008 Winter Simulation Conference (WSC) |pages=328–336 |location=Miami, Fla., USA |date=7–10 Dec 2008 |doi= 10.1109/WSC.2008.4736085 }} </ref>

== Properties ==

===Moments=== {{Main|Isserlis' theorem}} The ''k''th-order moments of '''x''' are given by

:<math>\mu_{1,\ldots,N}(\mathbf{x}) \mathrel\stackrel{\mathrm{def}}{=} \mu _{r_1,\ldots,r_N}(\mathbf{x}) \mathrel\stackrel{\mathrm{def}}{=} \operatorname E\left[ \prod_{j=1}^N X_j^{r_j} \right] </math>

where {{math|''r''<sub>1</sub> + ''r''<sub>2</sub> + ⋯ + ''r<sub>N</sub>'' {{=}} ''k''.}}

The ''k''th-order central moments are as follows

{{ordered list|list_style_type=lower-alpha |If ''k'' is odd, {{math|''μ''<sub>1, ..., ''N''</sub>('''x''' − '''''μ''''') {{=}} 0}}. |If ''k'' is even with {{math|''k'' {{=}} 2''λ''}}, then{{Ambiguous|date=November 2022|reason=Unclear notation}} <math display="block"> \mu_{1,\dots,2\lambda}(\mathbf{x}-\boldsymbol\mu ) = \sum \left( \sigma_{ij} \sigma_{k\ell} \cdots \sigma_{XZ}\right) </math> }} where the sum is taken over all allocations of the set <math>\left\{ 1,\ldots,2\lambda \right\}</math> into ''λ'' (unordered) pairs. That is, for a ''k''th {{math| ({{=}} 2''λ'' {{=}} 6)}} central moment, one sums the products of {{nowrap|''λ'' {{=}} 3}} covariances (the expected value '''''μ''''' is taken to be 0 in the interests of parsimony):

: <math>\begin{align} & \operatorname E[X_1 X_2 X_3 X_4 X_5 X_6] \\[8pt] = {} & \operatorname E[X_1 X_2]\operatorname E[X_3 X_4]\operatorname E[X_5 X_6] + \operatorname E[X_1 X_2]\operatorname E[X_3 X_5]\operatorname E[X_4 X_6] + \operatorname E[X_1 X_2]\operatorname E[X_3 X_6] \operatorname E[X_4 X_5] \\[4pt] & {} + \operatorname E[X_1 X_3]\operatorname E[X_2 X_4]\operatorname E[X_5 X_6] + \operatorname E[X_1 X_3]\operatorname E[X_2 X_5]\operatorname E[X_4 X_6] + \operatorname E[X_1 X_3]\operatorname E[X_2 X_6] \operatorname E[X_4 X_5] \\[4pt] & {} + \operatorname E[X_1 X_4]\operatorname E[X_2 X_3]\operatorname E[X_5 X_6] + \operatorname E[X_1 X_4]\operatorname E[X_2 X_5]\operatorname E[X_3 X_6]+ \operatorname E[X_1 X_4]\operatorname E[X_2 X_6] \operatorname E[X_3 X_5] \\[4pt] & {} + \operatorname E[X_1 X_5]\operatorname E[X_2 X_3]\operatorname E[X_4 X_6] + \operatorname E[X_1 X_5]\operatorname E[X_2 X_4]\operatorname E[X_3 X_6] + \operatorname E[X_1 X_5]\operatorname E[X_2 X_6] \operatorname E[X_3 X_4] \\[4pt] & {} + \operatorname E[X_1 X_6]\operatorname E[X_2 X_3]\operatorname E[X_4 X_5] + \operatorname E[X_1 X_6]\operatorname E[X_2 X_4]\operatorname E[X_3 X_5] + \operatorname E[X_1 X_6] \operatorname E[X_2 X_5]\operatorname E[X_3 X_4]. \end{align} </math>

This yields <math>\tfrac{(2\lambda -1)!}{2^{\lambda -1}(\lambda -1)!}</math> terms in the sum (15 in the above case), each being the product of ''λ'' (in this case 3) covariances. For fourth order moments (four variables) there are three terms. For sixth-order moments there are {{math|3 × 5 {{=}} 15}} terms, and for eighth-order moments there are {{math|3 × 5 × 7 {{=}} 105}} terms.

The covariances are then determined by replacing the terms of the list <math>[ 1, \ldots, 2\lambda]</math> by the corresponding terms of the list consisting of ''r''<sub>1</sub> ones, then ''r''<sub>2</sub> twos, etc.. To illustrate this, examine the following 4th-order central moment case:

: <math> \begin{align} \operatorname E \left [ X_i^4 \right ] & = 3\sigma_{ii}^2 \\[4pt] \operatorname E \left[ X_i^3 X_j \right ] & = 3\sigma_{ii} \sigma_{ij} \\[4pt] \operatorname E \left[ X_i^2 X_j^2 \right ] & = \sigma_{ii}\sigma_{jj}+2 \sigma _{ij}^2 \\[4pt] \operatorname E \left[ X_i^2 X_j X_k \right ] & = \sigma_{ii}\sigma _{jk}+2\sigma _{ij}\sigma_{ik} \\[4pt] \operatorname E \left [ X_i X_j X_k X_n \right ] & = \sigma_{ij}\sigma _{kn} + \sigma _{ik} \sigma_{jn} + \sigma_{in} \sigma _{jk}. \end{align} </math>

where <math>\sigma_{ij}</math> is the covariance of ''X<sub>i</sub>'' and ''X<sub>j</sub>''. With the above method one first finds the general case for a ''k''th moment with ''k'' different ''X'' variables, <math>E\left[ X_i X_j X_k X_n\right]</math>, and then one simplifies this accordingly. For example, for <math>\operatorname E[ X_i^2 X_k X_n ]</math>, one lets {{math|''X<sub>i</sub>'' {{=}} ''X''<sub>''j''</sub>}} and one uses the fact that <math>\sigma_{ii} = \sigma_i^2</math>.

===Functions of a normal vector=== A quadratic form of a normal vector <math>\boldsymbol{x}</math>, <math>q(\boldsymbol{x}) = \boldsymbol{x}' \mathbf{Q_2} \boldsymbol{x} + \boldsymbol{q_1}' \boldsymbol{x} + q_0</math> (where <math>\mathbf{Q_2}</math> is a matrix, <math>\boldsymbol{q_1}</math> is a vector, and <math>q_0</math> is a scalar), is a generalized chi-squared variable. The direction of a normal vector follows a projected normal distribution.<ref name=Hernandez-Stumpfhauser />

If <math>f(\boldsymbol{x})</math> is a general scalar-valued function of a normal vector, its probability density function, cumulative distribution function, and inverse cumulative distribution function can be computed with the numerical method of ray-tracing ([https://www.mathworks.com/matlabcentral/fileexchange/84973-integrate-and-classify-normal-distributions Matlab code] {{Webarchive|url=https://web.archive.org/web/20250220003029/https://www.mathworks.com/matlabcentral/fileexchange/84973-integrate-and-classify-normal-distributions |date=2025-02-20 }}).

====Likelihood function====

If the mean and covariance matrix are known, the log likelihood of an observed vector <math>\boldsymbol{x}</math> is simply the log of the probability density function:

:<math>\ln L (\boldsymbol{x})= -\frac{1}{2} \left[ \ln (|\boldsymbol\Sigma|\,) + (\boldsymbol{x}-\boldsymbol\mu)'\boldsymbol\Sigma^{-1}(\boldsymbol{x}-\boldsymbol\mu) + k\ln(2\pi) \right]</math>,

The circularly symmetric version of the noncentral complex case, where <math>\boldsymbol{z}</math> is a vector of complex numbers, would be

:<math>\ln L (\boldsymbol{z}) = -\ln (|\boldsymbol\Sigma|\,) -(\boldsymbol{z}-\boldsymbol\mu)^\dagger\boldsymbol\Sigma^{-1}(\boldsymbol{z}-\boldsymbol\mu) -k\ln(\pi)</math>

i.e. with the conjugate transpose (indicated by <math>\dagger</math>) replacing the normal transpose (indicated by <math>'</math>). This is slightly different than in the real case, because the circularly symmetric version of the complex normal distribution has a slightly different form for the normalization constant.

A similar notation is used for multiple linear regression.<ref>Tong, T. (2010) [http://amath.colorado.edu/courses/7400/2010Spr/lecture9.pdf Multiple Linear Regression : MLE and Its Distributional Results] {{webarchive|url=https://www.webcitation.org/6HPbX5thy?url=http://amath.colorado.edu/courses/7400/2010Spr/lecture9.pdf|date=2013-06-16}}, Lecture Notes</ref>

Since the log likelihood of a normal vector is a quadratic form of the normal vector, it is distributed as a generalized chi-squared variable.

===Differential entropy===

The differential entropy of the multivariate normal distribution is<ref>{{cite journal | last1 = Gokhale | first1 = DV | last2 = Ahmed | first2 = NA | last3 = Res |first3=BC | last4 = Piscataway |first4=NJ | date = May 1989 | title = Entropy Expressions and Their Estimators for Multivariate Distributions | journal = IEEE Transactions on Information Theory | volume = 35 | issue = 3 | pages = 688–692 | doi =10.1109/18.30996 }}</ref>

<math display="block"> \begin{align} h\left(f\right) & = -\int_{-\infty}^\infty \int_{-\infty}^\infty \cdots\int_{-\infty}^\infty f(\mathbf{x}) \ln f(\mathbf{x})\,d\mathbf{x} \\[1ex] & = \frac12 \ln \left|2\pi e\boldsymbol\Sigma \right| = \frac{k}{2} \left(1 + \ln 2\pi\right) + \frac{1}{2} \ln \left|\boldsymbol\Sigma \right|, \end{align} </math>

where the bars denote the matrix determinant, {{math|''k''}} is the dimensionality of the vector space, and the result has units of nats.

===Kullback–Leibler divergence=== The Kullback–Leibler divergence from <math>\mathcal{N}_1(\boldsymbol\mu_1, \boldsymbol\Sigma_1)</math> to <math>\mathcal{N}_0(\boldsymbol\mu_0, \boldsymbol\Sigma_0)</math>, for non-singular matrices Σ<sub>1</sub> and Σ<sub>0</sub>, is:<ref>{{cite thesis |first=J. |last=Duchi |title=Derivations for Linear Algebra and Optimization |url=https://stanford.edu/~jduchi/projects/general_notes.pdf#page=13 |page=13 |archive-date=2020-07-25 |access-date=2020-08-12 |archive-url=https://web.archive.org/web/20200725234322/http://stanford.edu/~jduchi/projects/general_notes.pdf#page=13 }}</ref>

:<math> D_\text{KL}(\mathcal{N}_0 \parallel \mathcal{N}_1) = { 1 \over 2 } \left\{ \operatorname{tr} \left( \boldsymbol\Sigma_1^{-1} \boldsymbol\Sigma_0 \right) + \left( \boldsymbol\mu_1 - \boldsymbol\mu_0\right)^{\rm T} \boldsymbol\Sigma_1^{-1} ( \boldsymbol\mu_1 - \boldsymbol\mu_0 ) - k +\ln { | \boldsymbol \Sigma_1 | \over | \boldsymbol\Sigma_0 | } \right\}, </math> where <math>|\cdot|</math> denotes the matrix determinant, <math>tr(\cdot)</math> is the trace, <math>\ln(\cdot)</math> is the natural logarithm and <math>k</math> is the dimension of the vector space.

The logarithm must be taken to base ''e'' since the two terms following the logarithm are themselves base-''e'' logarithms of expressions that are either factors of the density function or otherwise arise naturally. The equation therefore gives a result measured in nats. Dividing the entire expression above by log<sub>''e''</sub>&nbsp;2 yields the divergence in bits.

When <math>\boldsymbol\mu_1 = \boldsymbol\mu_0</math>,

:<math> D_\text{KL}(\mathcal{N}_0 \parallel \mathcal{N}_1) = { 1 \over 2 } \left\{ \operatorname{tr} \left( \boldsymbol\Sigma_1^{-1} \boldsymbol\Sigma_0 \right) - k +\ln { | \boldsymbol \Sigma_1 | \over | \boldsymbol\Sigma_0 | }\right\}. </math>

===Mutual information=== The mutual information of two multivariate normal distribution is a special case of the Kullback–Leibler divergence in which <math>P</math> is the full <math>k</math> dimensional multivariate distribution and <math>Q</math> is the product of the <math>k_1</math> and <math>k_2</math> dimensional marginal distributions <math>X</math> and <math>Y</math>, such that <math>k_1 + k_2 = k</math>. The mutual information between <math>X</math> and <math>Y</math> is given by:<ref>[https://statproofbook.github.io/P/mvn-mi.html Proof: Mutual information of the multivariate normal distribution]</ref>

:<math> I(\boldsymbol{X}, \boldsymbol{Y}) = \frac{1}{2} \ln \left( \frac{\det(\Sigma_X) \det(\Sigma_Y)}{\det(\Sigma)} \right), </math>

where

:<math> \Sigma = \begin{bmatrix} \Sigma_X & \Sigma_{XY} \\ \Sigma_{XY} & \Sigma_Y \end{bmatrix}. </math>

If <math>Q</math> is product of <math>k</math> one-dimensional normal distributions, then in the notation of the Kullback–Leibler divergence section of this article, <math>\boldsymbol\Sigma_1</math> is a diagonal matrix with the diagonal entries of <math>\boldsymbol\Sigma_0</math>, and <math>\boldsymbol\mu_1 = \boldsymbol\mu_0</math>. The resulting formula for mutual information is:

:<math> I(\boldsymbol{X}) = - { 1 \over 2 } \ln | \boldsymbol \rho_0 |, </math>

where <math>\boldsymbol \rho_0</math> is the correlation matrix constructed from <math>\boldsymbol \Sigma_0</math>.<ref>{{Cite book |last=MacKay |first=David J. C. |title=Information Theory, Inference and Learning Algorithms |date=2003-10-06 |publisher=Cambridge University Press |isbn=978-0-521-64298-9 |edition=Illustrated |location=Cambridge |language=en}}</ref>

In the bivariate case the expression for the mutual information is:

:<math> I(x;y) = - { 1 \over 2 } \ln (1 - \rho^2). </math>

===Joint normality===

====Normally distributed and independent====

If <math>X</math> and <math>Y</math> are normally distributed and independent, this implies they are "jointly normally distributed", i.e., the pair <math>(X,Y)</math> must have multivariate normal distribution. However, a pair of jointly normally distributed variables need not be independent (would only be so if uncorrelated, <math> \rho = 0</math> ).

====Two normally distributed random variables need not be jointly bivariate normal==== {{See also|normally distributed and uncorrelated does not imply independent}} The fact that two random variables <math>X</math> and <math>Y</math> both have a normal distribution does not imply that the pair <math>(X,Y)</math> has a joint normal distribution. A simple example is one in which <math>X</math> has a normal distribution with expected value 0 and variance 1, and <math>Y=X</math> if <math>|X| > c</math> and <math>Y=-X</math> if <math>|X| < c</math>, where <math>c > 0</math>. There are similar counterexamples for more than two random variables. In general, they sum to a mixture model.{{citation needed|date=August 2020}}

====Correlations and independence====

In general, random variables may be uncorrelated but statistically dependent. But if a random vector has a multivariate normal distribution then any two or more of its components that are uncorrelated are independent. This implies that any two or more of its components that are pairwise independent are independent. But, as pointed out just above, it is ''not'' true that two random variables that are (''separately'', marginally) normally distributed and uncorrelated are independent.

===Conditional distributions===

If ''N''-dimensional '''x''' is partitioned as follows :<math> \mathbf{x} = \begin{bmatrix} \mathbf{x}_1 \\ \mathbf{x}_2 \end{bmatrix} \text{ with sizes }\begin{bmatrix} q \times 1 \\ (N-q) \times 1 \end{bmatrix}</math>

and accordingly '''''μ''''' and '''Σ''' are partitioned as follows

:<math> \boldsymbol\mu = \begin{bmatrix} \boldsymbol\mu_1 \\ \boldsymbol\mu_2 \end{bmatrix} \text{ with sizes }\begin{bmatrix} q \times 1 \\ (N-q) \times 1 \end{bmatrix}</math>

:<math> \boldsymbol\Sigma = \begin{bmatrix} \boldsymbol\Sigma_{11} & \boldsymbol\Sigma_{12} \\ \boldsymbol\Sigma_{21} & \boldsymbol\Sigma_{22} \end{bmatrix} \text{ with sizes }\begin{bmatrix} q \times q & q \times (N-q) \\ (N-q) \times q & (N-q) \times (N-q) \end{bmatrix}</math>

then the distribution of '''x'''<sub>1</sub> conditional on '''x'''<sub>2</sub> = '''a''' is multivariate normal<ref>{{Cite thesis | last1 = Holt | first1 = W. | last2 = Nguyen | first2 = D. | url = https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4494314 | title = Essential Aspects of Bayesian Data Imputation | year = 2023 | ssrn = 4494314 }}</ref> {{nowrap|('''x'''<sub>1</sub>&nbsp;{{!}}&nbsp;'''x'''<sub>2</sub> {{=}} '''a''') ~ ''N''(<span style{{=}}"text-decoration:overline;">'''''μ'''''</span>, <span style{{=}}"text-decoration:overline;">'''Σ'''</span>)}} where

:<math> \bar{\boldsymbol\mu} = \boldsymbol\mu_1 + \boldsymbol\Sigma_{12} \boldsymbol\Sigma_{22}^{-1} \left( \mathbf{a} - \boldsymbol\mu_2 \right) </math>

and covariance matrix

:<math> \overline{\boldsymbol\Sigma} = \boldsymbol\Sigma_{11} - \boldsymbol\Sigma_{12} \boldsymbol\Sigma_{22}^{-1} \boldsymbol\Sigma_{21}. </math><ref name=eaton>{{cite book|last=Eaton|first=Morris L.|title=Multivariate Statistics: a Vector Space Approach|year=1983|publisher=John Wiley and Sons|isbn=978-0-471-02776-8|pages=116–117}}</ref>

Here <math>\boldsymbol\Sigma_{22}^{-1}</math> is the generalized inverse of <math>\boldsymbol\Sigma_{22}</math>. The matrix <math>\overline{\boldsymbol\Sigma}</math> is the Schur complement of '''Σ'''<sub>22</sub> in '''Σ'''. That is, the equation above is equivalent to inverting the overall covariance matrix, dropping the rows and columns corresponding to the variables being conditioned upon, and inverting back to get the conditional covariance matrix.

Note that knowing that {{nowrap|'''x'''<sub>2</sub> {{=}} '''a'''}} alters the variance, though the new variance does not depend on the specific value of '''a'''; perhaps more surprisingly, the mean is shifted by <math>\boldsymbol\Sigma_{12} \boldsymbol\Sigma_{22}^{-1} \left(\mathbf{a} - \boldsymbol\mu_2 \right)</math>; compare this with the situation of not knowing the value of '''a''', in which case '''x'''<sub>1</sub> would have distribution <math>\mathcal{N}_q \left(\boldsymbol\mu_1, \boldsymbol\Sigma_{11} \right)</math>.

An interesting fact derived in order to prove this result, is that the random vectors <math>\mathbf{x}_2</math> and <math>\mathbf{y}_1=\mathbf{x}_1-\boldsymbol\Sigma_{12}\boldsymbol\Sigma_{22}^{-1}\mathbf{x}_2</math> are independent.

The matrix '''Σ'''<sub>12</sub>'''Σ'''<sub>22</sub><sup>−1</sup> is known as the matrix of regression coefficients.

==== Bivariate case ==== In the bivariate case where '''x''' is partitioned into <math>X_1</math> and <math>X_2</math>, the conditional distribution of <math>X_1</math> given <math>X_2</math> is<ref>{{cite book|last=Jensen|first=J|title=Statistics for Petroleum Engineers and Geoscientists|year=2000|publisher=Elsevier|location=Amsterdam|page=207|isbn=0-444-50552-0}}</ref>

: <math>X_1\mid X_2=a \ \sim\ \mathcal{N}\left(\mu_1+\frac{\sigma_1}{\sigma_2}\rho( a - \mu_2),\, (1-\rho^2)\sigma_1^2\right) </math>

where <math>\rho = \frac{\sigma_{12}}{\sigma_1\sigma_2}</math> is the correlation coefficient between <math>X_1</math> and <math>X_2</math>.

==== Bivariate conditional expectation ====

=====In the general case=====

:<math> \begin{pmatrix} X_1 \\ X_2 \end{pmatrix} \sim \mathcal{N} \left( \begin{pmatrix} \mu_1 \\ \mu_2 \end{pmatrix} , \begin{pmatrix} \sigma^2_1 & \rho \sigma_1 \sigma_2 \\ \rho \sigma_1 \sigma_2 & \sigma^2_2 \end{pmatrix} \right) </math>

The conditional expectation of X<sub>1</sub> given X<sub>2</sub> is:

: <math>\operatorname{E}(X_1 \mid X_2=x_2) = \mu_1 + \rho \frac{\sigma_1}{\sigma_2}(x_2 - \mu_2)</math>

Proof: the result is obtained by taking the expectation of the conditional distribution <math>X_1\mid X_2</math> above.

=====In the centered case with unit variances=====

:<math> \begin{pmatrix} X_1 \\ X_2 \end{pmatrix} \sim \mathcal{N} \left( \begin{pmatrix} 0 \\ 0 \end{pmatrix} , \begin{pmatrix} 1 & \rho \\ \rho & 1 \end{pmatrix} \right) </math>

The conditional expectation of ''X''<sub>1</sub> given ''X''<sub>2</sub> is

: <math>\operatorname{E}(X_1 \mid X_2=x_2)= \rho x_2 </math>

and the conditional variance is

: <math> \operatorname{var}(X_1 \mid X_2 = x_2) = 1-\rho^2; </math>

thus the conditional variance does not depend on ''x''<sub>2</sub>.

The conditional expectation of ''X''<sub>1</sub> given that ''X''<sub>2</sub> is smaller/bigger than ''z'' is:<ref name=Maddala83>{{cite book|last=Maddala|first=G. S.|title=Limited Dependent and Qualitative Variables in Econometrics|year=1983|publisher=Cambridge University Press|isbn=0-521-33825-5}}</ref>{{rp|367}}

:<math> \operatorname{E}(X_1 \mid X_2 < z) = -\rho { \varphi(z) \over \Phi(z) } , </math>

:<math> \operatorname{E}(X_1 \mid X_2 > z) = \rho { \varphi(z) \over (1- \Phi(z)) } , </math>

where the final ratio here is called the inverse Mills ratio.

Proof: the last two results are obtained using the result <math>\operatorname{E}(X_1 \mid X_2=x_2)= \rho x_2 </math>, so that

:<math> \operatorname{E}(X_1 \mid X_2 < z) = \rho E(X_2 \mid X_2 < z)</math> and then using the properties of the expectation of a truncated normal distribution.

===Marginal distributions=== To obtain the marginal distribution over a subset of multivariate normal random variables, one only needs to drop the irrelevant variables (the variables that one wants to marginalize out) from the mean vector and the covariance matrix. The proof for this follows from the definitions of multivariate normal distributions and linear algebra.<ref>An algebraic computation of the marginal distribution is shown here http://fourier.eng.hmc.edu/e161/lectures/gaussianprocess/node7.html {{Webarchive|url=https://web.archive.org/web/20100117200722/http://fourier.eng.hmc.edu/e161/lectures/gaussianprocess/node7.html |date=2010-01-17 }}. A much shorter proof is outlined here https://math.stackexchange.com/a/3832137</ref>

''Example''

Let {{nowrap|'''X''' {{=}} [''X''<sub>1</sub>, ''X''<sub>2</sub>, ''X''<sub>3</sub>]}} be multivariate normal random variables with mean vector {{nowrap|'''μ''' {{=}} [''μ''<sub>1</sub>, ''μ''<sub>2</sub>, ''μ''<sub>3</sub>]}} and covariance matrix '''Σ''' (standard parametrization for multivariate normal distributions). Then the joint distribution of {{nowrap|''{{prime|'X}}''' {{=}} [''X''<sub>1</sub>, ''X''<sub>3</sub>]}} is multivariate normal with mean vector {{nowrap|''{{prime|'μ}}''' {{=}} [''μ''<sub>1</sub>, ''μ''<sub>3</sub>]}} and covariance matrix <math> \boldsymbol\Sigma' = \begin{bmatrix} \boldsymbol\Sigma_{11} & \boldsymbol\Sigma_{13} \\ \boldsymbol\Sigma_{31} & \boldsymbol\Sigma_{33} \end{bmatrix} </math>.

===Affine transformation===

If {{nowrap|'''Y''' {{=}} '''c''' + '''BX'''}} is an affine transformation of <math>\mathbf{X}\ \sim \mathcal{N}(\boldsymbol\mu, \boldsymbol\Sigma),</math> where '''c''' is an <math>M \times 1</math> vector of constants and '''B''' is a constant <math>M \times N</math> matrix, then '''Y''' has a multivariate normal distribution with expected value {{nowrap|'''c''' + '''Bμ'''}} and variance '''BΣB'''<sup>T</sup> i.e., <math>\mathbf{Y} \sim \mathcal{N} \left(\mathbf{c} + \mathbf{B} \boldsymbol\mu, \mathbf{B} \boldsymbol\Sigma \mathbf{B}^{\rm T}\right)</math>. In particular, any subset of the ''X<sub>i</sub>'' has a marginal distribution that is also multivariate normal. To see this, consider the following example: to extract the subset (''X''<sub>1</sub>, ''X''<sub>2</sub>, ''X''<sub>4</sub>)<sup>T</sup>, use

:<math> \mathbf{B} = \begin{bmatrix} 1 & 0 & 0 & 0 & 0 & \ldots & 0 \\ 0 & 1 & 0 & 0 & 0 & \ldots & 0 \\ 0 & 0 & 0 & 1 & 0 & \ldots & 0 \end{bmatrix} </math>

which extracts the desired elements directly.

Another corollary is that the distribution of {{nowrap|'''Z''' {{=}} '''b''' · '''X'''}}, where '''b''' is a constant vector with the same number of elements as '''X''' and the dot indicates the dot product, is univariate Gaussian with <math>Z\sim\mathcal{N}\left(\mathbf{b}\cdot\boldsymbol\mu, \mathbf{b}^{\rm T}\boldsymbol\Sigma \mathbf{b}\right)</math>. This result follows by using

:<math> \mathbf{B}=\begin{bmatrix} b_1 & b_2 & \ldots & b_n \end{bmatrix} = \mathbf{b}^{\rm T}. </math> Observe how the positive-definiteness of '''Σ''' implies that the variance of the dot product must be positive.

An affine transformation of '''X''' such as 2'''X''' is not the same as the sum of two independent realisations of '''X'''.

===Geometric interpretation=== {{see also|Confidence region}}

The equidensity contours of a non-singular multivariate normal distribution are ellipsoids (i.e. affine transformations of hyperspheres) centered at the mean.<ref>{{cite web|author=Nikolaus Hansen|title=The CMA Evolution Strategy: A Tutorial|url=http://www.lri.fr/~hansen/cmatutorial.pdf|access-date=2012-01-07|archive-url=https://web.archive.org/web/20100331114258/http://www.lri.fr/~hansen/cmatutorial.pdf|archive-date=2010-03-31|bibcode=2016arXiv160400772H|year=2016|arxiv=1604.00772}}</ref> Hence the multivariate normal distribution is an example of the class of elliptical distributions. The directions of the principal axes of the ellipsoids are given by the eigenvectors of the covariance matrix <math>\boldsymbol\Sigma</math>. The squared relative lengths of the principal axes are given by the corresponding eigenvalues.

If {{nowrap|'''Σ''' {{=}} '''UΛU'''<sup>T</sup> {{=}} '''UΛ'''<sup>1/2</sup>('''UΛ'''<sup>1/2</sup>)<sup>T</sup>}} is an eigendecomposition where the columns of '''U''' are unit eigenvectors and '''Λ''' is a diagonal matrix of the eigenvalues, then we have

::<math>\mathbf{X}\ \sim \mathcal{N}(\boldsymbol\mu, \boldsymbol\Sigma) \iff \mathbf{X}\ \sim \boldsymbol\mu+\mathbf{U}\boldsymbol\Lambda^{1/2}\mathcal{N}(0, \mathbf{I}) \iff \mathbf{X}\ \sim \boldsymbol\mu+\mathbf{U}\mathcal{N}(0, \boldsymbol\Lambda).</math>

Moreover, '''U''' can be chosen to be a rotation matrix, as inverting an axis does not have any effect on ''N''(0, '''Λ'''), but inverting a column changes the sign of '''U''''s determinant. The distribution ''N''('''μ''', '''Σ''') is in effect ''N''(0, '''I''') scaled by '''Λ'''<sup>1/2</sup>, rotated by '''U''' and translated by '''μ'''.

Conversely, any choice of '''μ''', full rank matrix '''U''', and positive diagonal entries Λ<sub>''i''</sub> yields a non-singular multivariate normal distribution. If any Λ<sub>''i''</sub> is zero and '''U''' is square, the resulting covariance matrix '''UΛU'''<sup>T</sup> is singular. Geometrically this means that every contour ellipsoid is infinitely thin and has zero volume in ''n''-dimensional space, as at least one of the principal axes has length of zero; this is the degenerate case.

"The radius around the true mean in a bivariate normal random variable, re-written in polar coordinates (radius and angle), follows a Hoyt distribution."<ref>{{cite web |title=The Hoyt Distribution (Documentation for R package 'shotGroups' version 0.6.2) |author=Daniel Wollschlaeger |url=http://finzi.psych.upenn.edu/usr/share/doc/library/shotGroups/html/hoyt.html }}{{dead link|date=December 2017 |bot=InternetArchiveBot |fix-attempted=yes }}</ref>

In one dimension the probability of finding a sample of the normal distribution in the interval <math>\mu\pm \sigma</math> is approximately 68.27%, but in higher dimensions the probability of finding a sample in the region of the standard deviation ellipse is lower.<ref>{{Cite journal|last1=Wang|first1=Bin|last2=Shi|first2=Wenzhong|last3=Miao|first3=Zelang|date=2015-03-13|editor-last=Rocchini|editor-first=Duccio|title=Confidence Analysis of Standard Deviational Ellipse and Its Extension into Higher Dimensional Euclidean Space|journal=PLOS ONE|language=en|volume=10|issue=3|article-number=e0118537|doi=10.1371/journal.pone.0118537|issn=1932-6203|pmc=4358977|pmid=25769048|bibcode=2015PLoSO..1018537W|doi-access=free}}</ref> {| class="wikitable" ! Dimensionality !! Probability |- | 1 || 0.6827 |- |2 ||0.3935 |- |3 ||0.1987 |- |4 ||0.0902 |- |5 ||0.0374 |- |6 ||0.0144 |- |7 ||0.0052 |- |8 ||0.0018 |- |9 ||0.0006 |- |10 ||0.0002 |}

==Statistical inference== ===Parameter estimation=== {{further|Estimation of covariance matrices}} The derivation of the maximum-likelihood estimator of the covariance matrix of a multivariate normal distribution is straightforward.

In short, the probability density function (pdf) of a multivariate normal is

:<math>f(\mathbf{x})= \frac{1}{\sqrt { (2\pi)^k|\boldsymbol \Sigma| } } \exp\left(-{1 \over 2} (\mathbf{x}-\boldsymbol\mu)^{\rm T} \boldsymbol\Sigma^{-1} ({\mathbf x}-\boldsymbol\mu)\right)</math>

and the ML estimator of the covariance matrix from a sample of ''n'' observations is <ref name="papers.ssrn.com">{{Cite thesis | last1 = Holt | first1 = W. | last2 = Nguyen | first2 = D. | url = https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4494314 | title = Introduction to Bayesian Data Imputation | year = 2023 | ssrn = 4494314 }}</ref>

:<math>\widehat{\boldsymbol\Sigma} = {1 \over n}\sum_{i=1}^n ({\mathbf x}_i-\overline{\mathbf x})({\mathbf x}_i-\overline{\mathbf x})^\mathrm{T} </math>

which is simply the sample covariance matrix. This is a biased estimator whose expectation is

:<math>E\left[\widehat{\boldsymbol\Sigma}\right] = \frac{n-1}{n} \boldsymbol\Sigma.</math>

An unbiased sample covariance is

:<math>\widehat{\boldsymbol\Sigma} = \frac1{n-1}\sum_{i=1}^n (\mathbf{x}_i-\overline{\mathbf{x}})(\mathbf{x}_i-\overline{\mathbf{x}})^{\rm T} = \frac1{n-1} \left[X'\left(I - \frac{1}{n} \cdot J\right) X\right] </math> (matrix form; <math>I</math> is the <math>K\times K</math> identity matrix, J is a <math>K \times K</math> matrix of ones; the term in parentheses is thus the <math>K \times K</math> centering matrix)

The Fisher information matrix for estimating the parameters of a multivariate normal distribution has a closed form expression. This can be used, for example, to compute the Cramér–Rao bound for parameter estimation in this setting. See Fisher information for more details.

===Bayesian inference=== In Bayesian statistics, the conjugate prior of the mean vector is another multivariate normal distribution, and the conjugate prior of the covariance matrix is an inverse-Wishart distribution <math>\mathcal{W}^{-1}</math> . Suppose then that ''n'' observations have been made :<math>\mathbf{X} = \{\mathbf{x}_1,\dots,\mathbf{x}_n\} \sim \mathcal{N}(\boldsymbol\mu,\boldsymbol\Sigma)</math> and that a conjugate prior has been assigned, where :<math>p(\boldsymbol\mu,\boldsymbol\Sigma)=p(\boldsymbol\mu\mid\boldsymbol\Sigma)\ p(\boldsymbol\Sigma),</math> where :<math>p(\boldsymbol\mu\mid\boldsymbol\Sigma) \sim\mathcal{N}(\boldsymbol\mu_0,m^{-1}\boldsymbol\Sigma) ,</math> and :<math>p(\boldsymbol\Sigma) \sim \mathcal{W}^{-1}(\boldsymbol\Psi,n_0).</math>

Then<ref name="papers.ssrn.com"/>

:<math> \begin{array}{rcl} p(\boldsymbol\mu\mid\boldsymbol\Sigma,\mathbf{X}) & \sim & \mathcal{N}\left(\frac{n\bar{\mathbf{x}} + m\boldsymbol\mu_0}{n+m},\frac{1}{n+m}\boldsymbol\Sigma\right),\\ p(\boldsymbol\Sigma\mid\mathbf{X}) & \sim & \mathcal{W}^{-1}\left(\boldsymbol\Psi+n\mathbf{S}+\frac{nm}{n+m}(\bar{\mathbf{x}}-\boldsymbol\mu_0)(\bar{\mathbf{x}}-\boldsymbol\mu_0)', n+n_0\right), \end{array} </math> where :<math> \begin{align} \bar{\mathbf{x}} & = \frac{1}{n}\sum_{i=1}^{n} \mathbf{x}_i ,\\ \mathbf{S} & = \frac{1}{n}\sum_{i=1}^{n} (\mathbf{x}_i - \bar{\mathbf{x}})(\mathbf{x}_i - \bar{\mathbf{x}})' . \end{align} </math>

=== Multivariate normality tests ===

Multivariate normality tests check a given set of data for similarity to the multivariate normal distribution. The null hypothesis is that the data set is similar to the normal distribution, therefore a sufficiently small ''p''-value indicates non-normal data. Multivariate normality tests include the Cox–Small test<ref>{{Cite journal | last1 = Cox | first1 = D. R. | last2 = Small | first2 = N. J. H. | doi = 10.1093/biomet/65.2.263 | title = Testing multivariate normality | journal = Biometrika | volume = 65 | issue = 2 | page = 263 | year = 1978 }}</ref> and Smith and Jain's adaptation<ref>{{Cite journal | last1 = Smith | first1 = S. P. | last2 = Jain | first2 = A. K. | doi = 10.1109/34.6789 | title = A test to determine the multivariate normality of a data set | journal = IEEE Transactions on Pattern Analysis and Machine Intelligence | volume = 10 | issue = 5 | page = 757 | year = 1988 }}</ref> of the Friedman–Rafsky test created by Larry Rafsky and Jerome Friedman.<ref>{{Cite journal | last1 = Friedman | first1 = J. H. | last2 = Rafsky | first2 = L. C. | doi = 10.1214/aos/1176344722 | title = Multivariate Generalizations of the Wald–Wolfowitz and Smirnov Two-Sample Tests | journal = The Annals of Statistics | volume = 7 | issue = 4 | page = 697 | year = 1979 | doi-access = free }}</ref>

====Mardia's test==== '''Mardia's test'''<ref name=Mardia/> is based on multivariate extensions of skewness and kurtosis measures. For a sample {'''x'''<sub>1</sub>, ..., '''x'''<sub>''n''</sub>} of ''k''-dimensional vectors we compute : <math>\begin{align} & \widehat{\boldsymbol\Sigma} = {1 \over n} \sum_{j=1}^n \left(\mathbf{x}_j - \bar{\mathbf{x}}\right)\left(\mathbf{x}_j - \bar{\mathbf{x}}\right)^\mathrm{T} \\

& A = {1 \over 6n} \sum_{i=1}^n \sum_{j=1}^n \left[ (\mathbf{x}_i - \bar{\mathbf{x}})^\mathrm{T}\;\widehat{\boldsymbol\Sigma}^{-1} (\mathbf{x}_j - \bar{\mathbf{x}}) \right]^3 \\

& B = \sqrt{\frac{n}{8k(k+2)}}\left\{{1 \over n} \sum_{i=1}^n \left[ (\mathbf{x}_i - \bar{\mathbf{x}})^\mathrm{T}\;\widehat{\boldsymbol\Sigma}^{-1} (\mathbf{x}_i - \bar{\mathbf{x}}) \right]^2 - k(k+2) \right\} \end{align}</math> Under the null hypothesis of multivariate normality, the statistic ''A'' will have approximately a chi-squared distribution with {{nowrap|{{frac2|1|6}}⋅''k''(''k'' + 1)(''k'' + 2)}} degrees of freedom, and ''B'' will be approximately standard normal ''N''(0,1).

Mardia's kurtosis statistic is skewed and converges very slowly to the limiting normal distribution. For medium size samples <math>(50 \le n < 400)</math>, the parameters of the asymptotic distribution of the kurtosis statistic are modified<ref>Rencher (1995), pages 112–113.</ref> For small sample tests (<math>n<50</math>) empirical critical values are used. Tables of critical values for both statistics are given by Rencher<ref>Rencher (1995), pages 493–495.</ref> for ''k''&nbsp;=&nbsp;2,&nbsp;3,&nbsp;4.

Mardia's tests are affine invariant but not consistent. For example, the multivariate skewness test is not consistent against symmetric non-normal alternatives.<ref>{{Cite journal | last1 = Baringhaus | first1 = L. | last2 = Henze | first2 = N. | doi = 10.1016/0047-259X(91)90031-V | title = Limit distributions for measures of multivariate skewness and kurtosis based on projections | journal = Journal of Multivariate Analysis | volume = 38 | pages = 51–69 | year = 1991 | doi-access = free }}</ref>

====BHEP test==== The '''BHEP test'''<ref name=BH/> computes the norm of the difference between the empirical characteristic function and the theoretical characteristic function of the normal distribution. Calculation of the norm is performed in the L<sup>2</sup>(''μ'') space of square-integrable functions with respect to the Gaussian weighting function <math> \mu_\beta(\mathbf{t}) = (2\pi\beta^2)^{-k/2} e^{-|\mathbf{t}|^2/(2\beta^2)}</math>. The test statistic is : <math>\begin{align} T_\beta &= \int_{\mathbb{R}^k} \left| {1 \over n} \sum_{j=1}^n e^{i\mathbf{t}^\mathrm{T}\widehat{\boldsymbol\Sigma}^{-1/2}(\mathbf{x}_j - \bar{\mathbf{x})}} - e^{-|\mathbf{t}|^2/2} \right|^2 \; \boldsymbol\mu_\beta(\mathbf{t}) \, d\mathbf{t} \\ &= {1 \over n^2} \sum_{i,j=1}^n e^{-{\beta^2 \over 2}(\mathbf{x}_i-\mathbf{x}_j)^\mathrm{T}\widehat{\boldsymbol\Sigma}^{-1}(\mathbf{x}_i-\mathbf{x}_j)} - \frac{2}{n(1 + \beta^2)^{k/2}}\sum_{i=1}^n e^{ -\frac{\beta^2}{2(1+\beta^2)} (\mathbf{x}_i-\bar{\mathbf{x}})^\mathrm{T}\widehat{\boldsymbol\Sigma}^{-1}(\mathbf{x}_i-\bar{\mathbf{x}})} + \frac{1}{(1 + 2\beta^2)^{k/2}} \end{align}</math> The limiting distribution of this test statistic is a weighted sum of chi-squared random variables.<ref name=BH/>

A detailed survey of these and other test procedures is available.<ref name=Henze/>

==Computational methods== ===Drawing values from the distribution===

A widely used method for drawing (sampling) a random vector '''x''' from the ''N''-dimensional multivariate normal distribution with mean vector '''μ''' and covariance matrix '''Σ''' works as follows:<ref name=Gentle/>

# Find any real matrix '''A''' such that {{nowrap|'''AA'''<sup>T</sup> {{=}} '''Σ'''}}. When '''Σ''' is positive-definite, the Cholesky decomposition is typically used because it is widely available, computationally efficient, and well known. If a rank-revealing (pivoted) Cholesky decomposition such as LAPACK's dpstrf() is available, it can be used in the general positive-semidefinite case as well. A slower general alternative is to use the matrix '''A''' = '''UΛ'''<sup>1/2</sup> obtained from a spectral decomposition '''Σ''' = '''UΛU'''<sup>−1</sup> of '''Σ'''. # Let {{nowrap|'''z''' {{=}} (''z''<sub>1</sub>, ..., ''z<sub>N</sub>'')<sup>T</sup>}} be a vector whose components are ''N'' independent standard normal variates (which can be generated, for example, by using the Box–Muller transform). # Let '''x''' be {{nowrap|'''μ''' + '''Az'''}}. This has the desired distribution due to the affine transformation property.

== See also == * Chi distribution, the pdf of the 2-norm (Euclidean norm or vector length) of a multivariate normally distributed vector (uncorrelated and zero centered). ** Rayleigh distribution, the pdf of the vector length of a bivariate normally distributed vector (uncorrelated and zero centered) ** Rice distribution, the pdf of the vector length of a bivariate normally distributed vector (uncorrelated and non-centered) ** Hoyt distribution, the pdf of the vector length of a bivariate normally distributed vector (correlated and centered) * Complex normal distribution, an application of bivariate normal distribution * Copula, for the definition of the Gaussian or normal copula model. * Multivariate t-distribution, which is another widely used spherically symmetric multivariate distribution. * Multivariate stable distribution extension of the multivariate normal distribution, when the index (exponent in the characteristic function) is between zero and two. * Mahalanobis distance * Wishart distribution * Matrix normal distribution

== References == {{Reflist|refs=

<ref name = Siotani>{{cite journal | last = Siotani |first=Minoru | title = Tolerance regions for a multivariate normal population | journal = Annals of the Institute of Statistical Mathematics | year = 1964 | volume = 16 | number = 1 | pages = 135–153 | doi = 10.1007/BF02868568 |s2cid=123269490 | url = http://www.ism.ac.jp/editsec/aism/pdf/016_1_0135.pdf }}</ref>

<ref name=Mardia>{{cite journal | last = Mardia | first = K. V. | year = 1970 | title = Measures of multivariate skewness and kurtosis with applications | journal = Biometrika | volume = 57 | issue = 3 | pages = 519–530 | doi = 10.1093/biomet/57.3.519 }}</ref>

<!-- <ref name=EP>{{cite journal | last1 = Epps | first1 = Lawrence B. | last2 = Pulley | first2 = Lawrence B. | year = 1983 | title = A test for normality based on the empirical characteristic function | journal = Biometrika | volume = 70 | issue = 3 | pages = 723–726 | doi = 10.1093/biomet/70.3.723 }}</ref> -->

<ref name=BH>{{cite journal | last1 = Baringhaus | first1 = L. | last2 = Henze | first2 = N. | year = 1988 | title = A consistent test for multivariate normality based on the empirical characteristic function | journal = Metrika | volume = 35 | issue = 1 | pages = 339–348 | doi = 10.1007/BF02613322 | s2cid = 122362448 }}</ref>

<ref name=Henze>{{cite journal | last = Henze | first = Norbert | year = 2002 | title = Invariant tests for multivariate normality: a critical review | journal = Statistical Papers | volume = 43 | issue = 4 | pages = 467–506 | doi = 10.1007/s00362-002-0119-6 | s2cid = 122934510 }}</ref>

<ref name=HT>{{cite journal | last1 = Hamedani | first1 = G. G. | last2 = Tata | first2 = M. N. | year = 1975 | title = On the determination of the bivariate normal distribution from distributions of linear combinations of the variables | journal = The American Mathematical Monthly | volume = 82 | issue = 9 | pages = 913–915 | doi = 10.2307/2318494 | jstor = 2318494 }}</ref>

<ref name=wyattlms>{{cite web |last=Wyatt |first=John | title=Linear least mean-squared error estimation | url=http://web.mit.edu/6.041/www/LECTURE/lec22.pdf | work=Lecture notes course on applied probability | date=November 26, 2008 | archive-date=October 10, 2015 | archive-url=https://web.archive.org/web/20151010114443/http://web.mit.edu/6.041/www/LECTURE/lec22.pdf | access-date=23 January 2012 }}</ref>

<ref name=rao>{{cite book | last = Rao |first=C. R. |author-link=C. R. Rao | title = Linear Statistical Inference and Its Applications | year = 1973 | publisher = Wiley | location = New York | pages = 527–528 | isbn = 0-471-70823-2 }}</ref>

<ref name=Gentle>{{cite book | last = Gentle |first=J. E. | title = Computational Statistics | year = 2009 | publisher = Springer | location = New York | pages = 315–316 | doi = 10.1007/978-0-387-98144-4 | series = Statistics and Computing | isbn = 978-0-387-98143-7 | url = https://cds.cern.ch/record/1639470 }}</ref>

<ref name=Hernandez-Stumpfhauser>{{cite journal | title=The General Projected Normal Distribution of Arbitrary Dimension: Modeling and Bayesian Inference | year=2017 | journal=Bayesian Analysis | volume=12 | pages=113–133 | issue=1 | last1=Hernandez-Stumpfhauser | first1=Daniel | last2=Breidt | first2=F. Jay | last3=van der Woerd | first3=Mark J. | doi=10.1214/15-BA989 | doi-access=free }}</ref> }}

=== Literature ===

{{refbegin}} * {{cite book | author = Rencher, A.C. | title = Methods of Multivariate Analysis | year = 1995 | publisher = Wiley | location = New York }} * {{cite book |first=Y. L. |last=Tong |title=The multivariate normal distribution |year=1990 |isbn=978-1-4613-9657-4 |series=Springer Series in Statistics |location=New York |publisher=Springer-Verlag |doi=10.1007/978-1-4613-9655-0|s2cid=120348131 }}

{{refend}}

{{ProbDistributions|multivariate|state=collapsed}} {{statistics|analysis|state=collapsed}}

{{DEFAULTSORT:Multivariate Normal Distribution}} Category:Continuous distributions Category:Multivariate continuous distributions Category:Normal distribution Category:Exponential family distributions Category:Stable distributions