In probability theory and statistics, the gamma distribution is a two-parameter family of continuous probability distributions. The exponential distribution, Erlang distribution, and chi-squared distribution are special cases of the gamma distribution. There are two equivalent parameterizations in common use: With a shape parameter and a scale parameter . With a shape parameter and an inverse scale parameter , called a rate parameter. In each of these forms, both parameters are positive real numbers.

The gamma distribution is the maximum entropy probability distribution (both with respect to a uniform base measure and a base measure) for a random variable for which E[X] = kθ = α/β is fixed and greater than zero, and E[ln(X)] = ψ(k) + ln(θ) = ψ(α) − ln(β) is fixed (ψ is the digamma function).

Gamma distribution

Definitions

The parameterization with k and θ appears to be more common in econometrics and other applied fields, where the gamma distribution is frequently used to model waiting times. For instance, in life testing, the waiting time until death is a random variable that is frequently modeled with a gamma distribution. See Hogg and Craig for an explicit motivation.

Gamma distribution

The parameterization with and is more common in Bayesian statistics, where the gamma distribution is used as a conjugate prior distribution for various types of inverse scale (rate) parameters, such as the λ of an exponential distribution or a Poisson distribution – or for that matter, the β of the gamma distribution itself. The closely related inverse-gamma distribution is used as a conjugate prior for scale parameters, such as the variance of a normal distribution.

Gamma distribution

If k is a positive integer, then the distribution represents an Erlang distribution; i.e., the sum of k independent exponentially distributed random variables, each of which has a mean of θ.

Characterization using shape α and rate β

The gamma distribution can be parameterized in terms of a shape parameter α = k and an inverse scale parameter β = 1/θ, called a rate parameter. A random variable X that is gamma-distributed with shape α and rate β is denoted

The corresponding probability density function in the shape-rate parameterization is

where is the gamma function. For all positive integers, .

The cumulative distribution function is the regularized gamma function:

where is the lower incomplete gamma function.

If α is a positive integer (i.e., the distribution is an Erlang distribution), the cumulative distribution function has the following series expansion:

Characterization using shape k and scale θ

A random variable X that is gamma-distributed with shape k and scale θ is denoted by

The probability density function using the shape-scale parametrization is

Here Γ(k) is the gamma function evaluated at k.

The cumulative distribution function is the regularized gamma function:

where is the lower incomplete gamma function.

It can also be expressed as follows, if k is a positive integer (i.e., the distribution is an Erlang distribution):

Both parametrizations are common because either can be more convenient depending on the situation.

Properties

Mean and variance

The mean of gamma distribution is given by the product of its shape and scale parameters:

The variance is:

The square root of the inverse shape parameter gives the coefficient of variation:

Skewness

The skewness of the gamma distribution only depends on its shape parameter, k, and it is equal to

Higher moments

The nth raw moment is given by:

Median approximations and bounds

Unlike the mode and the mean, which have readily calculable formulas based on the parameters, the median does not have a closed-form equation. The median for this distribution is the value such that

A rigorous treatment of the problem of determining an asymptotic expansion and bounds for the median of the gamma distribution was handled first by Chen and Rubin, who proved that (for )

where is the mean and is the median of the distribution. For other values of the scale parameter, the mean scales to , and the median bounds and approximations would be similarly scaled by .

K. P. Choi found the first five terms in a Laurent series asymptotic approximation of the median by comparing the median to Ramanujan's function. Berg and Pedersen found more terms:

Partial sums of these series are good approximations for high enough ; they are not plotted in the figure, which is focused on the low- region that is less well approximated.