Wishart distribution explained

In statistics, the Wishart distribution is a generalization of the gamma distribution to multiple dimensions. It is named in honor of John Wishart, who first formulated the distribution in 1928.[1] Other names include Wishart ensemble (in random matrix theory, probability distributions over matrices are usually called "ensembles"), or Wishart–Laguerre ensemble (since its eigenvalue distribution involve Laguerre polynomials), or LOE, LUE, LSE (in analogy with GOE, GUE, GSE).

It is a family of probability distributions defined over symmetric, positive-definite random matrices (i.e. matrix-valued random variables). 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.[2]

Definition

Suppose is a matrix, each column of which is independently drawn from a -variate normal distribution with zero mean:

G=

n)
(g
i

\siml{N}p(0,V).

Then the Wishart distribution is the probability distribution of the random matrix [3]

S=GGT=

n
\sum
i=1

gi

T
g
i

known as the scatter matrix. One indicates that has that probability distribution by writing

S\simWp(V,n).

The positive integer is the number of degrees of freedom. Sometimes this is written . For the matrix is invertible with probability if is invertible.

If then this distribution is a chi-squared distribution with 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.[4] It is also encountered in wireless communications, while analyzing the performance of Rayleigh fading MIMO wireless channels .[5]

Probability density function

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

Let be a symmetric matrix of random variables that is positive semi-definite. Let be a (fixed) symmetric positive definite matrix of size .

Then, if, has a Wishart distribution with degrees of freedom if it has the probability density function

fX(X)=

1
2np/2\left|{V

\right|n/2

\Gamma
p\left(n
2

\right)}{\left|X\right|}(n-p-1)/2

-1\operatorname{tr
2
e

({V}-1X)}

where

\left|{X}\right|

is the determinant of

X

and is the multivariate gamma function defined as

\Gammap\left(

n
2

\right)=\pip(p-1)/4

p
\prod
j=1

\Gamma\left(

n
2

-

j-1
2

\right).

The density above is not the joint density of all the

p2

elements of the random matrix (such density does not exist because of the symmetry constrains

Xij=Xji

), it is rather the joint density of

p(p+1)/2

elements

Xij

for

i\lej

(page 38). Also, the density formula above applies only to positive definite matrices

x;

for other matrices the density is equal to zero.

Spectral density

The joint-eigenvalue density for the eigenvalues

λ1,...,λp\ge0

of a random matrix

X\simWp(I,n)

is,[6]

cn,p

-1\sumiλi
2
e

\prod

(n-p-1)/2
λ
i

\prodi<j|λij|

where

cn,p

is a constant.

In fact the above definition can be extended to any real . If, 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 matrices.[7]

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, where is the covariance matrix.[8]

Choice of parameters

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

The prior mean of is, suggesting that a reasonable choice for would be, where is some prior guess for the covariance matrix.

Properties

Log-expectation

The following formula plays a role in variational Bayes derivations for Bayes networksinvolving the Wishart distribution. From equation (2.63),[9]

\operatorname{E}[ln\left|X\right|]=

\psi
p\left(n
2\right)

+pln(2)+ln|V|

where

\psip

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

Log-variance

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

\operatorname{Var}\left[ln\left|X\right|

p
\right]=\sum
i=1
\psi
1\left(n+1-i
2\right)

where

\psi1

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:

\operatorname{H}\left[X\right]=-ln\left(B(V,n)\right)-

n-p-1
2

\operatorname{E}\left[ln\left|X\right|\right]+

np
2

where is the normalizing constant of the distribution:

B(V,n)=

1
n/2
\left|V\right|2np/2
\Gamma
p\left(n
2
\right)

.

This can be expanded as follows:

\begin{align} \operatorname{H}\left[X\right]&=

n
2

ln\left|V\right|+

np
2

ln2+ln\Gammap\left(

n
2

\right)-

n-p-1
2

\operatorname{E}\left[ln\left|X\right|\right]+

np
2

\\[8pt] &=

n
2

ln\left|V\right|+

np
2

ln2+

ln\Gamma
p\left(n
2

\right)-

n-p-1
2

\left(\psip\left(

n
2

\right)+pln2+ln\left|V\right|\right)+

np
2

\\[8pt] &=

n
2

ln\left|V\right|+

np
2

ln2+

ln\Gamma
p\left(n
2\right)

-

n-p-1
2
\psi
p\left(n
2

\right)-

n-p-1
2

\left(pln2+ln\left|V\right|\right)+

np
2

\\[8pt] &=

p+1
2

ln\left|V\right|+

1
2

p(p+1)ln2+

ln\Gamma
p\left(n
2\right)

-

n-p-1
2
\psi
p\left(n
2

\right)+

np
2

\end{align}

Cross-entropy

The cross-entropy of two Wishart distributions

p0

with parameters

n0,V0

and

p1

with parameters

n1,V1

is

\begin{align} H(p0,p1)&=

\operatorname{E}
p0

[-logp1]\\[8pt] &=

\operatorname{E}
p0

\left[-log

(n1-p1-1)/2
\left|X\right|e-\operatorname{tr
-1
(V
1
X)/2
} \right]\\[8pt]&= \tfrac 2 \log 2 + \tfrac 2 \log \left|\mathbf_1\right| + \log \Gamma_(\tfrac 2) - \tfrac 2 \operatorname_\left[\, \log\left|\mathbf{X}\right|\, \right] + \tfrac\operatorname_\left[\, \operatorname{tr}\left(\,\mathbf{V}_1^{-1}\mathbf{X}\,\right) \, \right] \\[8pt]&= \tfrac \log 2 + \tfrac 2 \log \left|\mathbf_1\right| + \log \Gamma_(\tfrac) - \tfrac \left(\psi_(\tfrac 2) + p_0 \log 2 + \log \left|\mathbf_0\right|\right)+ \tfrac \operatorname\left(\, \mathbf_1^ n_0 \mathbf_0\, \right) \\[8pt]&=-\tfrac \log \left|\, \mathbf_1^ \mathbf_0\, \right| + \tfrac 2 \log \left|\mathbf_0\right| + \tfrac 2 \operatorname\left(\, \mathbf_1^ \mathbf_0\right)+ \log \Gamma_\left(\tfrac\right) - \tfrac \psi_(\tfrac) + \tfrac \log 2\end

Note that when

p0=p1

and

n0=n1

we recover the entropy.

KL-divergence

The Kullback–Leibler divergence of

p1

from

p0

is

\begin{align} DKL(p0\|p1)&=H(p0,p1)-H(p0)\\[6pt] &=-

n1
2

log

-1
|V
1

V0|+

n0
2
-1
(\operatorname{tr}(V
1

V0)-p)+log

\Gamma\right)
p\left(n1
2
\Gamma\right)
p\left(n0
2

+\tfrac{n0-n1}2

\psi
p\left(n0
2\right) \end{align}

Characteristic function

The characteristic function of the Wishart distribution is

\Theta\mapsto\operatorname{E}\left[\exp\left(i\operatorname{tr}\left(X{\Theta}\right)\right)\right]=\left|1-2i{\Theta}{V}\right|-n/2

where denotes expectation. (Here is any matrix with the same dimensions as, indicates the identity matrix, and is a square root of ).[10] Properly interpreting this formula requires a little care, because noninteger complex powers are multivalued; when is noninteger, the correct branch must be determined via analytic continuation.[11]

Theorem

If a random matrix has a Wishart distribution with degrees of freedom and variance matrix — write

X\siml{W}p({V},m)

— and is a matrix of rank, then [12]

CX{C}T\sim

T,m\right).
l{W}
q\left({C}{V}{C}

Corollary 1

If is a nonzero constant vector, then:[12]

-2
\sigma
z

{z}TX{z}\sim

2.
\chi
m

In this case,

2
\chi
m
is the chi-squared distribution and
2={z}
\sigma
z

T{V}{z}

(note that
2
\sigma
z
is a constant; it is positive because is positive definite).

Corollary 2

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

-1
\sigma
jj

wjj\sim

2
\chi
m

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.[13]

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.[14] A derivation of the MLE uses the spectral theorem.

Bartlett decomposition

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

X={bfL}{bfA}{bfA}T{bfL}T,

where is the Cholesky factor of, and:

A=\begin{pmatrix} c1&0&0&&0\\ n21&c2&0&&0\\ n31&n32&c3&&0\\ \vdots&\vdots&\vdots&\ddots&\vdots\\ np1&np2&np3&&cp \end{pmatrix}

where

2
c
i

\sim

2
\chi
n-i+1
and independently.[15] This provides a useful method for obtaining random samples from a Wishart distribution.[16]

Marginal distribution of matrix elements

Let be a variance matrix characterized by correlation coefficient and its lower Cholesky factor:

V=

2
\begin{pmatrix} \sigma
1

&\rho\sigma1\sigma2\\ \rho\sigma1\sigma2&

2 \end{pmatrix},    L
\sigma
2

=\begin{pmatrix} \sigma1&0\\ \rho\sigma2&\sqrt{1-\rho2}\sigma2 \end{pmatrix}

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

X=

2
\begin{pmatrix} \sigma
1
2
c
1

&\sigma1\sigma2\left(\rho

2
c
1

+\sqrt{1-\rho2}c1n21\right)\\ \sigma1\sigma2\left(\rho

2
c
1

+\sqrt{1-\rho2}c1n21\right)&

2
\sigma
2

\left(\left(1-\rho2\right)

2
c
2

+\left(\sqrt{1-\rho2}n21+\rhoc1\right)2\right) \end{pmatrix}

The diagonal elements, most evidently in the first element, follow the distribution with degrees of freedom (scaled by) 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 distribution. The corresponding marginal probability density for the off-diagonal element is therefore the variance-gamma distribution

f(x12)=

\left|x12\right
n-1
2
|
\Gamma\left(n\right)\sqrt{2n-1\pi\left(1-\rho2\right)\left(\sigma1\sigma2\right)n+1
2
} \cdot K_ \left(\frac\right) \exp

where is the modified Bessel function of the second kind.[17] Similar results may be found for higher dimensions. In general, if

X

follows a Wishart distribution with parameters,

\Sigma,n

, then for

ij

, the off-diagonal elements

Xij\simVG(n,\Sigmaij,(\Sigmaii\Sigmajj-

2)
\Sigma
ij

1/2,0)

. [18]

It is also possible to write down the moment-generating function even in the noncentral case (essentially the nth power of Craig (1936)[19] equation 10) although the probability density becomes an infinite sum of Bessel functions.

The range of the shape parameter

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

Λp:=\{0,\ldots,p-1\}\cup\left(p-1,infty\right).

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

*:=\{0,
Λ
p

\ldots,p-1\},

the corresponding Wishart distribution has no Lebesgue density.

Relationships to other distributions

-1
W
p
, as follows: If and if we do the change of variables, then

C\sim

-1
W
p

(V-1,n)

. This relationship may be derived by noting that the absolute value of the Jacobian determinant of this change of variables is, see for example equation (15.15) in.[22]

See also

External links

Notes and References

  1. J. . Wishart . John Wishart (statistician) . The generalised product moment distribution in samples from a normal multivariate population . . 20A . 1–2 . 32–52 . 1928 . 10.1093/biomet/20A.1-2.32 . 54.0565.02 . 2331939.
  2. Gary . Koop . Dimitris . Korobilis . 2010 . Bayesian Multivariate Time Series Methods for Empirical Macroeconomics . Foundations and Trends in Econometrics . 3 . 4 . 267–358 . 10.1561/0800000013 . free .
  3. Book: A. K. . Gupta . D. K. . Nagar . 2000 . Matrix Variate Distributions . Chapman & Hall /CRC . 1584880465.
  4. Book: Gelman, Andrew . 2003 . Bayesian Data Analysis . Chapman & Hall . 582 . 158488388X . 3 June 2015 . Boca Raton, Fla. . 2nd.
  5. Zanella. A.. Chiani, M. . Win, M.Z. . On the marginal distribution of the eigenvalues of wishart matrices. IEEE Transactions on Communications. April 2009. 57. 4. 1050–1060 . 10.1109/TCOMM.2009.04.070143. 1721.1/66900. 12437386. free.
  6. Book: Muirhead, Robb J. . 2005 . Aspects of Multivariate Statistical Theory . Wiley Interscience . 0471769851 . 2nd.
  7. 10.1214/aos/1176325375. On Singular Wishart and Singular Multivariate Beta Distributions. The Annals of Statistics. 22. 395–405. 1994. Uhlig . H. . free.
  8. Book: Hoff, Peter D. . A First Course in Bayesian Statistical Methods . New York . Springer . 2009 . 978-0-387-92299-7 . 109–111 .
  9. Web site: Nguyen. Duy. AN IN DEPTH INTRODUCTION TO VARIATIONAL BAYES NOTE. 4541076 . 15 August 2023.
  10. Book: Anderson, T. W. . T. W. Anderson . An Introduction to Multivariate Statistical Analysis . . 3rd . Hoboken, N. J. . 2003 . 259 . 0-471-36091-0 .
  11. Mayerhofer . Eberhard . 2019-01-27 . Reforming the Wishart characteristic function . math.PR . 1901.09347 .
  12. Book: Rao, C. R. . Linear Statistical Inference and its Applications . Wiley . 1965 . 535 .
  13. Book: Seber, George A. F. . Multivariate Observations . . 2004 . 978-0471691211 .
  14. Book: C. . Chatfield . A. J. . Collins . 1980 . Introduction to Multivariate Analysis . London . Chapman and Hall . 103–108 . 0-412-16030-7 .
  15. Book: Anderson, T. W. . T. W. Anderson . An Introduction to Multivariate Statistical Analysis . . 3rd . Hoboken, N. J. . 2003 . 257 . 0-471-36091-0 .
  16. Algorithm AS 53: Wishart Variate Generator . W. B. . Smith . R. R. . Hocking . . 21 . 3 . 1972 . 341 - 345 . 2346290.
  17. Pearson . Karl . Karl Pearson . Jeffery . G. B. . George Barker Jeffery . Elderton . Ethel M. . Ethel M. Elderton . On the Distribution of the First Product Moment-Coefficient, in Samples Drawn from an Indefinitely Large Normal Population . Biometrika . 21 . 164–201 . Biometrika Trust . December 1929 . 1/4 . 2332556 . 10.2307/2332556.
  18. Fischer . Adrian . Gaunt . Robert E. . Andrey . Sarantsev . The Variance-Gamma Distribution: A Review . 2023 . math.ST . 2303.05615 .
  19. Craig . Cecil C. . On the Frequency Function of xy . Ann. Math. Statist. . 7 . 1–15 . 1936 . 10.1214/aoms/1177732541. free .
  20. 10.1214/aop/1176990455 . Peddada and Richards . Shyamal Das . Richards . Donald St. P. . Proof of a Conjecture of M. L. Eaton on the Characteristic Function of the Wishart Distribution . . 19 . 2 . 868 - 874 . 1991 . free .
  21. 10.1007/BF01078179 . S.G. . Gindikin . Invariant generalized functions in homogeneous domains . . 9 . 1 . 50 - 52 . 1975. 123288172 .
  22. Paul S. . Dwyer . Some Applications of Matrix Derivatives in Multivariate Analysis . . 1967 . 62 . 318 . 607–625 . 10.1080/01621459.1967.10482934 . 2283988 .
  23. Book: Bishop, C. M. . Pattern Recognition and Machine Learning . Springer . 2006 .