Generalization of the one-dimensional normal distribution to higher dimensions
Multivariate normal
Probability density function
Many sample points from a multivariate normal distribution with and, shown along with the 3-sigma ellipse, the two marginal distributions, and the two 1-d histograms.
Inprobability theory andstatistics, themultivariate normal distribution,multivariate Gaussian distribution, orjoint normal distribution is a generalization of the one-dimensional (univariate)normal distribution to higherdimensions. One definition is that arandom vector is said to bek-variate normally distributed if everylinear combination of itsk components has a univariate normal distribution. Its importance derives mainly from themultivariate central limit theorem. The multivariate normal distribution is often used to describe, at least approximately, any set of (possibly)correlated real-valuedrandom variables, each of which clusters around a mean value.
A realrandom vector is called astandard normal random vector if all of its components are independent and each is a zero-mean unit-variance normally distributed random variable, i.e. if for all.[1]: p. 454
A real random vector is called acentered normal random vector if there exists a matrix such that has the same distribution as where is a standard normal random vector with components.[1]: p. 454
A real random vector is called anormal random vector if there exists a random-vector, which is a standard normal random vector, a-vector, and a matrix, such that.[2]: p. 454 [1]: p. 455
In thedegenerate case where the covariance matrix issingular, the corresponding distribution has no density; see thesection below for details. This case arises frequently instatistics; for example, in the distribution of the vector ofresiduals in theordinary least squares regression. The are in generalnot independent; they can be seen as the result of applying the matrix to a collection of independent Gaussian variables.
The following definitions are equivalent to the definition given above. A random vector has a multivariate normal distribution if it satisfies one of the following equivalent conditions.
Every linear combination of its components isnormally distributed. That is, for any constant vector, the random variable has a univariate normal distribution, where a univariate normal distribution with zero variance is a point mass on its mean.
The spherical normal distribution can be characterised as the unique distribution where components are independent in any orthogonal coordinate system.[3][4]
where is a realk-dimensional column vector and is thedeterminant of, also known as thegeneralized variance. The equation above reduces to that of the univariate normal distribution if is a matrix (i.e., a single real number).
Each iso-densitylocus — the locus of points ink-dimensional space each of which gives the same particular value of the density — is anellipse or its higher-dimensional generalization; hence the multivariate normal is a special case of theelliptical distributions.
The quantity is known as theMahalanobis distance, which represents the distance of the test point from the mean. The squared Mahalanobis distance is decomposed into a sum ofk terms, each term being a product of three meaningful components.[6]Note that in the case when, the distribution reduces to a univariate normal distribution and the Mahalanobis distance reduces to the absolute value of thestandard score. See alsoInterval below.
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 acountably infinite set of distinct linear combinations of and are normal in order to conclude that the vector of is bivariate normal.[7]
The bivariate iso-density loci plotted in the-plane areellipses, whoseprincipal axes are defined by theeigenvectors of the covariance matrix (the major and minorsemidiameters of the ellipse equal the square-root of the ordered eigenvalues).
Bivariate normal distribution centered at with a standard deviation of 3 in roughly the direction and of 1 in the orthogonal direction.
As the absolute value of the correlation parameter increases, these loci are squeezed toward the following line :
If the covariance matrix 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 tok-dimensionalLebesgue measure (which is the usual measure assumed in calculus-level probability courses). Only random vectors whose distributions areabsolutely 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 of the coordinates of such that the covariance matrix for this subset is positive definite; then the other coordinates may be thought of as anaffine function of these selected coordinates.[9]
To talk about densities meaningfully in singular cases, then, we must select a different base measure. Using thedisintegration theorem we can define a restriction of Lebesgue measure to the-dimensional affine subspace of where the Gaussian distribution is supported, i.e.. With respect to this measure the distribution has the density of the following motif:
The notion ofcumulative 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 of a random vector as the probability that all components of are less than or equal to the corresponding values in the vector:[11]
Though there is no closed form for, there are a number of algorithms that estimate it numerically.[11][12]
Another way is to define the cdf as the probability that a sample lies inside the ellipsoid determined by itsMahalanobis distance from the Gaussian, a direct generalization of the standard deviation.[13]In order to compute the values of this function, closed analytic formula exist,[13] as follows.
Theinterval for the multivariate normal distribution yields a region consisting of those vectorsx satisfying
Here is a-dimensional vector, is the known-dimensional mean vector, is the knowncovariance matrix and is thequantile function for probability of thechi-squared distribution with degrees of freedom.[14]When the expression defines the interior of an ellipse and the chi-squared distribution simplifies to anexponential distribution with mean equal to two (rate equal to half).
Complementary cumulative distribution function (tail distribution)
While no simple closed formula exists for computing the ccdf, the maximum of dependent Gaussian variables can be estimated accurately via theMonte Carlo method.[15][16]
Top: the probability of a bivariate normal in the domain (blue regions). Middle: the probability of a trivariate normal in a toroidal domain. Bottom: converging Monte-Carlo integral of the probability of a 4-variate normal in the 4d regular polyhedral domain defined by. These are all computed by the numerical method of ray-tracing.[17]
The probability content of the multivariate normal in a quadratic domain defined by (where is a matrix, is a vector, and is a scalar), which is relevant for Bayesian classification/decision theory using Gaussian discriminant analysis, is given by thegeneralized chi-squared distribution.[17]The probability content within any general domain defined by (where is a general function) can be computed using the numerical method of ray-tracing[17] (Matlab code).
where the sum is taken over all allocations of the set intoλ (unordered) pairs. That is, for akth (= 2λ = 6) central moment, one sums the products ofλ = 3 covariances (the expected valueμ is taken to be 0 in the interests of parsimony):
This yields 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 are3 × 5 = 15 terms, and for eighth-order moments there are3 × 5 × 7 = 105 terms.
The covariances are then determined by replacing the terms of the list by the corresponding terms of the list consisting ofr1 ones, thenr2 twos, etc.. To illustrate this, examine the following 4th-order central moment case:
where is the covariance ofXi andXj. With the above method one first finds the general case for akth moment withk differentX variables,, and then one simplifies this accordingly. For example, for, one letsXi =Xj and one uses the fact that.
a: Probability density of a function of a single normal variable with and.b: Probability density of a function of a normal vector, with mean, and covariance.c: Heat map of the joint probability density of two functions of a normal vector, with mean, and covariance.d: Probability density of a function of 4 iid standard normal variables. These are computed by the numerical method of ray-tracing.[17]
Thelogarithm must be taken to basee 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 innats. Dividing the entire expression above by loge 2 yields the divergence inbits.
Themutual information of two multivariate normal distribution is a special case of theKullback–Leibler divergence in which is the full dimensional multivariate distribution and is the product of the and dimensional marginal distributions and, such that. The mutual information between and is given by:[22]
where
If is product of one-dimensional normal distributions, then in the notation of theKullback–Leibler divergence section of this article, is adiagonal matrix with the diagonal entries of, and. The resulting formula for mutual information is:
If and are normally distributed andindependent, this implies they are "jointly normally distributed", i.e., the pair must have multivariate normal distribution. However, a pair of jointly normally distributed variables need not be independent (would only be so if uncorrelated, ).
Two normally distributed random variables need not be jointly bivariate normal
The fact that two random variables and both have a normal distribution does not imply that the pair has a joint normal distribution. A simple example is one in which X has a normal distribution with expected value 0 and variance 1, and if and if, where. There are similar counterexamples for more than two random variables. In general, they sum to amixture model.[citation needed]
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 areindependent. This implies that any two or more of its components that arepairwise independent are independent. But, as pointed out just above, it isnot true that two random variables that are (separately, marginally) normally distributed and uncorrelated are independent.
Here is thegeneralized inverse of. The matrix is theSchur complement ofΣ22 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 thatx2 =a alters the variance, though the new variance does not depend on the specific value ofa; perhaps more surprisingly, the mean is shifted by; compare this with the situation of not knowing the value ofa, in which casex1 would have distribution.
An interesting fact derived in order to prove this result, is that the random vectors and are independent.
The matrixΣ12Σ22−1 is known as the matrix ofregression coefficients.
To obtain themarginal 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.[28]
Example
LetX = [X1,X2,X3] be multivariate normal random variables with mean vectorμ = [μ1,μ2,μ3] and covariance matrixΣ (standard parametrization for multivariate normal distributions). Then the joint distribution ofX′ = [X1,X3] is multivariate normal with mean vectorμ′ = [μ1,μ3] and covariance matrix.
IfY =c +BX is anaffine transformation of wherec is an vector of constants andB is a constant matrix, thenY has a multivariate normal distribution with expected valuec +Bμ and varianceBΣBT i.e.,. In particular, any subset of theXi has a marginal distribution that is also multivariate normal.To see this, consider the following example: to extract the subset (X1,X2,X4)T, use
which extracts the desired elements directly.
Another corollary is that the distribution ofZ =b ·X, whereb is a constant vector with the same number of elements asX and the dot indicates thedot product, is univariate Gaussian with. This result follows by using
Observe how the positive-definiteness ofΣ implies that the variance of the dot product must be positive.
The equidensity contours of a non-singular multivariate normal distribution areellipsoids (i.e. affine transformations ofhyperspheres) centered at the mean.[29] Hence the multivariate normal distribution is an example of the class ofelliptical distributions. The directions of the principal axes of the ellipsoids are given by the eigenvectors of the covariance matrix. The squared relative lengths of the principal axes are given by the corresponding eigenvalues.
IfΣ =UΛUT =UΛ1/2(UΛ1/2)T is aneigendecomposition where the columns ofU are unit eigenvectors andΛ is adiagonal matrix of the eigenvalues, then we have
Moreover,U can be chosen to be arotation matrix, as inverting an axis does not have any effect onN(0,Λ), but inverting a column changes the sign ofU's determinant. The distributionN(μ,Σ) is in effectN(0,I) scaled byΛ1/2, rotated byU and translated byμ.
Conversely, any choice ofμ, full rank matrixU, and positive diagonal entries Λi yields a non-singular multivariate normal distribution. If any Λi is zero andU is square, the resulting covariance matrixUΛUT issingular. Geometrically this means that every contour ellipsoid is infinitely thin and has zero volume inn-dimensional space, as at least one of the principal axes has length of zero; this is thedegenerate case.
"The radius around the true mean in a bivariate normal random variable, re-written inpolar coordinates (radius and angle), follows aHoyt distribution."[30]
In one dimension the probability of finding a sample of the normal distribution in the interval is approximately 68.27%, but in higher dimensions the probability of finding a sample in the region of the standard deviation ellipse is lower.[31]
(matrix form; is the identity matrix, J is a matrix of ones; the term in parentheses is thus the centering matrix)
TheFisher information matrix for estimating the parameters of a multivariate normal distribution has a closed form expression. This can be used, for example, to compute theCramér–Rao bound for parameter estimation in this setting. SeeFisher information for more details.
Multivariate normality tests check a given set of data for similarity to the multivariatenormal distribution. Thenull hypothesis is that thedata set is similar to the normal distribution, therefore a sufficiently smallp-value indicates non-normal data. Multivariate normality tests include the Cox–Small test[33]and Smith and Jain's adaptation[34] of the Friedman–Rafsky test created byLarry Rafsky andJerome Friedman.[35]
Mardia's test[36] is based on multivariate extensions ofskewness andkurtosis measures. For a sample {x1, ...,xn} ofk-dimensional vectors we compute
Under the null hypothesis of multivariate normality, the statisticA will have approximately achi-squared distribution with1/6⋅k(k + 1)(k + 2) degrees of freedom, andB will be approximatelystandard normalN(0,1).
Mardia's kurtosis statistic is skewed and converges very slowly to the limiting normal distribution. For medium size samples, the parameters of the asymptotic distribution of the kurtosis statistic are modified[37] For small sample tests () empirical critical values are used. Tables of critical values for both statistics are given by Rencher[38] fork = 2, 3, 4.
Mardia's tests are affine invariant but not consistent. For example, the multivariate skewness test is not consistent againstsymmetric non-normal alternatives.[39]
TheBHEP test[40] computes the norm of the difference between the empiricalcharacteristic function and the theoretical characteristic function of the normal distribution. Calculation of the norm is performed in theL2(μ) space of square-integrable functions with respect to the Gaussian weighting function. The test statistic is
The limiting distribution of this test statistic is a weighted sum of chi-squared random variables.[40]
A detailed survey of these and other test procedures is available.[41]
Left: Classification of seven multivariate normal classes. Coloured ellipses are 1 sd error ellipses. Black marks the boundaries between the classification regions. is the probability of total classification error. Right: the error matrix. is the probability of classifying a sample from normal as. These are computed by the numerical method of ray-tracing[17] (Matlab code).
Suppose that observations (which are vectors) are presumed to come from one of several multivariate normal distributions, with known means and covariances. Then any given observation can be assigned to the distribution from which it has the highest probability of arising. This classification procedure is called Gaussian discriminant analysis.The classification performance, i.e. probabilities of the different classification outcomes, and the overall classification error, can be computed by the numerical method of ray-tracing[17] (Matlab code).
A widely used method for drawing (sampling) a random vectorx from theN-dimensional multivariate normal distribution with mean vectorμ andcovariance matrixΣ works as follows:[42]
Find any real matrixA such thatAAT =Σ. WhenΣ is positive-definite, theCholesky 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 matrixA =UΛ1/2 obtained from aspectral decompositionΣ =UΛU−1 ofΣ.
Multivariate stable distribution extension of the multivariate normal distribution, when the index (exponent in the characteristic function) is between zero and two.
^Kim, M. G. (2000). "Multivariate outliers and decompositions of Mahalanobis distance".Communications in Statistics – Theory and Methods.29 (7):1511–1526.doi:10.1080/03610920008832559.
^Hamedani, G. G.; Tata, M. N. (1975). "On the determination of the bivariate normal distribution from distributions of linear combinations of the variables".The American Mathematical Monthly.82 (9):913–915.doi:10.2307/2318494.JSTOR2318494.
^abBotev, Z. I.; Mandjes, M.; Ridder, A. (6–9 December 2015). "Tail distribution of the maximum of correlated Gaussian random variables".2015 Winter Simulation Conference (WSC). Huntington Beach, Calif., USA: IEEE. pp. 633–642.doi:10.1109/WSC.2015.7408202.hdl:10419/130486.ISBN978-1-4673-9743-8.
^Adler, R. J.; Blanchet, J.; Liu, J. (7–10 Dec 2008). "Efficient simulation for tail probabilities of Gaussian random fields".2008 Winter Simulation Conference (WSC). Miami, Fla., USA: IEEE. pp. 328–336.doi:10.1109/WSC.2008.4736085.ISBN978-1-4244-2707-9.
^abcdefghiDas, Abhranil; Wilson S Geisler (2020). "Methods to integrate multinormals and compute classification measures".arXiv:2012.14331 [stat.ML].
^Gokhale, DV; Ahmed, NA; Res, BC; Piscataway, NJ (May 1989). "Entropy Expressions and Their Estimators for Multivariate Distributions".IEEE Transactions on Information Theory.35 (3):688–692.doi:10.1109/18.30996.
^MacKay, David J. C. (2003-10-06).Information Theory, Inference and Learning Algorithms (Illustrated ed.). Cambridge: Cambridge University Press.ISBN978-0-521-64298-9.
^Cox, D. R.; Small, N. J. H. (1978). "Testing multivariate normality".Biometrika.65 (2): 263.doi:10.1093/biomet/65.2.263.
^Smith, S. P.; Jain, A. K. (1988). "A test to determine the multivariate normality of a data set".IEEE Transactions on Pattern Analysis and Machine Intelligence.10 (5): 757.doi:10.1109/34.6789.
^abBaringhaus, L.; Henze, N. (1988). "A consistent test for multivariate normality based on the empirical characteristic function".Metrika.35 (1):339–348.doi:10.1007/BF02613322.S2CID122362448.