01

What the inverse gamma returns

The gamma distribution is the waiting time until the α-th event of a Poisson process with rate 1/β. With α = 1 it collapses to the exponential distribution; with integer α it is the Erlang distribution.

Its inverse answers: by what time has p of the probability mass accumulated? For α = 3, β = 2 and p = 0.95, the answer is 12.592 time units.

Cumulative distributionF(x) = P(α, x/β)   (regularised lower incomplete gamma)
  • Mean: αβ. Variance: αβ².
  • Shape α controls how many events are counted; larger α means a more symmetric, bell-like curve.
  • Scale β stretches the axis without changing the shape.
02

How the calculation is done

There is no closed-form inverse for the incomplete gamma function, so the tool solves F(x) = p numerically by bisection on the regularised lower incomplete gamma, which is itself evaluated by a series (for x < α + 1) or a continued fraction (otherwise).

  1. Standardise: solve P(α, y) = p for y = x/β on the unit-scale gamma.
  2. Bracket the answer between 0 and a value large enough that F exceeds p.
  3. Bisect until the interval is narrower than one part in 10¹², then multiply by β.

Check the answer yourself. The result panel shows P(X ≤ x) recomputed from the answer. It should equal your target p to six decimal places — that is the built-in verification.

03

Worked examples

Waiting for three events

Events arrive on average every 2 minutes (β = 2). The time until the third event has α = 3. The median is at p = 0.5, giving x ≈ 5.35 minutes; the 95th percentile is 12.59 minutes.

The exponential special case

With α = 1, the gamma becomes exponential and the quantile has a closed form: x = −β·ln(1 − p). At p = 0.5, β = 1 that is 0.6931 — and the numerical solver returns exactly that.

A right-skewed cost model

Claim sizes are often modelled as gamma. With α = 5 and β = 1, the 99th percentile is 11.60, more than twice the mean of 5 — a direct picture of how heavy the upper tail is.

04

Where it is used

  • Reliability and lifetime — the time to the α-th failure in a repairable system.
  • Queueing — service times that are not exponential are often gamma.
  • Bayesian statistics — the gamma is the conjugate prior for a Poisson rate, and quantiles build credible intervals.
  • Insurance and hydrology — claim sizes and rainfall totals are classic gamma fits.
05

Choosing the shape and rate

The gamma distribution has two parameters and three common conventions for naming them, which is the main source of confusion. Shape k and rate θ behave differently from shape α and scale β, and swapping them silently gives a wrong answer.

Parameter conventions
ConventionParametersMeanVariance
Shape–ratek, λk/λk/λ²
Shape–scaleα, θαθαθ²
Both, relatedα = k, β = 1/λαβαβ²

A mean of 5 with a variance of 10 implies a shape of 2.5, since variance over mean squared gives 10/25 = 0.4 and shape is the reciprocal. Getting that backwards is easy, and the resulting distribution looks plausible while being wrong.

The exponential distribution is the special case k = 1. If your data fits an exponential, the inverse gamma with shape 1 and rate λ returns the same quantiles, which is a useful cross-check on the parameters.

06

Mean, median and mode

The gamma distribution is right-skewed, so its mean sits above its median. The gap widens as the shape parameter shrinks, and closing that gap is often the reason someone reaches for the inverse in the first place.

For shape 3, rate 2 (mean 1.5)
MeasureValueNote
Mean1.5k/λ
Median≈ 1.36Where the CDF reaches 0.5
Mode1.0(k−1)/λ, the peak of the density

The mode is the highest point of the density, the median splits the probability in half, and the mean is the balance point. All three coincide only for a symmetric distribution, which the gamma never is.

?

Frequently asked questions

What is the gamma quantile at p = 0.95, α = 3, β = 2?

12.5916. Check: e^(−6.2958)(1 + 6.2958 + 6.2958²/2) = 0.05, which is exactly the 5% upper tail you asked for.

What is the difference between shape and scale?

Shape α changes the form of the curve; scale β stretches it along the time axis. Doubling β doubles every quantile without changing any probability.

What is the difference between scale and rate?

Rate = 1/scale. Some software (notably R's default) parameterises by rate, so a rate of 0.5 corresponds to a scale of 2 here.

Is the inverse gamma the same as the gamma quantile?

No. The inverse-gamma distribution is a different distribution, used as a prior for variances. This tool returns the quantile of the ordinary gamma distribution.

Why is there no formula for the answer?

The incomplete gamma function has no antiderivative in elementary functions, so its inverse has no closed form either. Numerical inversion is the standard approach in every statistics package.