Trisha Shetty (Editor)

Wishart distribution

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Notation
  
X ~ Wp(V, n)

Parameters
  
n > p − 1 degrees of freedom (real) V > 0 scale matrix (p × p pos. def)

Support
  
X(p × p) positive definite matrix

PDF
  
| X | ( n − p − 1 ) / 2 e − tr ⁡ ( V − 1 X ) / 2 2 n p 2 | V | n / 2 Γ p ( n 2 ) {displaystyle { rac {|mathbf {X} |^{(n-p-1)/2}e^{-operatorname {tr} (mathbf {V} ^{-1}mathbf {X} )/2}}{2^{ rac {np}{2}}|{mathbf {V} }|^{n/2}Gamma _{p}({ rac {n}{2}})}}} Γp is the multivariate gamma function tr is the trace function

Mean
  
E ⁡ [ X ] = n V {displaystyle operatorname {E} [X]=nV}

Mode
  
(n − p − 1)V for n ≥ p + 1

In statistics, the Wishart distribution is a generalization to multiple dimensions of the chi-squared distribution, or, in the case of non-integer degrees of freedom, of the gamma distribution. It is named in honor of John Wishart, who first formulated the distribution in 1928.

Contents

It is a family of probability distributions defined over symmetric, nonnegative-definite matrix-valued random variables (“random matrices”). These distributions are of great importance in the estimation of covariance matrices in multivariate statistics. In Bayesian statistics, the Wishart distribution is the conjugate prior of the inverse covariance-matrix of a multivariate-normal random-vector.

Definition

Suppose X is an n × p matrix, each row of which is independently drawn from a p-variate normal distribution with zero mean:

X ( i ) = ( x i 1 , , x i p ) N p ( 0 , V ) .

Then the Wishart distribution is the probability distribution of the p × p random matrix S = XT X known as the scatter matrix. One indicates that S has that probability distribution by writing

S W p ( V , n ) .

The positive integer n is the number of degrees of freedom. Sometimes this is written W(V, p, n). For np the matrix S is invertible with probability 1 if V is invertible.

If p = V = 1 then this distribution is a chi-squared distribution with n degrees of freedom.

Occurrence

The Wishart distribution arises as the distribution of the sample covariance matrix for a sample from a multivariate normal distribution. It occurs frequently in likelihood-ratio tests in multivariate statistical analysis. It also arises in the spectral theory of random matrices and in multidimensional Bayesian analysis. It is also encountered in wireless communications, while analyzing the performance of Rayleigh fading MIMO wireless channels .

Probability density function

The Wishart distribution can be characterized by its probability density function as follows:

Let X be a p × p symmetric matrix of random variables that is positive definite. Let V be a (fixed) positive definite matrix of size p × p.

Then, if np, X has a Wishart distribution with n degrees of freedom if it has a probability density function given by

1 2 n p / 2 | V | n / 2 Γ p | n 2 | | X | ( n p 1 ) / 2 e ( 1 / 2 ) tr ( V 1 X )

where | X | denotes determinant and Γp(·) is the multivariate gamma function defined as

Γ p ( n 2 ) = π p ( p 1 ) / 4 j = 1 p Γ ( n 2 + 1 j 2 ) .

In fact the above definition can be extended to any real n > p − 1. If np − 1, then the Wishart no longer has a density—instead it represents a singular distribution that takes values in a lower-dimension subspace of the space of p × p matrices.

Use in Bayesian statistics

In Bayesian statistics, in the context of the multivariate normal distribution, the Wishart distribution is the conjugate prior to the precision matrix Ω = Σ−1, where Σ is the covariance matrix.

Choice of parameters

The least informative, proper Wishart prior is obtained by setting n = p.

The prior mean of Wp(V, n) is nV, suggesting that a reasonable choice for V−1 would be nΣ0, where Σ0 is some prior guess for the covariance matrix.

Log-expectation

Note the following formula:

E [ ln | X | ] = ψ p ( n 2 ) + p ln ( 2 ) + ln | V |

where ψ p is the multivariate digamma function (the derivative of the log of the multivariate gamma function).

This plays a role in variational Bayes derivations for Bayes networks involving the Wishart distribution.

Log-variance

The following variance computation could be of help in Bayesian statistics:

Var [ ln | X | ] = i = 1 p ψ 1 ( n + 1 i 2 )

where ψ 1 is the trigamma function. This comes up when computing the Fisher information of the Wishart random variable.

Entropy

The information entropy of the distribution has the following formula:

H [ X ] = ln ( B ( V , n ) ) n p 1 2 E [ ln | X | ] + n p 2

where B(V, n) is the normalizing constant of the distribution:

B ( V , n ) = 1 | V | n / 2 2 n p / 2 Γ p ( n 2 ) .

This can be expanded as follows:

H [ X ] = n 2 ln | V | + n p 2 ln 2 + ln Γ p ( n 2 ) n p 1 2 E [ ln | X | ] + n p 2 = n 2 ln | V | + n p 2 ln 2 + ln Γ p ( n 2 ) n p 1 2 ( ψ p ( n 2 ) + p ln 2 + ln | V | ) + n p 2 = n 2 ln | V | + n p 2 ln 2 + ln Γ p ( n 2 ) n p 1 2 ψ p ( n 2 ) n p 1 2 ( p ln 2 + ln | V | ) + n p 2 = p + 1 2 ln | V | + 1 2 p ( p + 1 ) ln 2 + ln Γ p ( n 2 ) n p 1 2 ψ p ( n 2 ) + n p 2

Cross-entropy

The cross entropy of two Wishart distributions p 0 with parameters n 0 , V 0 and p 1 with parameters n 1 , V 1 is

H ( p 0 , p 1 ) = E p 0 [ log p 1 ] = E p 0 [ log | X | ( n 1 p 1 ) / 2 e tr ( V 1 1 X ) / 2 2 n 1 p / 2 | V 1 | n 1 / 2 Γ p ( n 1 2 ) ] = n 1 p 2 log 2 + n 1 2 log | V 1 | + log Γ p ( n 1 2 ) n 1 p 1 2 E p 0 [ log | X | ] + 1 2 E p 0 [ tr ( V 1 1 X ) ] = n 1 p 2 log 2 + n 1 2 log | V 1 | + log Γ p ( n 1 2 ) n 1 p 1 2 ( ψ p ( n 0 2 ) + p log 2 + log | V 0 | ) + 1 2 tr ( V 1 1 n 0 V 0 ) = n 1 2 log | V 1 1 V 0 | + p + 1 2 log | V 0 | + n 0 2 tr ( V 1 1 V 0 ) + log Γ p ( n 1 2 ) n 1 p 1 2 ψ p ( n 0 2 ) + p ( p + 1 ) 2 log 2

Note that when p 0 = p 1 we recover the entropy.

KL-divergence

The Kullback–Leibler divergence of p 1 from p 0 is

D K L ( p 0 p 1 ) = H ( p 0 , p 1 ) H ( p 0 ) = n 1 2 log | V 1 1 V 0 | + n 0 2 ( tr ( V 1 1 V 0 ) p ) + log Γ p ( n 1 2 ) Γ p ( n 0 2 ) + n 0 n 1 2 ψ p ( n 0 2 )

Characteristic function

The characteristic function of the Wishart distribution is

Θ | I 2 i Θ V | n / 2 .

In other words,

Θ E [ exp ( i tr ( X Θ ) ) ] = | I 2 i Θ V | n / 2

where E[⋅] denotes expectation. (Here Θ and I are matrices the same size as V(I is the identity matrix); and i is the square root of −1).

Theorem

If a p × p random matrix X has a Wishart distribution with m degrees of freedom and variance matrix V — write X W p ( V , m ) — and C is a q × p matrix of rank q, then

C X C T W q ( C V C T , m ) .

Corollary 1

If z is a nonzero p × 1 constant vector, then:

z T X z σ z 2 χ m 2 .

In this case, χ m 2 is the chi-squared distribution and σ z 2 = z T V z (note that σ z 2 is a constant; it is positive because V is positive definite).

Corollary 2

Consider the case where zT = (0, ..., 0, 1, 0, ..., 0) (that is, the j-th element is one and all others zero). Then corollary 1 above shows that

w j j σ j j χ m 2

gives the marginal distribution of each of the elements on the matrix's diagonal.

George Seber points out that the Wishart distribution is not called the “multivariate chi-squared distribution” because the marginal distribution of the off-diagonal elements is not chi-squared. Seber prefers to reserve the term multivariate for the case when all univariate marginals belong to the same family.

Estimator of the multivariate normal distribution

The Wishart distribution is the sampling distribution of the maximum-likelihood estimator (MLE) of the covariance matrix of a multivariate normal distribution. A derivation of the MLE uses the spectral theorem.

Bartlett decomposition

The Bartlett decomposition of a matrix X from a p-variate Wishart distribution with scale matrix V and n degrees of freedom is the factorization:

X = L A A T L T ,

where L is the Cholesky factor of V, and:

A = ( c 1 0 0 0 n 21 c 2 0 0 n 31 n 32 c 3 0 n p 1 n p 2 n p 3 c p )

where c i 2 χ n i + 1 2 and nij ~ N(0, 1) independently. This provides a useful method for obtaining random samples from a Wishart distribution.

Marginal distribution of matrix elements

Let V be a 2 × 2 variance matrix characterized by correlation coefficient −1 < ρ < 1 and L its lower Cholesky factor:

V = ( σ 1 2 ρ σ 1 σ 2 ρ σ 1 σ 2 σ 2 2 ) , L = ( σ 1 0 ρ σ 2 1 ρ 2 σ 2 )

Multiplying through the Bartlett decomposition above, we find that a random sample from the 2 × 2 Wishart distribution is

X = ( σ 1 2 c 1 2 σ 1 σ 2 ( ρ c 1 2 + 1 ρ 2 c 1 n 21 ) σ 1 σ 2 ( ρ c 1 2 + 1 ρ 2 c 1 n 21 ) σ 2 2 ( ( 1 ρ 2 ) c 2 2 + ( 1 ρ 2 n 21 + ρ c 1 ) 2 ) )

The diagonal elements, most evidently in the first element, follow the χ2 distribution with n degrees of freedom (scaled by σ2) as expected. The off-diagonal element is less familiar but can be identified as a normal variance-mean mixture where the mixing density is a χ2 distribution. The corresponding marginal probability density for the off-diagonal element is therefore the variance-gamma distribution

f ( x 12 ) = | x 12 | n 1 2 Γ ( n 2 ) 2 n 1 π ( 1 ρ 2 ) ( σ 1 σ 2 ) n + 1 K n 1 2 ( | x 12 | σ 1 σ 2 ( 1 ρ 2 ) ) exp ( ρ x 12 σ 1 σ 2 ( 1 ρ 2 ) )

where Kν(z) is the modified Bessel function of the second kind. Similar results may be found for higher dimensions, but the interdependence of the off-diagonal correlations becomes increasingly complicated. It is also possible to write down the moment-generating function even in the noncentral case (essentially the nth power of Craig (1936) equation 10) although the probability density becomes an infinite sum of Bessel functions.

The range of the shape parameter

It can be shown that the Wishart distribution can be defined if and only if the shape parameter n belongs to the set

Λ p := { 0 , , p 1 } ( p 1 , ) .

This set is named after Gindikin, who introduced it in the seventies in the context of gamma distributions on homogeneous cones. However, for the new parameters in the discrete spectrum of the Gindikin ensemble, namely,

Λ p := { 0 , , p 1 } ,

the corresponding Wishart distribution has no Lebesgue density.

Relationships to other distributions

  • The Wishart distribution is related to the inverse-Wishart distribution, denoted by W p 1 , as follows: If X ~ Wp(V, n) and if we do the change of variables C = X−1, then C W p 1 ( V 1 , n ) . This relationship may be derived by noting that the absolute value of the Jacobian determinant of this change of variables is |C|p+1, see for example equation (15.15) in.
  • In Bayesian statistics, the Wishart distribution is a conjugate prior for the precision parameter of the multivariate normal distribution, when the mean parameter is known.
  • A generalization is the multivariate gamma distribution.
  • A different type of generalization is the normal-Wishart distribution, essentially the product of a multivariate normal distribution with a Wishart distribution.
  • References

    Wishart distribution Wikipedia