Gamma distribution
In probability theory and statistics,[] the gamma distribution is a versatile 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 a rate parameter
The distribution has important applications in various fields, including econometrics, Bayesian statistics, and life testing. In econometrics, the parameterization is common for modeling waiting times, such as the time until death, where it often takes the form of an Erlang distribution for integer α values. Bayesian statisticians prefer the parameterization, utilizing the gamma distribution as a conjugate prior for several inverse scale parameters, facilitating analytical tractability in posterior distribution computations.
The gamma distribution is the maximum entropy probability distribution for a random variable for which is fixed and greater than zero, and is fixed.
Definitions
The parameterization with 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.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 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.
If is a positive integer, then the distribution represents an Erlang distribution; i.e., the sum of 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 and an inverse scale parameter, called a rate parameter. A random variable that is gamma-distributed with shape and rate is denotedThe 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, the cumulative distribution function has the following series expansion:
Characterization using shape ''α'' and scale ''θ''
A random variable that is gamma-distributed with shape and scale is denoted byImage:Gamma-PDF-3D.png|thumb|right|320px|Illustration of the gamma PDF for parameter values over and with set to and . One can see each layer by itself here as well as by and . .
The probability density function using the shape-scale parametrization is
Here is the gamma function evaluated at.
The cumulative distribution function is the regularized gamma function:
where is the lower incomplete gamma function.
It can also be expressed as follows, if is a positive integer :
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,, and it is equal toHigher moments
The -th raw moment is given by:with the rising factorial.
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 thatA 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
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.
Berg and Pedersen also proved many properties of the median, showing that it is a convex function of, and that the asymptotic behavior near is , and that for all the median is bounded by.
A closer linear upper bound, for only, was provided in 2021 by Gaunt and Merkle, relying on the Berg and Pedersen result that the slope of is everywhere less than 1:
for
which can be extended to a bound for all by taking the max with the chord shown in the figure, since the median was proved convex.
An approximation to the median that is asymptotically accurate at high and reasonable down to or a bit lower follows from the Wilson–Hilferty transformation:
which goes negative for.
In 2021, Lyon proposed several approximations of the form. He conjectured values of and for which this approximation is an asymptotically tight upper or lower bound for all. In particular, he proposed these closed-form bounds, which he proved in 2023:
is a lower bound, asymptotically tight as
is an upper bound, asymptotically tight as
Lyon also showed two other lower bounds that are not closed-form expressions, including this one involving the gamma function, based on solving the integral expression substituting 1 for :
and the tangent line at where the derivative was found to be :
where Ei is the exponential integral.
Additionally, he showed that interpolations between bounds could provide excellent approximations or tighter bounds to the median, including an approximation that is exact at and has a maximum relative error less than 0.6%. Interpolated approximations and bounds are all of the form
where is an interpolating function running monotonially from 0 at low to 1 at high, approximating an ideal, or exact, interpolator :
For the simplest interpolating function considered, a first-order rational function
the tightest lower bound has
and the tightest upper bound has
The interpolated bounds are plotted in the log–log plot shown. Even tighter bounds are available using different interpolating functions, but not usually with closed-form parameters like these.
Summation
If has a distribution for , thenprovided all are independent.
For the cases where the are independent but have different scale parameters, see Mathai or Moschopoulos.
The gamma distribution exhibits infinite divisibility.
Scaling
Ifthen, for any,
by moment generating functions,
or equivalently, if
Indeed, we know that if is an exponential r.v. with rate, then is an exponential r.v. with rate ; the same thing is valid with Gamma variates : multiplication by a positive constant divides the rate.
Exponential family
The gamma distribution is a two-parameter exponential family with natural parameters and , and natural statistics and.If the shape parameter is held fixed, the resulting one-parameter family of distributions is a natural exponential family.
Logarithmic expectation and variance
One can show thator equivalently,
where is the digamma function. Likewise,
where is the trigamma function.
This can be derived using the exponential family formula for the moment generating function of the sufficient statistic, because one of the sufficient statistics of the gamma distribution is.
Information entropy
The information entropy isIn the, parameterization, the information entropy is given by
Kullback–Leibler divergence
The Kullback–Leibler divergence, of from is given byWritten using the, parameterization, the KL-divergence of from is given by
Laplace transform
The Laplace transform of the gamma PDF, which is the moment-generating function of the gamma distribution, is.
Related distributions
General
- Let be independent and identically distributed random variables following an exponential distribution with rate parameter λ, then where n is the shape parameter and is the rate, and.
- If , then has an exponential distribution with rate parameter. In the shape-scale parametrization, has an exponential distribution with rate parameter.
- If , then is identical to, the chi-squared distribution with degrees of freedom. Conversely, if and is a positive constant, then.
- If, one obtains the Schulz-Zimm distribution, which is most prominently used to model polymer chain lengths.
- If is an integer, the gamma distribution is an Erlang distribution and is the probability distribution of the waiting time until the -th "arrival" in a one-dimensional Poisson process with intensity. If
- If has a Maxwell–Boltzmann distribution with parameter, then
- If, then follows a log-gamma distribution.
- If, then follows an exponential-gamma distribution. It is sometimes incorrectly referred to as the log-gamma distribution. Formulas for its mean and variance are in the section #Logarithmic expectation and variance.
- If, then follows a generalized gamma distribution with parameters,, and.
- More generally, if, then for follows a generalized gamma distribution with parameters,, and.
- If with shape and scale, then .
- Parametrization 1: If are independent, then, or equivalently,
- Parametrization 2: If are independent, then, or equivalently,
- If and are independently distributed, then has a beta distribution with parameters and, and is independent of, which is -distributed.
- If and, then converges in distribution to defined under parametrization 2.
- If are independently distributed, then the vector.
- The gamma distribution is a special case of the generalized gamma distribution, the generalized integer gamma distribution, and the generalized inverse Gaussian distribution.
- Among the discrete distributions, the negative binomial distribution is sometimes considered the discrete analog of the gamma distribution.
- Tweedie distributions – the gamma distribution is a member of the family of Tweedie exponential dispersion models.
- Modified Half-normal distribution – the Gamma distribution is a member of the family of Modified half-normal distribution. The corresponding density is, where denotes the Fox–Wright Psi function.
- For the shape-scale parameterization, if the scale parameter where denotes the Inverse-gamma distribution, then the marginal distribution where denotes the Beta prime distribution.