Gamma Distribution Explained with Worked Examples

The gamma distribution with shape and rate has density for , mean and variance .

Write 2x or 2*x to multiply, ^ for powers, and ; between simultaneous equations. You can also type factor, expand, derivative of, integrate … from a to b, limit … as x->0 or 15% of 80.

Try an example

Before you start

This page is easier if you are comfortable with:

What Gamma distribution means

With , : mean , variance , and the density at is (the gamma function, ). For integer the distribution (Erlang) is the waiting time for the th event of a Poisson process, the sum of independent exponentials (the exponential distribution, the Poisson process).

Its cumulative distribution for integer is , so , linking it to Poisson probabilities. The special case is the exponential distribution and , is the chi-squared distribution (chi-squared degrees of freedom).

The gamma density is the conjugate prior for the rate of a Poisson or exponential likelihood in Bayesian statistics (posterior ∝ likelihood × prior). Its MGF is (the moment generating function), so sums of independent gammas with the same rate are gamma.

What is it used for?

The gamma distribution models waiting times and positive, skewed quantities.

How to use gamma distribution

  1. Identify and .
  2. Mean , variance .
  3. Evaluate the density with .
  4. For integer use the Poisson-sum form of the CDF.

Graph

Gamma density with shape 3 and rate 2f(1) = 0.5413mean 1.500.511.522.533.544.5500.10.20.30.40.50.60.7Gamma density with shape 3 and rate 2xdensityf(x) = 4x²e^(−2x)Graph with x from 0 to 5 and y from 0 to 0.75. Shows the curve f(x) = 4x²e^(−2x); point f(1) = 0.5413 at (1, 0.5413); point mean 1.5 at (1.5, 0.4481).

The density rises from zero, peaks at x = 1, and has a long right tail.

Worked examples

These examples are worked by hand, step by step, so you can compare your own working.

Example 1: mean and variance

Find the mean and variance for , .

Worked example
Answer
1.5, 0.751.5,\ 0.75
  1. Mean
  2. Variance

Example 2: density at 1

Find for , .

Worked example
Answer
0.54130.5413
  1. Formula

Example 3: P(X < 1)

Find for , .

Worked example
Answer
0.32330.3233
  1. Formula

Special cases

A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.

α = 3, λ = 2

mean α/λ = 1.5

Variance α/λ² = 0.75.

Density at x = 1

λ^α x^(α−1) e^(−λx)/Γ(α)

4e⁻² = 0.5413.

Standard deviation

√0.75

0.8660.

α = 1

exponential distribution

Mean 1/λ.

Word problems

Gamma(α, λ) has density λ^α x^(α−1) e^(−λx)/Γ(α), mean α/λ, variance α/λ². With α = 1 it is the exponential distribution; sums of exponentials are gamma.

Mean

Find the mean for α = 3, λ = 2.

  1. 3/2
  2. Check: ✓1.5

Variance

Find the variance.

  1. 3/4
  2. Check: ✓0.75

Density Higher

Find f(1) for α = 3, λ = 2 (Γ(3) = 2).

  1. 8 × 1 × e⁻² ÷ 2
  2. Check: ✓0.5413

Special case Higher

Find the mean when α = 1, λ = 2.

  1. 1/2
  2. Check: ✓0.5

Common mistakes

Rate vs scale

mean αλ ✗

mean α/λ ✓

Rate parameterisation.

Γ(α) = α!

Γ(3) = 6 ✗

Γ(3) = 2! = 2 ✓

Γ(n) = (n − 1)!.

Variance α/λ

wrong ✗

α/λ² ✓

Square the rate.

x ≤ 0

allowed ✗

x > 0 ✓

Support.

Exam tips

  1. Mean α/λ.
  2. Variance α/λ².
  3. Γ(n) = (n − 1)!.
  4. α = 1: exponential.
  5. Sum of independent exponentials.

Practice questions

Try each one on paper, then open the answer. Use the solver above to see the full working.

1. Mean α = 5, λ = 2 Foundation

2.5

2. Variance α = 5, λ = 2 Foundation

1.25

3. Mean α = 2, λ = 0.5 Foundation

4

4. Variance α = 2, λ = 0.5 Higher

8

5. Density α = 2, λ = 1 at x = 1 to 4 d.p. Higher

0.3679

6. SD α = 4, λ = 2 Higher

1

Practice generator

Unlimited fresh questions with instant marking. Choose a level, work it out on paper, then type your answer.

Solve: …

Key terms

Gamma distribution
Shape α, rate λ.
Shape (α)
Controls skew.
Rate (λ)
Inverse scale.
Gamma function
Γ(α).
Exponential
α = 1.
Erlang
Integer α.

Frequently asked questions

What is the gamma distribution?

A flexible positive distribution with shape α and rate λ.

What are its mean and variance?

α/λ and α/λ².

How is it related to the exponential?

α = 1 gives the exponential.

What is Γ(3)?

2.

Which page covers the gamma function?

gamma function.

Which page covers the beta distribution?

beta distribution.

More in Advanced statistics and stochastic processes and the formula sheets.