The Generalized Inverse Gaussian Distribution#
In this section we review the definition and statistical properties of the generalized inverse Gaussian (GIG) distribution.
See also: executable walkthrough in The Generalized Inverse Gaussian.
Definition#
The generalized inverse Gaussian distribution is a continuous probability distribution with the density function:
where \(K_p(\cdot)\) is the modified Bessel function of the second kind and the parameters \((p, a, b)\) satisfy:
Throughout this package we assume that \(a > 0\) and \(b > 0\) for simplicity.
Alternative Parameterization#
Another useful way to parameterize the GIG distribution is to set \(\delta = \sqrt{b/a}\) and \(\eta = \sqrt{ab}\). In that case the density function can be written as:
Note that \(\delta\) serves as a scale parameter of the GIG distribution.
Moment Generating Function#
The moment generating function of a GIG distributed random variable \(X\) is given by:
Moments#
The moments of the GIG distribution have a particularly elegant form:
Tail Behavior#
The GIG density combines the power-law factor \(x^{p-1}\) with a two-sided exponential factor. For \(a > 0\) and \(b > 0\) the tail asymptotics are
where \(C\) collects the normalising constants. The right tail decays exponentially (a semi-heavy tail), while the left tail is suppressed super-exponentially by the factor \(e^{-b/(2x)}\). Consequently, whenever \(a, b > 0\), every moment is finite,
in agreement with the closed form (3), which is well defined for every real order \(\alpha\).
The order \(p\) controls only the polynomial prefactor; the exponential factors dominate both tails. Genuine power-law (Pareto-type) heaviness therefore appears only at the boundary of the parameter space, where one of the two exponential factors degenerates:
Inverse-gamma limit (\(a \to 0\), \(p < 0\)): the right cutoff \(e^{-a x / 2}\) vanishes and \(f(x) \sim C\, x^{p-1}\), a power law with tail index \(-p\). Positive moments then satisfy \(E[X^\alpha] < \infty\) if and only if \(\alpha < -p\).
Gamma limit (\(b \to 0\), \(p > 0\)): the origin factor \(e^{-b / (2x)}\) vanishes, \(f(x) \sim C\, x^{p-1}\) as \(x \to 0^+\), and the right tail stays exponential. All positive moments remain finite, while inverse moments \(E[X^{-\alpha}]\) are finite if and only if \(\alpha < p\).
Skewness and Kurtosis#
Because (3) supplies every raw moment \(m_k = E[X^k]\) in closed form, the standardised moments follow directly. With \(\mu = m_1\) and \(\sigma^2 = m_2 - m_1^2\), the third and fourth central moments are
and the skewness and excess kurtosis are
For \(a, b > 0\) both are finite (all four moments exist), and the GIG is right-skewed and leptokurtic over the usual parameter range.
The kurtosis, however, requires a finite fourth moment, so it becomes unbounded precisely in the heavy-tailed inverse-gamma limit. As \(a \to 0\) one has \(X \to \text{InvGamma}(\alpha, b/2)\) with \(\alpha = -p\), and
which diverges as \(\alpha \to 4^+\) and is undefined for \(\alpha \le 4\). The kurtosis therefore fails exactly where the right tail is heaviest, which motivates tail diagnostics that remain finite without a fourth moment (for example the varentropy \(\operatorname{Var}[-\log f(X)]\), which stays finite throughout this limit).
Exponential Family Form#
The GIG distribution belongs to the exponential family with density:
Sufficient Statistics:
Natural Parameters:
The natural parameters \(\theta = (\theta_1, \theta_2, \theta_3)\) are derived from the classical parameters \((p, a, b)\):
The inverse transformation is:
Base Measure:
Log Partition Function:
where \(p = \theta_1 + 1\), \(a = -2\theta_3\), and \(b = -2\theta_2\).
Expectation Parameters:
The expectation parameters \(\eta = \nabla\psi(\theta) = E[t(X)]\) are:
Unfortunately we do not have an analytical formula for \(\eta_1 = E[\log X]\). In practice it can only be approximated numerically.
Maximum Likelihood Estimation#
Given the expectation parameters \((\eta_1, \eta_2, \eta_3)\), computing the natural parameters \((p, a, b)\) by solving the above equations is a challenging problem. Let \(x_1, x_2, \ldots, x_n\) be a sequence of sample data, then the maximum likelihood estimator (MLE) of GIG is given by:
where \(L_{GIG}\) is the log-likelihood function (excluding constants):
and the sufficient statistics are:
\(\hat{\eta}_1 = \frac{1}{n} \sum_{k=1}^n x_k^{-1}\)
\(\hat{\eta}_2 = \frac{1}{n} \sum_{k=1}^n x_k\)
\(\hat{\eta}_3 = \frac{1}{n} \sum_{k=1}^n \log(x_k)\)
One can verify that the optimal solution \((\hat{p}, \hat{a}, \hat{b})\) must satisfy (8) where \((\eta_1, \eta_2, \eta_3)\) are replaced by \((\hat{\eta}_1, \hat{\eta}_2, \hat{\eta}_3)\).
Numerical Challenges#
As discussed in Jorgensen2012, there is no analytical expression for \(\hat{p}\) or even its partial derivatives. Most literature suggests fixing \(p\) when maximizing the log-likelihood function.
Even when \(p\) is fixed, Hu2005 reports that when \(|p|\) is large (say, above 10), there might be no solution for the first two equations in (8).
Hellinger Distance#
To measure estimation errors, one good choice is the Hellinger distance between the true and estimated parameters.
Proposition. Let \((p_1, a_1, b_1)\) and \((p_2, a_2, b_2)\) be the parameters of two GIG distributions. The squared Hellinger distance between the two distributions is given by:
where \(\bar{p} = (p_1 + p_2)/2\), \(\bar{a} = (a_1 + a_2)/2\), and \(\bar{b} = (b_1 + b_2)/2\).
Special Cases#
There are several important special cases of the GIG distribution:
Inverse Gaussian (IG): when \(p = -1/2\)
Gamma: when \(p > 0\) and \(b \to 0\), giving \(\text{Gamma}(p, a/2)\)
Inverse Gamma: when \(p < 0\) and \(a \to 0\), giving \(\text{InvGamma}(-p, b/2)\)
These special cases are implemented as separate classes in normix: