Skip to content

Analytic and optimized approximations to the median of the gamma distribution

Richard F. Lyon

math.STarXiv:2611.14429

Abstract

The median νΓ(α) of the gamma distribution has no closed form, but its behavior at both ends is known: it is asymptotic to 2-1/αe-γ (with γ being the Euler-Mascheroni constant) as the shape parameter α 0, and approaches α- 1/3 as α ∞. We write approximations as interpolations (1 - g)ν0 + gν∞ between two elementary-function bounds or approximations, each exact in one limit, with an interpolator g(α) going from 0 to 1, and compare three such forms: a first one between previously proven bounds, a second ending in an approximation from the beta median that is exact at α= 1 but does not quite approach α- 1/3 as α ∞, and a third one, between bounds proved here, that corrects the large-α end of the second. For each form, the ideal interpolator's slope at 0, approach to 1, and value at α= 1 are derived in closed form. Rational interpolators with every coefficient set in closed form from these properties, with no numerical fitting, reach a worst relative error of 0.0011 over all α> 0, with absolute error below 0.0002. Fitting some of these or other coefficients numerically to minimize the worst absolute-or-relative error then trades accuracy against complexity: the Pareto frontier reaches 0.000087 with two fitted constants and 0.000041 with five, and from two on uses degree-4 rationals of the second form with no α2 term in the numerator. The proofs that the end functions of the first and third forms are bounds are machine-checked in Lean 4.

Create a lesson