# Inverse-Wishart distribution

In statistics, the inverse Wishart distribution, also called the inverted Wishart distribution, is a probability density function defined on matrices. In Bayesian statistics it is used as the conjugate for the covariance matrix of a multivariate normal distribution.

We say ${\mathbf {B} }$ follows an inverse Wishart distribution, denoted as $\mathbf {B} \sim W^{-1}({\mathbf {\Psi } },m)$ , if its probability density function is written as follows:

${\frac {\left|{\mathbf {\Psi } }\right|^{m/2}\left|B\right|^{-(m+p+1)/2}e^{-\mathrm {trace} ({\mathbf {\Psi } }{\mathbf {B} }^{-1})/2}}{2^{mp/2}\Gamma _{p}(m/2)}},$ where ${\mathbf {B} }$ is a $p\times p$ matrix. The matrix ${\mathbf {\Psi } }$ is assumed to be positive definite.

## Theorems

### Distribution of the inverse of a Wishart-distributed matrix

If ${\mathbf {A} }\sim W({\mathbf {\Sigma } },m)$ and ${\mathbf {\Sigma } }$ is $p*p$ , then ${\mathbf {B} }={\mathbf {A} }^{-1}$ has an inverse Wishart distribution ${\mathbf {B} }\sim W^{-1}({\mathbf {\Sigma } }^{-1},m)$ with probability density function:

$p(\mathbf {B} |\mathbf {\Psi } ,m)={\frac {\left|{\mathbf {\Psi } }\right|^{m/2}\left|\mathbf {B} \right|^{-(m+p+1)/2}\exp \left({-\mathrm {tr} ({\mathbf {\Psi } }{\mathbf {B} }^{-1})/2}\right)}{2^{mp/2}\Gamma _{p}(m/2)}}$ .

where $\mathbf {\Psi } =\mathbf {\Sigma } ^{-1}$ and $\Gamma _{p}(\cdot )$ is the multivariate gamma function.

### Marginal and conditional distributions from an inverse Wishart-distributed matrix

Suppose ${\mathbf {A} }\sim W^{-1}({\mathbf {\Psi } },m)$ has an inverse Wishart distribution. Partition the matrices ${\mathbf {A} }$ and ${\mathbf {\Psi } }$ conformably with each other

${\mathbf {A} }={\begin{bmatrix}A_{11}&A_{12}\\A_{21}&A_{22}\end{bmatrix}},\;{\mathbf {\Psi } }={\begin{bmatrix}\Psi _{11}&\Psi _{12}\\\Psi _{21}&\Psi _{22}\end{bmatrix}}$ where ${\mathbf {A} _{ij}}$ and ${\mathbf {\Psi } _{ij}}$ are $p_{i}\times p_{j}$ matrices, then we have

i) ${\mathbf {A} _{11}}$ is independent of ${\mathbf {A} }_{11}^{-1}{\mathbf {A} }_{12}$ and ${\mathbf {A} }_{22\cdot 1}$ , where ${\mathbf {A} _{22\cdot 1}}={\mathbf {A} }_{22}-{\mathbf {A} }_{21}{\mathbf {A} }_{11}^{-1}{\mathbf {A} }_{12}$ ;

ii) ${\mathbf {A} _{11}}\sim W^{-1}({\mathbf {\Psi } _{11}},m-p_{2})$ ;

iii) ${\mathbf {A} }_{11}^{-1}{\mathbf {A} }_{12}|{\mathbf {A} }_{22\cdot 1}\sim MN_{p_{1}\times p_{2}}({\mathbf {\Psi } }_{11}^{-1}{\mathbf {\Psi } }_{12},{\mathbf {A} }_{22\cdot 1}\otimes {\mathbf {\Psi } }_{11}^{-1})$ , where $MN_{p\times q}(\cdot ,\cdot )$ is a matrix normal distribution;

iv) ${\mathbf {A} }_{22\cdot 1}\sim W^{-1}({\mathbf {\Psi } }_{22\cdot 1},m)$ ### Conjugate distribution

If ${\mathbf {A} }\sim W({\mathbf {\Sigma } },n)$ and ${\mathbf {\Sigma } }$ has the a priori distribution $W^{-1}({\mathbf {\Psi } },m)$ then the conditional distribution of ${\mathbf {\Sigma } }$ is $W^{-1}({\mathbf {A} }+{\mathbf {\Psi } },n+m)$ .

### Expectation

If ${\mathbf {A} }\sim W({\mathbf {\Sigma } },n)$ , then

${\mathcal {E}}({\mathbf {A} }^{-1})={\frac {{\mathbf {\Sigma } }^{-1}}{n-p-1}}.$ ## Related distributions

A univariate specialization of the inverse-Wishart distribution is the inverse-gamma distribution. With $p=1$ (i.e. univariate) and $\alpha =m/2$ , $\beta =\mathbf {\Psi } /2$ and $x=\mathbf {B}$ the probability density function of the inverse-Wishart distribution becomes

$p(x|\alpha ,\beta )={\frac {\beta ^{\alpha }\,x^{-\alpha -1}\exp(-\beta /x)}{\Gamma _{1}(\alpha )}}.$ i.e., the inverse-gamma distribution, where $\Gamma _{1}(\cdot )$ is the ordinary Gamma function.

A generalization is the normal-inverse-Wishart distribution. 