# 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 ${\displaystyle {\mathbf {B} }}$ follows an inverse Wishart distribution, denoted as ${\displaystyle \mathbf {B} \sim W^{-1}({\mathbf {\Psi } },m)}$, if its probability density function is written as follows:

${\displaystyle {\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 ${\displaystyle {\mathbf {B} }}$ is a ${\displaystyle p\times p}$ matrix. The matrix ${\displaystyle {\mathbf {\Psi } }}$ is assumed to be positive definite.

## Theorems

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

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

${\displaystyle 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 ${\displaystyle \mathbf {\Psi } =\mathbf {\Sigma } ^{-1}}$ and ${\displaystyle \Gamma _{p}(\cdot )}$ is the multivariate gamma function.[1]

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

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

${\displaystyle {\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 ${\displaystyle {\mathbf {A} _{ij}}}$ and ${\displaystyle {\mathbf {\Psi } _{ij}}}$ are ${\displaystyle p_{i}\times p_{j}}$ matrices, then we have

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

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

iii) ${\displaystyle {\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 ${\displaystyle MN_{p\times q}(\cdot ,\cdot )}$ is a matrix normal distribution;

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

### Conjugate distribution

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

### Expectation

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

${\displaystyle {\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 ${\displaystyle p=1}$ (i.e. univariate) and ${\displaystyle \alpha =m/2}$, ${\displaystyle \beta =\mathbf {\Psi } /2}$ and ${\displaystyle x=\mathbf {B} }$ the probability density function of the inverse-Wishart distribution becomes

${\displaystyle p(x|\alpha ,\beta )={\frac {\beta ^{\alpha }\,x^{-\alpha -1}\exp(-\beta /x)}{\Gamma _{1}(\alpha )}}.}$

i.e., the inverse-gamma distribution, where ${\displaystyle \Gamma _{1}(\cdot )}$ is the ordinary Gamma function.

A generalization is the normal-inverse-Wishart distribution.