Inverse-Wishart distribution explained

In statistics, the inverse Wishart distribution, also called the inverted Wishart distribution, is a probability distribution defined on real-valued positive-definite matrices. In Bayesian statistics it is used as the conjugate prior for the covariance matrix of a multivariate normal distribution.

We say

X

follows an inverse Wishart distribution, denoted as

X\siml{W}-1(\Psi,\nu)

, if its inverse

X-1

has a Wishart distribution

l{W}(\Psi-1,\nu)

. Important identities have been derived for the inverse-Wishart distribution.[1]

Density

The probability density function of the inverse Wishart is:[2]

fX({X};{\Psi},\nu)=

\left|{\Psi
\right|

\nu/2

} \left|\mathbf\right|^ e^

where

X

and

{\Psi}

are

p x p

positive definite matrices,

||

is the determinant, and Γp(·) is the multivariate gamma function.

Theorems

Distribution of the inverse of a Wishart-distributed matrix

If

{X}\siml{W}({\Sigma},\nu)

and

{\Sigma}

is of size

p x p

, then

A={X}-1

has an inverse Wishart distribution

A\siml{W}-1({\Sigma}-1,\nu)

.[3]

Marginal and conditional distributions from an inverse Wishart-distributed matrix

Suppose

{A}\siml{W}-1({\Psi},\nu)

has an inverse Wishart distribution. Partition the matrices

{A}

and

{\Psi}

conformably with each other

{A

} = \begin \mathbf_ & \mathbf_ \\ \mathbf_ & \mathbf_ \end, \; = \begin \mathbf_ & \mathbf_ \\ \mathbf_ & \mathbf_ \end where

{Aij

} and

{\Psiij

} are

pi x pj

matrices, then we have

A11

is independent of
-1
A
11

A12

and

{A}22 ⋅

, where

{A22 ⋅

} = _ - __^_ is the Schur complement of

{A11}

in

{A}

;

{A11}\siml{W}-1({\Psi11},\nu-p2)

;
-1
{A}
11

{A}12\mid{A}22 ⋅ \sim

MN
p1 x p2

(

-1
{\Psi}
11

{\Psi}12,{A}22 ⋅

-1
{\Psi}
11

)

, where

MNp x (,)

is a matrix normal distribution;

{A}22 ⋅ \siml{W}-1({\Psi}22 ⋅ ,\nu)

, where

{\Psi22 ⋅

} = _ - __^_;

Conjugate distribution

Suppose we wish to make inference about a covariance matrix

{\Sigma

} whose prior

{p(\Sigma)}

has a

l{W}-1({\Psi},\nu)

distribution. If the observations

X=[x1,\ldots,xn]

are independent p-variate Gaussian variables drawn from a

N(0,{\Sigma})

distribution, then the conditional distribution

{p(\Sigma\midX)}

has a

l{W}-1({A}+{\Psi},n+\nu)

distribution, where

{A

}=\mathbf\mathbf^T.

Because the prior and posterior distributions are the same family, we say the inverse Wishart distribution is conjugate to the multivariate Gaussian.

Due to its conjugacy to the multivariate Gaussian, it is possible to marginalize out (integrate out) the Gaussian's parameter

\Sigma

, using the formula

p(x)=

p(x|\Sigma)p(\Sigma)
p(\Sigma|x)

and the linear algebra identity

vT\Omegav=tr(\OmegavvT)

:

fX\mid\Psi,\nu(x)=\intfX\mid\Sigma=\sigma(x)f\Sigma\mid\Psi,\nu(\sigma)d\sigma=

\nu/2
|\Psi|
\Gamma
p\left(\nu+n
2
\right)
np/2
\pi|\Psi+A|(\nu+n)/2
\Gamma
p(\nu
2
)

(this is useful because the variance matrix

\Sigma

is not known in practice, but because

{\Psi}

is known a priori, and

{A}

can be obtained from the data, the right hand side can be evaluated directly). The inverse-Wishart distribution as a prior can be constructed via existing transferred prior knowledge.[4]

Moments

The following is based on Press, S. J. (1982) "Applied Multivariate Analysis", 2nd ed. (Dover Publications, New York), after reparameterizing the degree of freedom to be consistent with the p.d.f. definition above.

Let

W\siml{W}(\Psi-1,\nu)

with

\nu\gep

and

X

eq

W-1

, so that

X\siml{W}-1(\Psi,\nu)

.

The mean:[3]

\operatornameE(X)=

\Psi
\nu-p-1

.

The variance of each element of

X

:

\operatorname{Var}(xij)=

2
(\nu-p+1)\psi+(\nu-p-1)\psiii\psijj
ij
(\nu-p)(\nu-p-1)2(\nu-p-3)

The variance of the diagonal uses the same formula as above with

i=j

, which simplifies to:

\operatorname{Var}(xii)=

2
2\psi
ii
(\nu-p-1)2(\nu-p-3)

.

The covariance of elements of

X

are given by:

\operatorname{Cov}(xij,xk\ell)=

2\psiij\psik\ell+(\nu-p-1)(\psiik\psij\ell+\psii\ell\psikj)
(\nu-p)(\nu-p-1)2(\nu-p-3)

The same results are expressed in Kronecker product form by von Rosen[5] as follows:

\begin{align} E\left(W-1W-1\right)&=c1\Psi\Psi+c2Vec(\Psi)Vec(\Psi)T+c2Kpp\Psi\Psi\\ Cov\left(W-1,W-1\right)&=(c1-c3)\Psi\Psi+c2Vec(\Psi)Vec(\Psi)T+c2Kpp\Psi\Psi \end{align}

where

\begin{align} c2&=\left[(\nu-p)(\nu-p-1)(\nu-p-3)\right]-1\\ c1&=(\nu-p-2)c2\\ c3&=(\nu-p-1)-2, \end{align}

Kppisap2 x p2

commutation matrix

Cov\left(W-1,W-1\right)=E\left(W-1W-1\right)-E\left(W-1\right)E\left(W-1\right).

There appears to be a typo in the paper whereby the coefficient of

Kpp\Psi\Psi

is given as

c1

rather than

c2

, and that the expression for the mean square inverse Wishart, corollary 3.1, should read

E\left[W-1W-1\right]=(c1+c2)\Sigma-1\Sigma-1+c2\Sigma-1tr(\Sigma-1).

To show how the interacting terms become sparse when the covariance is diagonal, let

\Psi=I3

and introduce some arbitrary parameters

u,v,w

:

E\left(W-1W-1\right)=u\Psi\Psi+vvec(\Psi)vec(\Psi)T+wKpp\Psi\Psi.

where

vec

denotes the matrix vectorization operator. Then the second moment matrix becomes

E\left(W-1W-1\right)=\begin{bmatrix} u+v+w&&&&v&&&&v\\ &u&&w&&&&&\\ &&u&&&&w&&\\ &w&&u&&&&&\\ v&&&&u+v+w&&&&v\\ &&&&&u&&w&\\ &&w&&&&u&&\\ &&&&&w&&u&\\ v&&&&v&&&&u+v+w\\ \end{bmatrix}

which is non-zero only when involving the correlations of diagonal elements of

W-1

, all other elements are mutually uncorrelated, though not necessarily statistically independent. The variances of the Wishart product are also obtained by Cook et al.[6] in the singular case and, by extension, to the full rank case.

Muirhead[7] shows in Theorem 3.2.8 that if

Ap

is distributed as

l{W}p(\nu,\Sigma)

and

V

is an arbitrary vector, independent of

A

then

VTAV\siml{W}1(\nu,AT\SigmaA)

and
VTAV
VT\SigmaV

\sim

2
\chi
\nu-1

, one degree of freedom being relinquished by estimation of the sample mean in the latter. Similarly, Bodnar et.al. further find that
VTA-1V
VT\Sigma-1V

\sim

2
Inv-\chi
\nu-p+1

and setting

V=(1,0,,0)T

the marginal distribution of the leading diagonal element is thus
[A-1]1,1
[\Sigma-1]1,1

\sim

2-k/2
\Gamma(k/2)

x-k/2-1e-1/(2,  k=\nu-p+1

and by rotating

V

end-around a similar result applies to all diagonal elements

[A-1]i,i

.

A corresponding result in the complex Wishart case was shown by Brennan and Reed[8] and the uncorrelated inverse complex Wishart

-1
l{W
C}

(I,\nu,p)

was shown by Shaman[9] to have diagonal statistical structure in which the leading diagonal elements are correlated, while all other element are uncorrelated.

Related distributions

p=1

(i.e. univariate) and

\alpha=\nu/2

,

\beta=\Psi/2

and

x=X

the probability density function of the inverse-Wishart distribution becomes matrix

p(x\mid\alpha,\beta)=

\beta\alphax-\alpha-1\exp(-\beta/x)
\Gamma1(\alpha)

.

i.e., the inverse-gamma distribution, where

\Gamma1()

is the ordinary Gamma function.

\alpha=

\nu
2

and the scale parameter

\beta=2

.

l{GW}-1

. A

p x p

positive definite matrix

X

is said to be distributed as

l{GW}-1(\Psi,\nu,S)

if

Y=X1/2S-1X1/2

is distributed as

l{W}-1(\Psi,\nu)

. Here

X1/2

denotes the symmetric matrix square root of

X

, the parameters

\Psi,S

are

p x p

positive definite matrices, and the parameter

\nu

is a positive scalar larger than

2p

. Note that when

S

is equal to an identity matrix,

l{GW}-1(\Psi,\nu,S)=l{W}-1(\Psi,\nu)

. This generalized inverse Wishart distribution has been applied to estimating the distributions of multivariate autoregressive processes.[10]

l{\Psi}=I,andl{\Phi}

is an arbitrary orthogonal matrix, replacement of

X

by

{\Phi}Xl{\Phi}T

does not change the pdf of

X

so

l{W}-1(I,\nu,p)

belongs to the family of spherically invariant random processes (SIRPs) in some sense.

Thus, an arbitrary p-vector

V

with

l2

length

VTV=1

can be rotated into the vector

\PhiV=[100]T

without changing the pdf of

VTXV

, moreover

\Phi

can be a permutation matrix which exchanges diagonal elements. It follows that the diagonal elements of

X

are identically inverse chi squared distributed, with pdf
f
x11

in the previous section though they are not mutually independent. The result is known in optimal portfolio statistics, as in Theorem 2 Corollary 1 of Bodnar et al,[11] where it is expressed in the inverse form
VT\PsiV
VTXV

\sim

2
\chi
\nu-p+1

.
Xp

\sim

-1
l{W}
p\left({\Psi},

\nu\right).

and

{\Theta}p

are full rank matrices then[12]

\ThetaX{\Theta}T\sim

T,
l{W}
p\left({\Theta}{\Psi}{\Theta}

\nu\right).

Xp

\sim

-1
l{W}
p\left({\Psi},

\nu\right).

and

{\Theta}

is

m x p,m<p

of full rank

m

then

\ThetaX{\Theta}T\sim

-1
l{W}
m

\left({\Theta}{\Psi}{\Theta}T,\nu\right).

See also

Notes and References

  1. Haff. LR. An identity for the Wishart distribution with applications. Journal of Multivariate Analysis. 1979. 9. 4. 531–544. 10.1016/0047-259x(79)90056-3.
  2. Book: Bayesian Data Analysis, Third Edition. Gelman. Andrew. Carlin. John B.. Stern. Hal S.. Dunson. David B.. Vehtari. Aki. Rubin. Donald B.. 2013-11-01. Chapman and Hall/CRC. 9781439840955. 3rd. Boca Raton. en.
  3. Book: Kanti V. Mardia, J. T. Kent and J. M. Bibby . Multivariate Analysis . . 1979 . 978-0-12-471250-8.
  4. Shahrokh Esfahani. Mohammad. Dougherty. Edward. Incorporation of Biological Pathway Knowledge in the Construction of Priors for Optimal Bayesian Classification. IEEE Transactions on Bioinformatics and Computational Biology. 2014. 11. 1. 202–218. 10.1109/tcbb.2013.143. 26355519. 10096507 .
  5. Rosen. Dietrich von. 1988. Moments for the Inverted Wishart Distribution. Scand. J. Stat.. 15. 97–109. JSTOR.
  6. Cook. R D. Forzani. Liliana. Liliana Forzani . Brian . Cook . August 2019. On the mean and variance of the generalized inverse of a singular Wishart matrix. Electronic Journal of Statistics. 5. 10.4324/9780429344633 . 9780429344633 . 146200569 .
  7. Book: Muirhead, Robb . Aspects of Multivariate Statistical Theory . Wiley . 1982 . 0-471-76985-1 . USA . 93 . English.
  8. Brennan. L E. Reed. I S. January 1982. An Adaptive Array Signal Processing Algorithm for Communications. IEEE Transactions on Aerospace and Electronic Systems. 18 . 1. 120–130. 10.1109/TAES.1982.309212 . 1982ITAES..18..124B . 45721922 .
  9. Shaman . Paul . 1980 . The Inverted Complex Wishart Distribution and Its Application to Spectral Estimation . Journal of Multivariate Analysis . 10 . 51–59 . 10.1016/0047-259X(80)90081-0.
  10. Triantafyllopoulos . K. . Real-time covariance estimation for the local level model . 10.1111/j.1467-9892.2010.00686.x . Journal of Time Series Analysis . 32 . 2 . 93–107 . 2011 . 1311.0634 . 88512953 .
  11. Bodnar. T.. Mazur. S.. Podgórski. K.. January 2015. Singular Inverse Wishart Distribution with Application to Portfolio Theory. Department of Statistics, Lund University. (Working Papers in Statistics; Nr. 2). 1–17.
  12. Bodnar . T . Mazur . S . Podgorski . K . 2015 . Singular Inverse Wishart Distribution with Application to Portfolio Theory . Journal of Multivariate Analysis . 143 . 314–326.