# Normal-inverse-gamma distribution

Parameters $\mu\,$ location (real) $\lambda > 0\,$ (real) $\alpha > 0\,$ (real) $\beta > 0\,$ (real) $x \in (-\infty, \infty)\,\!, \; \sigma^2 \in (0,\infty)$ $\frac {\sqrt{\lambda}} {\sigma\sqrt{2\pi} } \frac{\beta^\alpha}{\Gamma(\alpha)} \, \left( \frac{1}{\sigma^2} \right)^{\alpha + 1} e^{ -\frac { 2\beta + \lambda(x - \mu)^2} {2\sigma^2} }$

In probability theory and statistics, the normal-inverse-gamma distribution (or Gaussian-inverse-gamma distribution) is a four-parameter family of multivariate continuous probability distributions. It is the conjugate prior of a normal distribution with unknown mean and variance.

## Definition

Suppose

$x | \sigma^2, \mu, \lambda\sim \mathrm{N}(\mu,\sigma^2 / \lambda) \,\!$

has a normal distribution with mean $\mu$ and variance $\sigma^2 / \lambda$, where

$\sigma^2|\alpha, \beta \sim \Gamma^{-1}(\alpha,\beta) \!$

has an inverse gamma distribution. Then $(x,\sigma^2)$ has a normal-inverse-gamma distribution, denoted as

$(x,\sigma^2) \sim \text{N-}\Gamma^{-1}(\mu,\lambda,\alpha,\beta) \! .$

## Characterization

### Probability density function

$f(x,\sigma^2|\mu,\lambda,\alpha,\beta) = \frac {\sqrt{\lambda}} {\sigma\sqrt{2\pi} } \, \frac{\beta^\alpha}{\Gamma(\alpha)} \, \left( \frac{1}{\sigma^2} \right)^{\alpha + 1} \exp \left( -\frac { 2\beta + \lambda(x - \mu)^2} {2\sigma^2} \right)$

#### Alternative parameterization

It is also possible to let $\gamma = 1 / \lambda$ in which case the pdf becomes

$f(x,\sigma^2|\mu,\gamma,\alpha,\beta) = \frac {1} {\sigma\sqrt{2\pi\gamma} } \, \frac{\beta^\alpha}{\Gamma(\alpha)} \, \left( \frac{1}{\sigma^2} \right)^{\alpha + 1} \exp \left( -\frac{2\gamma\beta + (x - \mu)^2}{2\gamma \sigma^2} \right)$

## Posterior distribution of the parameters

See the articles on normal-gamma distribution and conjugate prior.

## Interpretation of the parameters

See the articles on normal-gamma distribution and conjugate prior.

## Generating normal-inverse-gamma random variates

Generation of random variates is straightforward:

1. Sample $\sigma^2$ from an inverse gamma distribution with parameters $\alpha$ and $\beta$
2. Sample $x$ from a normal distribution with mean $\mu$ and variance $\sigma^2/\lambda$

## References

• Dominici, Francesca; Giovanni Parmigiani, Merlise Clyde (2000-09). "Conjugate Analysis of Multivariate Normal Data with Incomplete Observations". The Canadian Journal of Statistics / La Revue Canadienne de Statistique (The Canadian Journal of Statistics / La Revue Canadienne de Statistique, Vol. 28, No. 3) 28 (3): 533–550. doi:10.2307/3315963. JSTOR 3315963.