The Generalized Inverse Gaussian Distribution
In this section we review the definition and statistical properties of the generalized inverse Gaussian (GIG) distribution.
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:
This formula is implemented in the moment_alpha() method.
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 (6) 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 (6).
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:
InverseGaussianGammaInverseGamma
References
Jørgensen, B. (2012). Statistical Properties of the Generalized Inverse Gaussian Distribution. Springer.