Gamma

X∼Γ(k,θ)X \sim \Gamma(k, \theta)

A flexible family of positive, right-skewed distributions. With whole-number shape k, it is the total waiting time for k events in a Poisson process.

The story

One Exponential wait is the time until the next event; add up kk independent Exponential waits, each with mean θ\theta, and you get the time until the kk-th event. That sum is Gamma(k,θ)\text{Gamma}(k, \theta). The definition extends smoothly to non-integer kk, which makes the Gamma a general-purpose model for positive, skewed quantities.

The mean is kθk\theta and the variance is kθ2k\theta^2. The shape kk controls the form: below 1 the density shoots up towards infinity at zero, at exactly 1 it is the Exponential, and above 1 it rises to a peak at (k−1)θ(k - 1)\theta before tailing off. As kk grows, the skew fades and the curve looks more and more Normal. The scale θ\theta simply stretches the horizontal axis.

Formulas

Support

x>0x > 0

PDF

f(x)=xk−1e−x/θΓ(k) θkf(x) = \frac{x^{k-1} e^{-x/\theta}}{\Gamma(k)\, \theta^k}

CDF

F(x)=γ(k, x/θ)Γ(k)F(x) = \frac{\gamma(k,\, x/\theta)}{\Gamma(k)}

Expectation

E[X]=kθ\mathbb{E}[X] = k\theta

Variance

Var⁡(X)=kθ2\operatorname{Var}(X) = k\theta^2

Mode

(k−1)θfor k≥1(k - 1)\theta \quad \text{for } k \ge 1

Parameters

ParameterWhat it controls
kkThe shape: roughly, how many Exponential waits are being added up. Larger kk means a less skewed, more bell-like curve.
θ\thetaThe scale: the mean of each underlying Exponential wait. Doubling θ\theta doubles the mean and quadruples the variance.

Where it shows up

  • The total time to serve the next three customers in a queue.
  • Monthly rainfall totals, which are positive and right-skewed.
  • Insurance claim sizes.
  • A prior for a Poisson rate or a Normal precision in Bayesian statistics.

Try this

  1. Fix θ=1\theta = 1 and sweep kk from 0.5 to 10. Watch the curve go from a spike at zero, through the Exponential at k=1k = 1, to an almost symmetric hump with its mode at k−1k - 1.
  2. Set k=1.5k = 1.5 and θ=2\theta = 2, then open the Chi-squared page with k=3k = 3. The two curves are the same, because Chi-squared(3) is Gamma(3/2,2)\text{Gamma}(3/2, 2).
  3. Choose k=2k = 2, θ=1.5\theta = 1.5, press Draw 1000 and check the sample mean against kθ=3k\theta = 3 and the sample variance against kθ2=4.5k\theta^2 = 4.5.

Related distributions

  • The Exponential with rate λ\lambda is Gamma with k=1k = 1 and θ=1/λ\theta = 1/\lambda.
  • Chi-squared with kk degrees of freedom is Gamma(k/2,2)\text{Gamma}(k/2, 2).
  • Independent Gammas with the same θ\theta add: Gamma(k1,θ)+Gamma(k2,θ)\text{Gamma}(k_1, \theta) + \text{Gamma}(k_2, \theta) is Gamma(k1+k2,θ)\text{Gamma}(k_1 + k_2, \theta).
  • For large kk it is approximately Normal with mean kθk\theta and variance kθ2k\theta^2.