Factsheet: Gamma distribution
Where to use: The gamma distribution generalizes the exponential distribution, allowing for greater or lesser variance. It is used to model positive continuous random variables that have skewed distributions.
Notation: \(X \sim \textrm{Gamma}(\alpha,\theta)\) or \(X \sim \textrm{Gam}(\alpha,\theta)\)
Parameters: Two real numbers \(\alpha\) and \(\theta\), which are related to the mean \(\mu\) and variance \(\sigma^2\):
- \(\alpha = \frac{\mu^2}{\sigma^2}\) (shape parameter)
- \(\theta=\frac{\sigma^2}{\mu}\) (scale parameter)
| Quantity | Value | Notes |
|---|---|---|
| Mean | \(\mathbb{E}(X) = \alpha\theta\) | |
| Variance | \(\mathbb{V}(X) = \alpha\theta^2\) | |
| \(\mathbb{P}(X=x)=\dfrac{x^{\alpha-1}\exp\left(-\frac{x}{\theta}\right)}{\Gamma(\alpha)\theta^{\alpha}}\) | \(\Gamma(x)\) the gamma function of \(x\) | |
| CDF | \(\mathbb{P}(X \leq x)=\dfrac{\textrm{Gam}\left(\alpha,\frac{x}{\theta}\right)}{\Gamma(\alpha)}\) | \(\textrm{Gam}(\alpha,\theta)\) is the PDF of the gamma distribution |
Example: You collect historical data on the time to failure of a machine from Cantor’s Confectionery. The mean is 83 days and the variance is 50.3. You can then use this to estimate the shape and scale parameters of the gamma distribution:
\(\alpha = \frac{83^2}{50.3} = 136.958250497 \approx 137\)
\(\theta = \frac{50.3}{83} = 0.60602409638 \approx 0.61\)
The distribution can be expressed as \(X \sim \textrm{Gam}(137,0.61)\), where the shape parameter is 137 and the scale parameter is 0.61.
Further reading
Version history
v1.0: initial version created 04/25 by tdhc and Michelle Arnetta as part of a University of St Andrews VIP project.
v1.1: moved to factsheet form and populated with material from Overview: Probability distributions by tdhc.
v1.2: deprecated shinylive apps replaced 09/26 by tdhc.