Neha Patil (Editor)

Multivariate normal distribution

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Support
  
x ∈ μ + span(Σ) ⊆ R

Mode
  
μ

Mean
  
μ

Multivariate normal distribution

Notation
  
N ( μ , Σ ) {displaystyle {mathcal {N}}({oldsymbol {mu }},,{oldsymbol {Sigma }})}

Parameters
  
μ ∈ R — location Σ ∈ R — covariance (positive-definite matrix)

PDF
  
( 2 π ) − k / 2 | Σ | − 1 / 2 e − 1 2 ( x − μ ) ′ Σ − 1 ( x − μ ) , {displaystyle (2pi )^{-k/2}left|{oldsymbol {Sigma }} ight|^{-1/2},e^{-{ rac {1}{2}}(mathbf {x} -{oldsymbol {mu }})'{oldsymbol {Sigma }}^{-1}(mathbf {x} -{oldsymbol {mu }})},} exists only when Σ is positive-definite

In probability theory and statistics, the multivariate normal distribution or multivariate Gaussian distribution, is a generalization of the one-dimensional (univariate) normal distribution to higher dimensions. One possible 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.

Contents

Notation and parametrization

The multivariate normal distribution of a k-dimensional random vector x = [X1, X2, …, Xk] can be written in the following notation:

x     N ( μ , Σ ) ,

or to make it explicitly known that X is k-dimensional,

x     N k ( μ , Σ ) ,

with k-dimensional mean vector

μ = E [ x ] = [ E [ X 1 ] , E [ X 2 ] , , E [ X k ] ] ,

and k × k covariance matrix

Σ =: E [ ( X μ ) ( X μ ) T ] = [ Cov [ X i , X j ] ; 1 i , j k ] .

Definition

A random vector x = (X1, …, Xk)' is said to have the multivariate normal distribution if it satisfies the following equivalent conditions.

  • Every linear combination of its components Y = a1X1 + … + akXk is normally distributed. That is, for any constant vector aRk, the random variable Y = aTx has a univariate normal distribution, where a univariate normal distribution with zero variance is a point mass on its mean.
  • There exists a random -vector z, whose components are independent standard normal random variables, a k-vector μ, and a k×ℓ matrix A, such that x = Az + μ. Here is the rank of the covariance matrix Σ = AAT. Especially in the case of full rank, see the section below on Geometric interpretation.
  • There is a k-vector μ and a symmetric, positive semidefinite k×k matrix Σ, such that the characteristic function of x is
  • The covariance matrix is allowed to be singular (in which case the corresponding distribution has no density). This case arises frequently in statistics; for example, in the distribution of the vector of residuals in the ordinary least squares regression. Note also that the Xi are in general not independent; they can be seen as the result of applying the matrix A to a collection of independent Gaussian variables z.

    Non-degenerate case

    The multivariate normal distribution is said to be "non-degenerate" when the symmetric covariance matrix Σ is positive definite. In this case the distribution has density

    f x ( x 1 , , x k ) = exp ( 1 2 ( x μ ) T Σ 1 ( x μ ) ) ( 2 π ) k | Σ | = exp ( 1 2 ( x μ ) T Σ 1 ( x μ ) ) | 2 π Σ | ,

    where x is a real k-dimensional column vector and | Σ | is the determinant of Σ . Note how the equation above reduces to that of the univariate normal distribution if Σ is a 1 × 1 matrix (i.e. a single real number).

    Note that 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 descriptive statistic ( x μ ) T Σ 1 ( x μ ) is known as the Mahalanobis distance, which represents the distance of the test point x from the mean μ . Note that in case when k = 1 , 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 (k = rank(Σ) = 2), the probability density function of a vector [X Y]′ is: f ( x , y ) = 1 2 π σ X σ Y 1 ρ 2 exp ( 1 2 ( 1 ρ 2 ) [ ( x μ X ) 2 σ X 2 + ( y μ Y ) 2 σ Y 2 2 ρ ( x μ X ) ( y μ Y ) σ X σ Y ] )

    where ρ is the correlation between X and Y and where σ X > 0 and σ Y > 0 . In this case,

    μ = ( μ X μ Y ) , Σ = ( σ X 2 ρ σ X σ Y ρ σ X σ Y σ Y 2 ) .

    In the bivariate case, the first equivalent condition for multivariate normality can be made less restrictive: it is sufficient to verify that countably many distinct linear combinations of X and Y are normal in order to conclude that the vector [X Y]′ is bivariate normal.

    The bivariate iso-density loci plotted in the x,y-plane are ellipses. As the correlation parameter ρ increases, these loci appear to be squeezed to the following line :

    y ( x ) = sgn ( ρ ) σ Y σ X ( x μ X ) + μ Y .

    This is because the above expression – but without ρ being inside a signum function – is the best linear unbiased prediction of Y given a value of X.

    Degenerate case

    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 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 rank ( Σ ) of the coordinates of x such that the covariance matrix for this subset is positive definite; then the other coordinates may be thought of as an affine function of the selected coordinates.

    To talk about densities meaningfully in the singular case, then, we must select a different base measure. Using the disintegration theorem we can define a restriction of Lebesgue measure to the rank ( Σ ) -dimensional affine subspace of R k where the Gaussian distribution is supported, i.e. { μ + Σ 1 / 2 v : v R k } . With respect to this measure the distribution has density:

    f ( x ) = ( det ( 2 π Σ ) ) 1 2 e 1 2 ( x μ ) Σ + ( x μ )

    where Σ + is the generalized inverse and det* is the pseudo-determinant.

    Higher moments

    The kth-order moments of x are given by

    μ 1 , , N ( x )   = d e f   μ r 1 , , r N ( x )   = d e f   E [ j = 1 N X j r j ]

    where r1 + r2 + ⋯ + rN = k.

    The kth-order central moments are as follows

    μ 1 , , 2 λ ( x μ ) = ( σ i j σ k σ X Z )

    where the sum is taken over all allocations of the set { 1 , , 2 λ } into λ (unordered) pairs. That is, for a kth (= 2λ = 6) central moment, one sums the products of λ = 3 covariances (the expected value μ is taken to be 0 in the interests of parsimony):

    E [ X 1 X 2 X 3 X 4 X 5 X 6 ] = E [ X 1 X 2 ] E [ X 3 X 4 ] E [ X 5 X 6 ] + E [ X 1 X 2 ] E [ X 3 X 5 ] E [ X 4 X 6 ] + E [ X 1 X 2 ] E [ X 3 X 6 ] E [ X 4 X 5 ] + E [ X 1 X 3 ] E [ X 2 X 4 ] E [ X 5 X 6 ] + E [ X 1 X 3 ] E [ X 2 X 5 ] E [ X 4 X 6 ] + E [ X 1 X 3 ] E [ X 2 X 6 ] E [ X 4 X 5 ] + E [ X 1 X 4 ] E [ X 2 X 3 ] E [ X 5 X 6 ] + E [ X 1 X 4 ] E [ X 2 X 5 ] E [ X 3 X 6 ] + E [ X 1 X 4 ] E [ X 2 X 6 ] E [ X 3 X 5 ] + E [ X 1 X 5 ] E [ X 2 X 3 ] E [ X 4 X 6 ] + E [ X 1 X 5 ] E [ X 2 X 4 ] E [ X 3 X 6 ] + E [ X 1 X 5 ] E [ X 2 X 6 ] E [ X 3 X 4 ] + E [ X 1 X 6 ] E [ X 2 X 3 ] E [ X 4 X 5 ] + E [ X 1 X 6 ] E [ X 2 X 4 ] E [ X 3 X 5 ] + E [ X 1 X 6 ] E [ X 2 X 5 ] E [ X 3 X 4 ] .

    This yields 2 λ 1 ! 2 λ 1 ( λ 1 ) ! 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 3 × 5 = 15 terms, and for eighth-order moments there are 3 × 5 × 7 = 105 terms.

    The covariances are then determined by replacing the terms of the list [ 1 , , 2 λ ] by the corresponding terms of the list consisting of r1 ones, then r2 twos, etc.. To illustrate this, examine the following 4th-order central moment case:

    E [ X i 4 ] = 3 σ i i 2 E [ X i 3 X j ] = 3 σ i i σ i j E [ X i 2 X j 2 ] = σ i i σ j j + 2 σ i j 2 E [ X i 2 X j X k ] = σ i i σ j k + 2 σ i j σ i k E [ X i X j X k X n ] = σ i j σ k n + σ i k σ j n + σ i n σ j k .

    where σ i j is the covariance of Xi and Xj. With the above method one first finds the general case for a kth moment with k different X variables, E [ X i X j X k X n ] , and then one simplifies this accordingly. For example, for E [ X i 2 X k X n ] , one lets Xi = Xj and one uses the fact that σ i i = σ i 2 .

    Likelihood function

    If the mean and variance matrix are known, a suitable log likelihood function for a single observation x is

    ln ( L ) = 1 2 ( ln ( | Σ | ) + ( x μ ) T Σ 1 ( x μ ) + k ln ( 2 π ) ) ,

    where x is a vector of real numbers (to derive this, simply take the log of the PDF). The circularly symmetric version of the complex case, where z is a vector of complex numbers, would be

    ln ( L ) = ln ( | Σ | ) ( z μ ) Σ 1 ( z μ ) k ln ( π )

    i.e. with the conjugate transpose (indicated by ) replacing the normal transpose (indicated by T ). This is slightly different than in the real case, because the circularly symmetric version of the complex normal distribution has a slightly different form.

    A similar notation is used for multiple linear regression.

    Entropy

    The entropy of the multivariate normal distribution is

    h ( f ) = f ( x ) ln f ( x ) d x , = 1 2 ln ( | 2 π e Σ | ) = 1 2 ln ( ( 2 π e ) k | Σ | ) ,

    where the bars denote the matrix determinant and k is the dimensionality of the vector space.

    Kullback–Leibler divergence

    The Kullback–Leibler divergence from N 0 ( μ 0 , Σ 0 ) to N 1 ( μ 1 , Σ 1 ) , for non-singular matrices Σ0 and Σ1, is:

    D KL ( N 0 N 1 ) = 1 2 { t r ( Σ 1 1 Σ 0 ) + ( μ 1 μ 0 ) T Σ 1 1 ( μ 1 μ 0 ) k + ln | Σ 1 | | Σ 0 | } ,

    where k 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 loge 2 yields the divergence in bits.

    Mutual Information

    The mutual information of a distribution is a special case of the Kullback–Leibler divergence in which P is the full multivariate distribution and Q is the product of the 1-dimensional marginal distributions. In the notation of the Kullback–Leibler divergence section of this article, Σ 1 is a diagonal matrix with the diagonal entries of Σ 0 , and μ 1 = μ 0 . The resulting formula for mutual information is:

    I ( X ) = 1 2 ln | ρ 0 | ,

    where ρ 0 is the correlation matrix constructed from Σ 0 .

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

    I ( x ; y ) = 1 2 ln ( 1 ρ 2 ) .

    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 F ( x ) of a random vector X as the probability that all components of X are less than or equal to the corresponding values in the vector x :

    F ( x ) = P ( X x ) , where X N ( μ , Σ ) .

    Though there is no closed form for F ( x ) , there are a number of algorithms that estimate it numerically.

    Another way is to define the cdf F ( r ) as the probability that a sample lies inside the ellipsoid determined by its Mahalanobis distance r from the Gaussian, a direct generalization of the standard deviation . In order to compute the values of this function, closed analytic formulae exist, as follows.

    Interval

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

    ( x μ ) T Σ 1 ( x μ ) χ k 2 ( p ) .

    Here x is a k -dimensional vector, μ is the known k -dimensional mean vector, Σ is the known covariance matrix and χ k 2 ( p ) is the quantile function for probability p of the chi-squared distribution with k degrees of freedom. When k = 2 , the expression defines the interior of an ellipse and the chi-squared distribution simplifies to an exponential distribution with mean equal to two.

    Normally distributed and independent

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

    Two normally distributed random variables need not be jointly bivariate normal

    The fact that two random variables X and Y both have a normal distribution does not imply that the pair (XY) 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 Y = X if |X| > c and Y = −X if |X| < c, where c > 0. There are similar counterexamples for more than two random variables. In general, they sum to a mixture model.

    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 it is not true that two random variables that are (separately, marginally) normally distributed and uncorrelated are independent. Two random variables that are normally distributed may fail to be jointly normally distributed, i.e., the vector whose components they are may fail to have a multivariate normal distribution.

    Conditional distributions

    If N-dimensional x is partitioned as follows

    x = [ x 1 x 2 ]  with sizes  [ q × 1 ( N q ) × 1 ]

    and accordingly μ and Σ are partitioned as follows

    μ = [ μ 1 μ 2 ]  with sizes  [ q × 1 ( N q ) × 1 ] Σ = [ Σ 11 Σ 12 Σ 21 Σ 22 ]  with sizes  [ q × q q × ( N q ) ( N q ) × q ( N q ) × ( N q ) ]

    then the distribution of x1 conditional on x2 = a is multivariate normal (x1 | x2 = a) ~ N(μ, Σ) where

    μ ¯ = μ 1 + Σ 12 Σ 22 1 ( a μ 2 )

    and covariance matrix

    Σ ¯ = Σ 11 Σ 12 Σ 22 1 Σ 21 .

    This matrix is the Schur complement of Σ22 in Σ. This means that to calculate the conditional covariance matrix, one inverts the overall covariance matrix, drops the rows and columns corresponding to the variables being conditioned upon, and then inverts back to get the conditional covariance matrix. Here Σ 22 1 is the generalized inverse of Σ 22 .

    Note that knowing that x2 = 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 Σ 12 Σ 22 1 ( a μ 2 ) ; compare this with the situation of not knowing the value of a, in which case x1 would have distribution N q ( μ 1 , Σ 11 ) .

    An interesting fact derived in order to prove this result, is that the random vectors x 2 and y 1 = x 1 Σ 12 Σ 22 1 x 2 are independent.

    The matrix Σ12Σ22−1 is known as the matrix of regression coefficients.

    Bivariate case

    In the bivariate case where x is partitioned into X1 and X2, the conditional distribution of X1 given X2 is

    X 1 X 2 = x 2     N ( μ 1 + σ 1 σ 2 ρ ( x 2 μ 2 ) , ( 1 ρ 2 ) σ 1 2 ) .

    where ρ is the correlation coefficient between X1 and X2.

    In the general case

    ( X 1 X 2 ) N ( ( μ 1 μ 2 ) , ( σ 1 2 ρ σ 1 σ 2 ρ σ 1 σ 2 σ 2 2 ) )

    The conditional expectation of X1 given X2 is:

    E ( X 1 X 2 = x 2 ) = μ 1 + ρ σ 1 σ 2 ( x 2 μ 2 )

    Proof: the result is obtained by taking the expectation of the conditional distribution X 1 X 2 above.

    In the case of unit variances

    ( X 1 X 2 ) N ( ( 0 0 ) , ( 1 ρ ρ 1 ) )

    The conditional expectation of X1 given X2 is

    E ( X 1 X 2 = x 2 ) = ρ x 2

    and the conditional variance is

    var ( X 1 X 2 = x 2 ) = 1 ρ 2 ;

    thus the conditional variance does not depend on x2.

    The conditional expectation of X1 given that X2 is smaller/bigger than z is (Maddala 1983, p. 367) :

    E ( X 1 X 2 < z ) = ρ ϕ ( z ) Φ ( z ) , E ( X 1 X 2 > z ) = ρ ϕ ( z ) ( 1 Φ ( z ) ) ,

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

    Proof: the last two results are obtained using the result E ( X 1 X 2 = x 2 ) = ρ x 2 , so that

    E ( X 1 X 2 < z ) = ρ E ( X 2 X 2 < z ) 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.

    Example

    Let x = [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 of x′ = [X1, X3] is multivariate normal with mean vector μ′ = [μ1, μ3] and covariance matrix Σ = [ Σ 11 Σ 13 Σ 31 Σ 33 ] .

    Affine transformation

    If y = c + Bx is an affine transformation of x   N ( μ , Σ ) , where c is an M × 1 vector of constants and B is a constant M × N matrix, then y has a multivariate normal distribution with expected value c + and variance BΣBT i.e., y N ( c + B μ , B Σ B T ) . In particular, any subset of the xi 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

    B = [ 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 ]

    which extracts the desired elements directly.

    Another corollary is that the distribution of 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 Z N ( b μ , b T Σ b ) . This result follows by using

    B = [ b 1 b 2 b n ] = b T .

    Observe how the positive-definiteness of Σ implies that the variance of the dot product must be positive.

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

    Geometric interpretation

    The equidensity contours of a non-singular multivariate normal distribution are ellipsoids (i.e. linear transformations of hyperspheres) centered at the mean. 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 Σ. The squared relative lengths of the principal axes are given by the corresponding eigenvalues.

    If Σ = UΛUT = 1/2(1/2)T is an eigendecomposition where the columns of U are unit eigenvectors and Λ is a diagonal matrix of the eigenvalues, then we have

    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 Λ1/2, rotated by U and translated by μ.

    Conversely, any choice of μ, full rank matrix U, and positive diagonal entries Λi yields a non-singular multivariate normal distribution. If any Λi is zero and U is square, the resulting covariance matrix UΛUT 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.

    "The radius around the true mean in a bivariate normal random variable, re-written in polar coordinates (radius and angle), follows a Hoyt distribution.

    Estimation of parameters

    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

    f ( x ) = 1 ( 2 π ) k | Σ | exp ( 1 2 ( x μ ) T Σ 1 ( x μ ) )

    and the ML estimator of the covariance matrix from a sample of n observations is

    Σ ^ = 1 n i = 1 n ( x i x ¯ ) ( x i x ¯ ) T

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

    E [ Σ ^ ] = n 1 n Σ .

    An unbiased sample covariance is

    Σ ^ = 1 n 1 i = 1 n ( x i x ¯ ) ( x i x ¯ ) T .

    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 W 1 . Suppose then that n observations have been made

    X = { x 1 , , x n } N ( μ , Σ )

    and that a conjugate prior has been assigned, where

    p ( μ , Σ ) = p ( μ Σ )   p ( Σ ) ,

    where

    p ( μ Σ ) N ( μ 0 , m 1 Σ ) ,

    and

    p ( Σ ) W 1 ( Ψ , n 0 ) .

    Then,

    p ( μ Σ , X ) N ( n x ¯ + m μ 0 n + m , 1 n + m Σ ) , p ( Σ X ) W 1 ( Ψ + n S + n m n + m ( x ¯ μ 0 ) ( x ¯ μ 0 ) , n + n 0 ) ,

    where

    x ¯ = n 1 i = 1 n x i , S = n 1 i = 1 n ( x i x ¯ ) ( x i x ¯ ) .

    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 and Smith and Jain's adaptation of the Friedman-Rafsky test.

    Mardia's test is based on multivariate extensions of skewness and kurtosis measures. For a sample {x1, ..., xn} of k-dimensional vectors we compute

    Σ ^ = 1 n j = 1 n ( x j x ¯ ) ( x j x ¯ ) T A = 1 6 n i = 1 n j = 1 n [ ( x i x ¯ ) T Σ ^ 1 ( x j x ¯ ) ] 3 B = n 8 k ( k + 2 ) { 1 n i = 1 n [ ( x i x ¯ ) T Σ ^ 1 ( x i x ¯ ) ] 2 k ( k + 2 ) }

    Under the null hypothesis of multivariate normality, the statistic A will have approximately a chi-squared distribution with 1/6k(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 ( 50 n < 400 ) , the parameters of the asymptotic distribution of the kurtosis statistic are modified For small sample tests ( n < 50 ) empirical critical values are used. Tables of critical values for both statistics are given by Rencher for k=2,3,4.

    Mardia's tests are affine invariant but not consistent. For example, the multivariate skewness test is not consistent against symmetric non-normal alternatives.

    The BHEP test 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 L2(μ) space of square-integrable functions with respect to the Gaussian weighting function μ β ( t ) = ( 2 π β 2 ) k / 2 e | t | 2 / ( 2 β 2 ) . The test statistic is

    T β = R k | 1 n j = 1 n e i t T Σ ^ 1 / 2 ( x j x ) ¯ e | t | 2 / 2 | 2 μ β ( t ) d t = 1 n 2 i , j = 1 n e β 2 2 ( x i x j ) T Σ ^ 1 ( x i x j ) 2 n ( 1 + β 2 ) k / 2 i = 1 n e β 2 2 ( 1 + β 2 ) ( x i x ¯ ) T Σ ^ 1 ( x i x ¯ ) + 1 ( 1 + 2 β 2 ) k / 2

    The limiting distribution of this test statistic is a weighted sum of chi-squared random variables, however in practice it is more convenient to compute the sample quantiles using the Monte-Carlo simulations.

    A detailed survey of these and other test procedures is available.

    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:

    1. Find any real matrix A such that AAT = Σ. When Σ is positive-definite, the Cholesky decomposition is typically used, and the extended form of this decomposition can always be used (as the covariance matrix may be only positive semi-definite) in both cases a suitable matrix A is obtained. An alternative is to use the matrix A = ½ obtained from a spectral decomposition Σ = UΛUT of Σ. The former approach is more computationally straightforward but the matrices A change for different orderings of the elements of the random vector, while the latter approach gives matrices that are related by simple re-orderings. In theory both approaches give equally good ways of determining a suitable matrix A, but there are differences in computation time.
    2. Let z = (z1, …, zN)T be a vector whose components are N independent standard normal variates (which can be generated, for example, by using the Box–Muller transform).
    3. Let x be μ + Az. This has the desired distribution due to the affine transformation property.

    References

    Multivariate normal distribution Wikipedia