Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Generalized inverse Gaussian distribution

The generalized inverse Gaussian (GIG) distribution supplies the positive mixing variable for the GH family. Its normalizing integral also gives the posterior moments used by EM. A standard reference is Bent Jørgensen, Statistical Properties of the Generalized Inverse Gaussian Distribution (1982; electronic edition 2012).

Definition and normalizing integral

Write YGIG(p,a,b)Y\sim\operatorname{GIG}(p,a,b), where pRp\in\mathbb R and a,b>0a,b>0. The density on y>0y>0 is

f(yp,a,b)=(a/b)p/22Kp(ab)yp1exp ⁣[12(ay+b/y)].f(y\mid p,a,b)=\frac{(a/b)^{p/2}}{2K_p(\sqrt{ab})} y^{p-1}\exp\!\left[-\frac12(ay+b/y)\right].

Here KpK_p is the modified Bessel function of the second kind. Its integral representations, NIST DLMF §10.32 give the identity

0yp1e(ay+b/y)/2dy=2(b/a)p/2Kp(ab).\int_0^\infty y^{p-1}e^{-(ay+b/y)/2}\,dy =2(b/a)^{p/2}K_p(\sqrt{ab}).

We use the open interior unless a boundary is named explicitly. A normalized boundary law also exists for a=0,b>0,p<0a=0,b>0,p<0 (inverse gamma), or b=0,a>0,p>0b=0,a>0,p>0 (gamma). Formula (1) must then be interpreted by its limit, not by substituting zero into its Bessel ratio.

The symbol YY denotes a mixing variable here. In conditioning a mixture, it is called WW; it is independent of the standard normal noise ZZ in that construction.

Scale and concentration parameters

Set δ=b/a>0\delta=\sqrt{b/a}>0 and ω=ab>0\omega=\sqrt{ab}>0, so a=ω/δa=\omega/\delta and b=ωδb=\omega\delta. The source calls the latter parameter η\eta; here η\eta is reserved for expectation coordinates. Then

f(yp,δ,ω)=δp2Kp(ω)yp1exp ⁣[ω2(yδ+δy)].f(y\mid p,\delta,\omega)=\frac{\delta^{-p}}{2K_p(\omega)} y^{p-1}\exp\!\left[-\frac{\omega}{2} \left(\frac{y}{\delta}+\frac{\delta}{y}\right)\right].

Indeed Y/δGIG(p,ω,ω)Y/\delta\sim\operatorname{GIG}(p,\omega,\omega), which verifies the power δp\delta^{-p}. More generally, for c>0c>0,

cYGIG(p,a/c,bc).cY\sim\operatorname{GIG}(p,a/c,bc).

This scaling identity is central to GH identifiability.

Moment generating function and moments

Multiplication by euye^{uy} changes aa to a2ua-2u in the normalizing integral. For u<a/2u<a/2 this gives

MY(u)=(aa2u)p/2Kp(b(a2u))Kp(ab)=(ωω2δu)p/2Kp(ω22ωδu)Kp(ω).\begin{aligned} M_Y(u)&=\left(\frac{a}{a-2u}\right)^{p/2} \frac{K_p(\sqrt{b(a-2u)})}{K_p(\sqrt{ab})}\\ &=\left(\frac{\omega}{\omega-2\delta u}\right)^{p/2} \frac{K_p(\sqrt{\omega^2-2\omega\delta u})}{K_p(\omega)}. \end{aligned}

At u=a/2u=a/2 the integral is finite only if p<0p<0; for u>a/2u>a/2 it diverges. For every real rr, multiplication by yry^r instead changes the Bessel order:

E[Yr]=(b/a)r/2Kp+r(ab)Kp(ab)=δrKp+r(ω)Kp(ω).\mathbb E[Y^r]=(b/a)^{r/2} \frac{K_{p+r}(\sqrt{ab})}{K_p(\sqrt{ab})} =\delta^r\frac{K_{p+r}(\omega)}{K_p(\omega)}.

Thus E[Y]=m1\mathbb E[Y]=m_1 and Var(Y)=m2m12\operatorname{Var}(Y)=m_2-m_1^2, where mr=E[Yr]m_r=\mathbb E[Y^r]. Differentiating at r=0r=0 also yields an exact special-function expression for the logarithmic moment:

E[logY]=12log(b/a)+νlogKν(ab)ν=p.\mathbb E[\log Y]=\frac12\log(b/a) +\left.\partial_\nu\log K_\nu(\sqrt{ab})\right|_{\nu=p}.

This is a derivative with respect to the order, not the argument of KK. Numerical evaluation may require quadrature or order derivatives; the absence of an elementary formula does not make the identity approximate.

Tails and moment boundaries

With C=(a/b)p/2/[2Kp(ab)]C=(a/b)^{p/2}/[2K_p(\sqrt{ab})], the two endpoint asymptotics are

f(y)Cyp1eay/2,y,f(y)Cyp1eb/(2y),y0.\begin{aligned} f(y)&\sim C y^{p-1}e^{-ay/2},&&y\to\infty,\\ f(y)&\sim C y^{p-1}e^{-b/(2y)},&&y\downarrow0. \end{aligned}

The exponential cutoffs make every real power moment finite for a,b>0a,b>0. The right tail is exponential rather than a power law; the origin is suppressed faster than any power. At the boundaries the moment domains change:

Boundary lawDensity kernelFinite power moments
Gamma(p,a/2)\operatorname{Gamma}(p,a/2), p>0p>0yp1eay/2y^{p-1}e^{-ay/2}E[Yr]<\mathbb E[Y^r]<\infty iff r>pr>-p
InvGamma(p,b/2)\operatorname{InvGamma}(-p,b/2), p<0p<0yp1eb/(2y)y^{p-1}e^{-b/(2y)}E[Yr]<\mathbb E[Y^r]<\infty iff r<pr<-p

Gamma uses a shape and a rate; inverse gamma uses a shape and the coefficient of 1/y1/y in its exponent. See the family tour for their normal mixtures.

Skewness and kurtosis

Writing v=m2m12v=m_2-m_1^2, the central moments are

μ3=m33m1m2+2m13,μ4=m44m1m3+6m12m23m14.\begin{aligned} \mu_3&=m_3-3m_1m_2+2m_1^3,\\ \mu_4&=m_4-4m_1m_3+6m_1^2m_2-3m_1^4. \end{aligned}

The standardized skewness and excess kurtosis are

γ1=μ3/v3/2,γ2=μ4/v23.\gamma_1=\mu_3/v^{3/2},\qquad \gamma_2=\mu_4/v^2-3.

They are finite in the interior. At the inverse-gamma boundary with shape α=p\alpha=-p, the excess kurtosis is

γ2=6(5α11)(α3)(α4),α>4.\gamma_2=\frac{6(5\alpha-11)}{(\alpha-3)(\alpha-4)},\qquad \alpha>4.

It diverges as α4\alpha\downarrow4 and is undefined for α4\alpha\leq4. It does not diverge for every inverse-gamma boundary: shapes above four retain a finite fourth moment.

Exponential-family coordinates

Use the same statistic order throughout this batch:

t(y)=(logy, y1, y),fθ(y)=1y>0exp{θt(y)ψ(θ)}.t(y)=(\log y,\ y^{-1},\ y)^\top,\qquad f_\theta(y)=\mathbf1_{y>0}\exp\{\theta^\top t(y)-\psi(\theta)\}.

The natural parameters and their inverse map are

θ=(p1,b/2,a/2),p=θ1+1,b=2θ2,a=2θ3.\theta=(p-1,-b/2,-a/2)^\top,\qquad p=\theta_1+1,\quad b=-2\theta_2,\quad a=-2\theta_3.

The interior is R×(,0)2\mathbb R\times(-\infty,0)^2, and the log-partition is

ψ(θ)=log2+logKp(ab)+p2log(b/a).\psi(\theta)=\log2+\log K_p(\sqrt{ab})+\frac p2\log(b/a).

Differentiation yields

η1=E[logY]=12log(b/a)+νlogKν(ab)ν=p,η2=E[Y1]=(a/b)1/2Kp1(ab)Kp(ab),η3=E[Y]=(b/a)1/2Kp+1(ab)Kp(ab).\begin{aligned} \eta_1&=\mathbb E[\log Y]=\tfrac12\log(b/a) +\left.\partial_\nu\log K_\nu(\sqrt{ab})\right|_{\nu=p},\\ \eta_2&=\mathbb E[Y^{-1}]=(a/b)^{1/2} \frac{K_{p-1}(\sqrt{ab})}{K_p(\sqrt{ab})},\\ \eta_3&=\mathbb E[Y]=(b/a)^{1/2} \frac{K_{p+1}(\sqrt{ab})}{K_p(\sqrt{ab})}. \end{aligned}

The exponential-family core relates η=ψ\eta=\nabla\psi and 2ψ=Cov(t(Y))\nabla^2\psi=\operatorname{Cov}(t(Y)) to Fisher information. The IG entry states the regularity and minimality assumptions behind these identities.

Maximum likelihood and numerical limits

For independent positive observations y1,,yny_1,\ldots,y_n, set η^=n1i(logyi,yi1,yi)\widehat\eta=n^{-1}\sum_i(\log y_i,y_i^{-1},y_i)^\top. Up to a term independent of the candidate parameters, the average log likelihood is

LGIG(p,a,bη^)=(p1)η^1b2η^2a2η^3ψ(p1,b/2,a/2).L_{\mathrm{GIG}}(p,a,b\mid\widehat\eta) =(p-1)\widehat\eta_1-\tfrac b2\widehat\eta_2 -\tfrac a2\widehat\eta_3-\psi(p-1,-b/2,-a/2).

The MLE, when attained in the interior, is

(p^,a^,b^)=arg maxpR, a,b>0LGIG(p,a,bη^).(\widehat p,\widehat a,\widehat b) =\operatorname*{arg\,max}_{p\in\mathbb R,\ a,b>0} L_{\mathrm{GIG}}(p,a,b\mid\widehat\eta).

It matches the three moments in (15). Strict convexity in natural coordinates gives uniqueness of an interior optimum, but does not guarantee that one exists for every empirical moment vector. At fixed pp, only the inverse and first moments are matched. Near boundaries, Bessel ratios and nearly dependent statistics can make inversion ill-conditioned. A numerical failure or a large parameter error alone does not prove that an MLE is nonexistent; see why not gradient descent.

Hellinger distance

For densities f1,f2f_1,f_2, use the convention H2(f1,f2)=1f1f2H^2(f_1,f_2)=1-\int\sqrt{f_1f_2}. Let bars denote arithmetic means of the two GIG parameter triples. Applying (2) to the geometric mean of the densities gives

HGIG2=1(a1/b1)p1/4(a2/b2)p2/4Kp1(a1b1)Kp2(a2b2)(bˉaˉ)pˉ/2Kpˉ(aˉbˉ).H_{\mathrm{GIG}}^2=1- \frac{(a_1/b_1)^{p_1/4}(a_2/b_2)^{p_2/4}} {\sqrt{K_{p_1}(\sqrt{a_1b_1})K_{p_2}(\sqrt{a_2b_2})}} \left(\frac{\bar b}{\bar a}\right)^{\bar p/2} K_{\bar p}(\sqrt{\bar a\bar b}).

Equivalently, the affinity 1H21-H^2 is exp{ψ((θ(1)+θ(2))/2)[ψ(θ(1))+ψ(θ(2))]/2}\exp\{\psi((\theta^{(1)}+\theta^{(2)})/2) -[\psi(\theta^{(1)})+\psi(\theta^{(2)})]/2\}. This compares distributions even when individual parameter coordinates are poorly conditioned. The upstream note attributes this application to Shi (2016), Generalized Hyperbolic Distributions and Related Topics.

Special cases and implementation

The inverse Gaussian with mean m>0m>0 and shape λ>0\lambda>0 is exactly GIG(1/2,λ/m2,λ)\operatorname{GIG}(-1/2,\lambda/m^2,\lambda). Gamma and inverse gamma are the boundary cases above. Their induced marginals are described in the GH family tour.

Executable examples remain in the upstream GIG tutorial; implementation details remain in the package API and Bessel and solver design.

Source and adaptation

Adapted from xshi19/normix, docs/theory/gig.md, at revision 763bb3608920661a012cf089888d349fbf680aad (2026-09-13 import). Copyright (c) 2020 xshi19. Licensed under MIT. The pinned source records the original version. Notation, mathematical qualifications, and links were adapted for this site; API recipes, executable package cells, and notebook plots are omitted. No upstream benchmark execution or formal-proof verification is claimed for this adaptation.

MIT permission notice

MIT License

Copyright (c) 2020 xshi19

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

References
  1. Jørgensen, B. (1982). Statistical Properties of the Generalized Inverse Gaussian Distribution. In Lecture Notes in Statistics. Springer New York. 10.1007/978-1-4612-5698-4