AI Glossary / Statistics and probability / Intermediate
Gamma distribution
Definition
The gamma distribution is a family of continuous probability distributions for positive quantities, commonly parameterized by a positive shape and a positive scale or rate. It can represent a range of right-skewed patterns and has important roles in waiting-time models, reliability and Bayesian analysis. With shape alpha and scale theta, its mean is alpha times theta and its variance is alpha times theta squared. A rate parameter is the reciprocal of scale, so naming the convention is essential. Positive, skewed data do not automatically follow a gamma distribution.
What it means
The shape parameter controls the distribution's form, while scale stretches or compresses its horizontal range. Shape one gives the exponential distribution. Positive integer shape gives an Erlang distribution, which can describe the sum of independent exponential waiting times having a common rate. Noninteger shapes remain valid gamma distributions even when that simple count-of-stages interpretation does not apply. As shape increases, relative variability and skewness decrease. The family has support extending indefinitely to the right, so it is unsuitable without modification when a meaningful hard upper bound must be respected.
How it works
For x greater than zero, shape alpha and scale theta give density f(x) = x to the power (alpha - 1) times exp(-x/theta), divided by Gamma(alpha) times theta to the power alpha. Gamma(alpha) is the gamma function that normalizes the density. With rate beta = 1/theta, the same density uses beta to the power alpha and exp(-beta x). Estimate parameters using a suitable method and inspect fit, particularly in the tails relevant to the decision. A location parameter can shift the support in some implementations, but that is an additional modeling choice rather than the ordinary two-parameter positive model.
Three practical examples
- Process modeling: represent a positive duration when a gamma-shaped distribution is supported by the mechanism and data.
- Reliability analysis: explore lifetime variation while comparing gamma with other plausible distributions and handling censoring correctly.
- Bayesian modeling: use a gamma prior for a positive rate or precision parameter when the model and prior assumptions justify that choice.
Think of it this way
Think of adding several independent waiting stages governed by the same exponential rate. The total waiting time becomes less concentrated near zero than a single stage. This is an intuition for integer shapes, not a requirement that every gamma-shaped variable literally consists of countable stages.
Worked example
Suppose a hypothetical duration T follows a gamma distribution with shape two and scale three minutes. Its mean is 2 times 3 = six minutes, and variance is 2 times 3 squared = 18 square minutes. The equivalent rate is one-third per minute. For this integer-shape case, the cumulative probability at t is 1 - exp(-t/3)(1 + t/3). Therefore P(T at most six) = 1 - 3 exp(-2), approximately 0.593994, or 59.40%. Numerical integration of the density x exp(-x/3)/9 from zero to six gives the same result. The probability is not 50% merely because six is the mean; this distribution is skewed. The example uses specified parameters and does not include uncertainty from fitting them to observations.
Illustrative case study
Fictional case: Poplar Process Analytics considers a gamma model for positive task durations. Analysts examine whether zeros are genuine events, recording conventions or errors before fitting the model. They compare predicted tail probabilities with later observations and document whether the software expects a rate or a scale. When the process changes, they revisit the fit. This invented case illustrates disciplined use of a distribution family without claiming that a gamma model is universally suitable for operational times.
Common misconceptions and mistakes
Do not interchange rate and scale while keeping the same numeric value. Do not confuse the gamma distribution with the gamma function, which appears in its density. A basic continuous gamma model assigns no probability mass to exactly zero, even though its density may rise sharply near zero. A substantial mass of observed zeros may require another model or a measurement explanation. Matching the sample mean and variance does not prove a good tail fit. Independent gamma variables add to another gamma with summed shapes when their scales match; this closure does not hold in the same simple form for arbitrary scales.
Business use
Businesses can use gamma models for simulation and uncertainty calculations when their support and shape fit the application. Record the parameter convention, units and any shift, and include parameter uncertainty when it matters. Validate quantiles or exceedance probabilities used for planning rather than relying only on a fitted curve near the center. Handle censoring, truncation and rounding in a way consistent with how data were collected. Compare with alternatives when a plausible mechanism or diagnostic evidence suggests different tails. Distribution choice should support the decision, not follow solely from the observation that values are positive.
People also ask
Is the exponential distribution a gamma distribution?
Yes, with shape one under matching scale or rate.
Is scale the same as rate?
No. They are reciprocals in the standard parameterizations.
Must shape be an integer?
No. Any positive real shape is allowed, though the simple Erlang waiting-stage interpretation uses positive integers.
Check your understanding
A gamma model has shape three and scale two. What are its mean and equivalent rate?
Answer: The mean is six, and the rate is one-half. Substituting rate two instead would define a different distribution.
Related terms
- Gamma function ( G )
- Conjugate prior
- Gamma function
- exponential distribution
- Erlang distribution
- shape parameter
- scale parameter
- rate parameter
- waiting time
- positive skewness
Learn next
Learn to translate between shape-scale and shape-rate conventions. Then study parameter estimation, tail-fit diagnostics and the conditions under which sums of waiting times have gamma distributions.
More in Statistics and probability
- Functional regression - Functional regression models relationships in which an outcome, a predictor or both are functions, such as curves observed over time, wavelength or space.
- Fuzzy c-means - Fuzzy c-means is a clustering algorithm that assigns each observation a degree of membership in each of a chosen number of clusters.
- G-prior - A g-prior, commonly called Zellner's g-prior, is a Bayesian prior for regression coefficients in a normal linear model whose covariance is proportional to...
- Gaussian error model - A Gaussian error model assumes that the difference between an observed response and its modeled mean follows a normal distribution under specified conditions.
- Gaussian mixture model - A Gaussian mixture model, or GMM, represents a probability distribution as a weighted sum of Gaussian component distributions.
- Gaussian Naive Bayes - Gaussian Naive Bayes is a classification method that combines Bayes' rule with a Gaussian model for each numerical feature within each class and a...
Sources
SciPy, gamma distribution reference: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.gamma.html NIST/SEMATECH, Gamma Distribution: https://www.itl.nist.gov/div898/handbook/eda/section3/eda366b.htm NIST/SEMATECH, Gamma reliability model and moments: https://itl.nist.gov/div898/handbook/apr/section1/apr165.htm
Previous: Gamma correction Next: Gamma encoding