PLAYGROUND

DISTRIBUTIONS / CONTINUOUS / GAMMA

Gamma distribution

What it describes

The Gamma distribution is a positive family for accumulated times, waiting quantities, and latent rates. Its shape and scale parameters range from decreasing curves to profiles with an interior peak.

Its support is the entire positive line. alpha controls shape and beta scale in Phitter’s convention; always check whether another package uses beta as a rate.

History and names

Euler’s Gamma function emerged in eighteenth-century analysis; the distribution became established in probability and statistics as a continuous extension of sums of exponentials.

How it connects to other distributions

Erlang is Gamma with integer shape and Exponential is alpha=1. Chi-square is Gamma with a particular scale; Beta results from normalizing two independent Gammas.

Where it appears

  • time to complete several stages
  • rainfall, insurance, reliability, and Bayesian models for rates

Fitting cautions

A good Gamma fit does not prove a stage process exists: the family can approximate many positive mechanisms.

Waiting once or accumulating many stages

When its shape equals one, Gamma becomes Exponential. When the shape is an integer, it describes a sum of that many exponential waiting times and is called Erlang. Away from the integers it retains mathematical flexibility even though a literal count of stages is no longer available.

The family also connects observations with uncertainty about rates. In Bayesian inference, a Gamma distribution can represent an unknown Poisson rate and produce an algebraically manageable update. In a Gamma process, positive increments model accumulated damage or rainfall. These stories share a shape but are not interchangeable: an elapsed time, a latent rate, and an accumulated amount demand different parameter interpretations.

Decision guide

A good candidate when: a positive quantity accumulates waiting times, costs, or small contributions and is skewed with a tail lighter than a power law.

Compare it with: Weibull and Lognormal. Compare hazard, coefficient of variation, and quantiles; a similar fit does not make their additive and multiplicative mechanisms equivalent.

References

  • SciPy reference: scipy.stats.gamma — definition and parameterization
  • Johnson, N. L., Kotz, S. & Balakrishnan, N. (1994). Continuous Univariate Distributions, 2nd ed., Vol. 1. Wiley.
  • Feller, W. (1968). An Introduction to Probability Theory and Its Applications, Vol. 1, 3rd ed. Wiley.
  • Abramowitz, M. & Stegun, I. A., eds. (1972). Handbook of Mathematical Functions. Dover.

Gamma Distribution: equations and calculator

Distribution defintion

X∼Gamma(α,β)X\sim\mathrm{Gamma}\left(\alpha,\beta\right)

Distribution domain

x∈(0,∞)x\in\left(0,\infty\right)

Parameters domain and parameters constraints

α∈R+,β∈R+\alpha\in\mathbb{R}^{+},\beta\in\mathbb{R}^{+}

Cumulative distribution function

FX(x)=P(α,xβ)=1Γ(α)γ(α,xβ)F_{X}\left(x\right)=\text{P}\left(\alpha,\frac{x}{\beta}\right)=\frac{1}{\Gamma(\alpha)} \gamma\left(\alpha,\frac{x}{\beta}\right)

Probability density function

fX(x)=1Γ(α)βαxα−1e−xβf_{X}\left(x\right)=\frac{1}{\Gamma(\alpha) \beta^\alpha} x^{\alpha-1} e^{-\frac{x}{\beta}}

Percent point function/Sample

FX−1(u)=βP−1(α,u)F^{-1}_{X}\left(u\right)=\beta \text{P}^{-1}\left(\alpha,u\right)

Non-central parametric moments

μk′=E[Xk]=∫0∞xkfX(x)dx=βkΓ(k+α)Γ(α)\mu'_{k}=E[X^k]=\int_{0}^{\infty }x^{k}f_{X}\left(x\right)dx=\beta^k\frac{\Gamma(k+\alpha)}{\Gamma(\alpha)}

Parametric mean

Mean(X)=μ1′=αβ\mathrm{Mean}(X)=\mu'_{1}=\alpha \beta

Parametric variance

Variance(X)=μ2′−μ1′2=αβ2\mathrm{Variance}(X)=\mu'_{2}-\mu'^{2}_{1}=\alpha \beta^2

Parametric skewness

Skewness(X)=μ3′−3μ2′μ1′+2μ1′3(μ2′−μ1′2)1.5=2α\mathrm{Skewness}(X)=\frac{\mu'_{3}-3\mu'_{2}\mu'_{1}+2\mu'^{3}_{1}}{(\mu'_{2}-\mu'^{2}_{1})^{1.5}}=\frac{2}{\sqrt{\alpha}}

Parametric kurtosis

Kurtosis(X)=μ4′−4μ1′μ3′+6μ1′2μ2′−3μ1′4(μ2′−μ1′2)2=3+6α\mathrm{Kurtosis}(X)=\frac{\mu'_{4}-4\mu'_{1}\mu'_{3}+6\mu'^{2}_{1}\mu'_{2}-3\mu'^{4}_{1}}{(\mu'_{2}-\mu'^{2}_{1})^{2}}=3+\frac{6}{\alpha}

Parametric median

Median(X)=(α−1)βif α>1\mathrm{Median}(X)=(\alpha-1)\beta \quad \text{if }\alpha>1

Parametric mode

Mode(X)=βP−1(α,12)\mathrm{Mode}(X)=\beta \text{P}^{-1}\left(\alpha,\frac{1}{2}\right)

Additional information and definitions

β:Scale parameter\beta:\text{Scale parameter}
u:Uniform[0,1] random varibleu:\text{Uniform[0,1] random varible}
P(a,x)=γ(a,x)Γ(a):Regularized lower incomplete gamma function\text{P}\left(a,x\right)=\frac{\gamma(a,x)}{\Gamma(a)}:\text{Regularized lower incomplete gamma function}
P−1(a,u):Inverse of regularized lower incomplete gamma function\text{P}^{-1}\left(a,u\right):\text{Inverse of regularized lower incomplete gamma function}
γ(a,x):Lower incomplete gamma function\gamma\left(a,x\right):\text{Lower incomplete gamma function}
Γ(x):Gamma function\Gamma\left(x\right):\text{Gamma function}