|
Statistics and Algorithms / Probability Distributions / Inverse Gamma |
|
Parameters |
shape (\(a\)) and scale (\(b\)). An inverse gamma is the reciprocal of a gamma. The special case is the scaled inverse chi-squared with parameters \(\nu\) (degrees of freedom) and \(\tau ^2\) (scale parameter) which has \(a = \nu / 2\) and \(b = \nu \tau ^2 / 2\) |
|
Kernel |
\(x^{-(a+1)}\exp \left( -{b}{x^{-1}}\right) \) |
|
Integrating Constant |
\({b^a}/\Gamma (a)\) |
|
Support |
\((0,\infty)\) |
|
Mean |
\(\frac{b}{{(a - 1)}}\) if \(a > 1\) |
|
Variance |
\(\frac{b^2}{{{{(a - 1)}^2}(a - 2)}}\) if \(a > 2\) |
|
Main Uses |
Prior, exact and approximate posterior for the variance of residuals or other shocks in a model. For these purposes, it's usually simpler to directly use the scaled inverse chi-squared variation. |
|
Density Function |
|
|
Random Draws |
You can use b/%rangamma(a). A draw from a scaled inverse chi-squared is typically done with nu*tausqr/%ranchisqr(nu) |
|
Moment Matching |
%InvGammaParms(mean,sd) (external function) returns the 2-vector of parameters ( \((a,b)\) parameterization) for the parameters of an inverse gamma with the given mean and standard deviation. If sd is the missing value, this will return \(a=2\), which is the largest value of \(a\) which gives an infinite variance. |
Copyright © 2025 Thomas A. Doan