Normal-inverse-gamma distribution explained

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\mid\sigma2,\mu,λ\simN(\mu,\sigma2/λ)

has a normal distribution with mean

\mu

and variance

\sigma2/λ

, where

\sigma2\mid\alpha,\beta\sim\Gamma-1(\alpha,\beta)

has an inverse-gamma distribution. Then

(x,\sigma2)

has a normal-inverse-gamma distribution, denoted as

(x,\sigma2)\simN-\Gamma-1(\mu,λ,\alpha,\beta).

(

NIG

is also used instead of

N-\Gamma-1.

)

The normal-inverse-Wishart distribution is a generalization of the normal-inverse-gamma distribution that is defined over multivariate random variables.

Characterization

Probability density function

f(x,\sigma2\mid\mu,λ,\alpha,\beta)=

\sqrt{λ
} \, \frac \, \left(\frac \right)^ \exp \left(-\frac \right)

For the multivariate form where

x

is a

k x 1

random vector,

f(x,\sigma2\mid\mu,V-1,\alpha,\beta)=|V|-1/2{(2\pi)-k/2}

\beta\alpha
\Gamma(\alpha)

\left(

1
\sigma2

\right)\alpha\exp\left(-

2\beta+(x-\boldsymbol{\mu
)

TV-1(x-\boldsymbol{\mu})}{2\sigma2}\right).

where

|V|

is the determinant of the

k x k

matrix

V

. Note how this last equation reduces to the first form if

k=1

so that

x,V,\boldsymbol{\mu}

are scalars.

Alternative parameterization

It is also possible to let

\gamma=1/λ

in which case the pdf becomes

f(x,\sigma2\mid\mu,\gamma,\alpha,\beta)=

1
\sigma\sqrt{2\pi\gamma

}

\beta\alpha
\Gamma(\alpha)

\left(

1
\sigma2

\right)\alpha\exp\left(-

2\gamma\beta+(x-\mu)2
2\gamma\sigma2

\right)

In the multivariate form, the corresponding change would be to regard the covariance matrix

V

instead of its inverse

V-1

as a parameter.

Cumulative distribution function

F(x,\sigma2\mid\mu,λ,\alpha,\beta)=

-\beta
\sigma2
e
\left(\beta
\sigma2
\right)\alpha \left(\operatorname{erf
\left(\sqrt{λ
(x-\mu

)}{\sqrt{2}\sigma}\right)+1\right)}{2 \sigma2\Gamma(\alpha)}

Properties

Marginal distributions

Given

(x,\sigma2)\simN-\Gamma-1(\mu,λ,\alpha,\beta).

as above,

\sigma2

by itself follows an inverse gamma distribution:

\sigma2\sim\Gamma-1(\alpha,\beta)

while

\sqrt{\alphaλ
\beta
} (x - \mu) follows a t distribution with

2\alpha

degrees of freedom.[1]

In the multivariate case, the marginal distribution of

x

is a multivariate t distribution:

x\simt2\alpha(\boldsymbol{\mu},

\beta
\alpha

V)

Scaling

Suppose

(x,\sigma2)\simN-\Gamma-1(\mu,λ,\alpha,\beta).

Then for

c>0

,

(cx,c\sigma2)\simN-\Gamma-1(c\mu,λ/c,\alpha,c\beta).

Proof: To prove this let

(x,\sigma2)\simN-\Gamma-1(\mu,λ,\alpha,\beta)

and fix

c>0

. Defining

Y=(Y1,Y2)=(cx,c\sigma2)

, observe that the PDF of the random variable

Y

evaluated at

(y1,y2)

is given by

1/c2

times the PDF of a

N-\Gamma-1(\mu,λ,\alpha,\beta)

random variable evaluated at

(y1/c,y2/c)

. Hence the PDF of

Y

evaluated at

(y1,y2)

is given by :

fY(y1,y

2)=1
c2
\sqrt{λ
} \, \frac \, \left(\frac \right)^ \exp \left(-\frac \right) = \frac \, \frac \, \left(\frac \right)^ \exp \left(-\frac \right).\!

The right hand expression is the PDF for a

N-\Gamma-1(c\mu,λ/c,\alpha,c\beta)

random variable evaluated at

(y1,y2)

, which completes the proof.

Exponential family

Normal-inverse-gamma distributions form an exponential family with natural parameters

style\theta
1=
2
,

style\theta2=λ\mu

,

style\theta3=\alpha

, and
style\theta
4=-\beta+\mu2
2
and sufficient statistics
styleT
1=x2
\sigma2
,
styleT
2=x
\sigma2
,

styleT3=log(

1
\sigma2

)

, and
styleT
4=1
\sigma2
.

Kullback–Leibler divergence

Measures difference between two distributions.

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

\sigma2

from an inverse gamma distribution with parameters

\alpha

and

\beta

  1. Sample

x

from a normal distribution with mean

\mu

and variance

\sigma2/λ

Related distributions

\sigma2V

(whereas in the multivariate inverse-gamma distribution the covariance matrix is regarded as known up to the scale factor

\sigma2

) is the normal-inverse-Wishart distribution

See also

References

Notes and References

  1. Book: Ramírez-Hassan, Andrés . 4.2 Conjugate prior to exponential family Introduction to Bayesian Econometrics.