Recent from talks
Nothing was collected or created yet.
Gamma distribution
View on Wikipedia| Gamma | |||
|---|---|---|---|
|
Probability density function | |||
|
Cumulative distribution function | |||
| Parameters | |||
| Support | |||
| CDF | |||
| Mean | |||
| Median | Simple closed form does not exist | Simple closed form does not exist | |
| Mode | , | ||
| Variance | |||
| Skewness | |||
| Excess kurtosis | |||
| Entropy | |||
| MGF | |||
| CF | |||
| Fisher information | |||
| Method of moments | |||
In probability theory and statistics, the gamma distribution is a versatile two-parameter family of continuous probability distributions.[1] The exponential distribution, Erlang distribution, and chi-squared distribution are special cases of the gamma distribution.[2] There are two equivalent parameterizations in common use:
- With a shape parameter α and a scale parameter θ
- With a shape parameter and a rate parameter
In each of these forms, both parameters are positive real numbers.
The distribution has important applications in various fields, including econometrics, Bayesian statistics, and life testing.[3] 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 probability density and cumulative distribution functions of the gamma distribution vary based on the chosen parameterization, both offering insights into the behavior of gamma-distributed random variables. The gamma distribution is integral to modeling a range of phenomena due to its flexible shape, which can capture various statistical distributions, including the exponential and chi-squared distributions under specific conditions. Its mathematical properties, such as mean, variance, skewness, and higher moments, provide a toolset for statistical analysis and inference. Practical applications of the distribution span several disciplines, underscoring its importance in theoretical and applied statistics.[4]
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 X for which E[X] = αθ = α/λ is fixed and greater than zero, and E[ln X] = ψ(α) + ln θ = ψ(α) − ln λ is fixed (ψ is the digamma function).[5]
Definitions
[edit]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[6] 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 (rate) parameters, such as the λ of an exponential distribution or a Poisson distribution[7] – 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 λ
[edit]The gamma distribution can be parameterized in terms of a shape parameter α 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:[8]
Characterization using shape α and scale θ
[edit]A random variable X that is gamma-distributed with shape α and scale θ is denoted by

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 (i.e., the distribution is an Erlang distribution):[8]
Both parametrizations are common because either can be more convenient depending on the situation.
Properties
[edit]Mean and variance
[edit]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
[edit]The skewness of the gamma distribution only depends on its shape parameter, α, and it is equal to
Higher moments
[edit]The r-th raw moment is given by:
with the rising factorial.
Median approximations and bounds
[edit]
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.[9] 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.[10] Berg and Pedersen found more terms:[11]


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 α,[12] and that the asymptotic behavior near is (where γ is the Euler–Mascheroni constant), and that for all the median is bounded by .[11]
A closer linear upper bound, for only, was provided in 2021 by Gaunt and Merkle,[13] relying on the Berg and Pedersen result that the slope of is everywhere less than 1: for (with equality at ) 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.[12]
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 A and B for which this approximation is an asymptotically tight upper or lower bound for all .[14] In particular, he proposed these closed-form bounds, which he proved in 2023:[15]
is a lower bound, asymptotically tight as is an upper bound, asymptotically tight as
Lyon also showed (informally in 2021, rigorously in 2023) 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 : (approaching equality as ) and the tangent line at where the derivative was found to be : (with equality at ) where Ei is the exponential integral.[14][15]
Additionally, he showed that interpolations between bounds could provide excellent approximations or tighter bounds to the median, including an approximation that is exact at (where ) 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 (mostly inside the yellow region) in the log–log plot shown. Even tighter bounds are available using different interpolating functions, but not usually with closed-form parameters like these.[14]
Summation
[edit]If Xi has a Gamma(αi, θ) distribution for i = 1, 2, ..., N (i.e., all distributions have the same scale parameter θ), then
provided all Xi are independent.
For the cases where the Xi are independent but have different scale parameters, see Mathai [16] or Moschopoulos.[17]
The gamma distribution exhibits infinite divisibility.
Scaling
[edit]If
then, for any c > 0,
by moment generating functions,
or equivalently, if
(shape-rate parameterization)
Indeed, we know that if X is an exponential r.v. with rate λ, then cX is an exponential r.v. with rate λ/c; the same thing is valid with Gamma variates (and this can be checked using the moment-generating function, see, e.g.,these notes, 10.4-(ii)): multiplication by a positive constant c divides the rate (or, equivalently, multiplies the scale).
Exponential family
[edit]The gamma distribution is a two-parameter exponential family with natural parameters α − 1 and −1/θ (equivalently, α − 1 and −λ), and natural statistics X and ln X.
If the shape parameter α is held fixed, the resulting one-parameter family of distributions is a natural exponential family.
Logarithmic expectation and variance
[edit]One can show that
or 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 ln x.
Information entropy
[edit]The information entropy is
In the α, θ parameterization, the information entropy is given by
Kullback–Leibler divergence
[edit]
The Kullback–Leibler divergence (KL-divergence), of Gamma(αp, λp) ("true" distribution) from Gamma(αq, λq) ("approximating" distribution) is given by[18]
Written using the α, θ parameterization, the KL-divergence of Gamma(αp, θp) from Gamma(αq, θq) is given by
Laplace transform
[edit]The Laplace transform of the gamma PDF, which is the moment-generating function of the gamma distribution, is
(where is a random variable with that distribution).
Related distributions
[edit]General
[edit]- 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 X ~ Gamma(1, λ) (in the shape–rate parametrization), then X has an exponential distribution with rate parameter λ. In the shape-scale parametrization, X ~ Gamma(1, θ) has an exponential distribution with rate parameter 1/θ.
- If X ~ Gamma(ν/2, 2) (in the shape–scale parametrization), then X is identical to χ2(ν), the chi-squared distribution with ν degrees of freedom. Conversely, if Q ~ χ2(ν) and c is a positive constant, then cQ ~ Gamma(ν/2, 2c).
- If θ = 1/α, 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 1/θ. If
- then
- If X has a Maxwell–Boltzmann distribution with parameter a, then
- If X ~ Gamma(α, θ), then follows a log-gamma distribution.[19]
- If X ~ Gamma(α, θ), then follows an exponential-gamma (abbreviated exp-gamma) distribution.[20] It is sometimes incorrectly referred to as the log-gamma distribution.[21] Formulas for its mean and variance are in the section #Logarithmic expectation and variance.
- If X ~ Gamma(α, θ), then follows a generalized gamma distribution with parameters p = 2, d = 2α, and .[citation needed]
- More generally, if X ~ Gamma(α,θ), then for follows a generalized gamma distribution with parameters p = 1/q, d = α/q, and .
- If X ~ Gamma(α, θ) with shape α and scale θ, then 1/X ~ Inv-Gamma(α, θ−1) (see Inverse-gamma distribution for derivation).
- Parametrization 1: If are independent, then , or equivalently,
- Parametrization 2: If are independent, then , or equivalently,
- If X ~ Gamma(α, θ) and Y ~ Gamma(λ, θ) are independently distributed, then X/(X + Y) has a beta distribution with parameters α and λ, and X/(X + Y) is independent of X + Y, which is Gamma(α + λ, θ)-distributed.
- If and , then converges in distribution to defined under parametrization 2.
- If Xi ~ Gamma(αi, 1) are independently distributed, then the vector (X1/S, ..., Xn/S), where S = X1 + ... + Xn, follows a Dirichlet distribution with parameters α1, ..., αn.
- For large α the gamma distribution converges to normal distribution with mean μ = αθ and variance σ2 = αθ2.
- The gamma distribution is the conjugate prior for the precision of the normal distribution with known mean.
- The matrix gamma distribution and the Wishart distribution are multivariate generalizations of the gamma distribution (samples are positive-definite matrices rather than positive real numbers).
- 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.[22] 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.
Compound gamma
[edit]If the shape parameter of the gamma distribution is known, but the inverse-scale parameter is unknown, then a gamma distribution for the inverse scale forms a conjugate prior. The compound distribution, which results from integrating out the inverse scale, has a closed-form solution known as the compound gamma distribution.[23]
If, instead, the shape parameter is known but the mean is unknown, with the prior of the mean being given by another gamma distribution, then it results in K-distribution.
Statistical inference
[edit]Parameter estimation
[edit]Maximum likelihood estimation
[edit]The likelihood function for N iid observations (x1, ..., xN) is
from which we calculate the log-likelihood function
Finding the maximum with respect to θ by taking the derivative and setting it equal to zero yields the maximum likelihood estimator of the θ parameter, which equals the sample mean divided by the shape parameter α:
Substituting this into the log-likelihood function gives
We need at least two samples: , because for , the function increases without bounds as . For , it can be verified that is strictly concave, by using inequality properties of the polygamma function. Finding the maximum with respect to α by taking the derivative and setting it equal to zero yields
where ψ is the digamma function and is the sample mean of ln x. There is no closed-form solution for α. The function is numerically very well behaved, so if a numerical solution is desired, it can be found using, for example, Newton's method. An initial value of k can be found either using the method of moments, or using the approximation
If we let
then α is approximately
which is within 1.5% of the correct value.[24] An explicit form for the Newton–Raphson update of this initial guess is:[25]
At the maximum-likelihood estimate , the expected values for x and agree with the empirical averages:
Caveat for small shape parameter
[edit]For data, , that is represented in a floating point format that underflows to 0 for values smaller than , the logarithms that are needed for the maximum-likelihood estimate will cause failure if there are any underflows. If we assume the data was generated by a gamma distribution with cdf , then the probability that there is at least one underflow is: This probability will approach 1 for small α and large N. For example, at , and , . A workaround is to instead have the data in logarithmic format.
In order to test an implementation of a maximum-likelihood estimator that takes logarithmic data as input, it is useful to be able to generate non-underflowing logarithms of random gamma variates, when . Following the implementation in scipy.stats.loggamma, this can be done as follows:[26] sample and independently. Then the required logarithmic sample is , so that .
Closed-form estimators
[edit]There exist consistent closed-form estimators of α and θ that are derived from the likelihood of the generalized gamma distribution.[27]
The estimate for the shape α is
and the estimate for the scale θ is
Using the sample mean of x, the sample mean of ln x, and the sample mean of the product x·ln x simplifies the expressions to:
If the rate parameterization is used, the estimate of .
These estimators are not strictly maximum likelihood estimators, but are instead referred to as mixed type log-moment estimators. They have however similar efficiency as the maximum likelihood estimators.
Although these estimators are consistent, they have a small bias. A bias-corrected variant of the estimator for the scale θ is
A bias correction for the shape parameter α is given as[28]
Bayesian minimum mean squared error
[edit]With known α and unknown θ, the posterior density function for theta (using the standard scale-invariant prior for θ) is
Denoting
where the C (integration) constant does not depend on θ. The form of the posterior density reveals that 1 / θ is gamma-distributed with shape parameter Nα + 2 and rate parameter y. Integration with respect to θ can be carried out using a change of variables to find the integration constant
The moments can be computed by taking the ratio (m by m = 0)
which shows that the mean ± standard deviation estimate of the posterior distribution for θ is
Bayesian inference
[edit]Conjugate prior
[edit]In Bayesian inference, the gamma distribution is the conjugate prior to many likelihood distributions: the Poisson, exponential, normal (with known mean), Pareto, gamma with known shape σ, inverse gamma with known shape parameter, and Gompertz with known scale parameter.
The gamma distribution's conjugate prior is:[29]
where Z is the normalizing constant with no closed-form solution. The posterior distribution can be found by updating the parameters as follows:
where n is the number of observations, and xi is the i-th observation from the gamma distribution.
Occurrence and applications
[edit]Consider a sequence of events, with the waiting time for each event being an exponential distribution with rate λ. Then the waiting time for the n-th event to occur is the gamma distribution with integer shape . This construction of the gamma distribution allows it to model a wide variety of phenomena where several sub-events, each taking time with exponential distribution, must happen in sequence for a major event to occur.[30] Examples include the waiting time of cell-division events,[31] number of compensatory mutations for a given mutation,[32] waiting time until a repair is necessary for a hydraulic system,[33] and so on.
In biophysics, the dwell time between steps of a molecular motor like ATP synthase is nearly exponential at constant ATP concentration, revealing that each step of the motor takes a single ATP hydrolysis. If there were n ATP hydrolysis events, then it would be a gamma distribution with degree n.[34]
The gamma distribution has been used to model the size of insurance claims[35] and rainfalls.[36] This means that aggregate insurance claims and the amount of rainfall accumulated in a reservoir are modelled by a gamma process – much like the exponential distribution generates a Poisson process.
The gamma distribution is also used to model errors in multi-level Poisson regression models because a mixture of Poisson distributions with gamma-distributed rates has a known closed form distribution, called negative binomial.
In wireless communication, the gamma distribution is used to model the multi-path fading of signal power;[citation needed] see also Rayleigh distribution and Rician distribution.
In oncology, the age distribution of cancer incidence often follows the gamma distribution, wherein the shape and scale parameters predict, respectively, the number of driver events and the time interval between them.[37][38]
In neuroscience, the gamma distribution is often used to describe the distribution of inter-spike intervals.[39][40]
In bacterial gene expression where protein production can occur in bursts, the copy number of a given protein often follows the gamma distribution, where the shape and scale parameters are, respectively, the mean number of bursts per cell cycle and the mean number of protein molecules produced per burst.[41]
In genomics, the gamma distribution was applied in peak calling step (i.e., in recognition of signal) in ChIP-chip[42] and ChIP-seq[43] data analysis.
In Bayesian statistics, the gamma distribution is widely used as a conjugate prior. It is the conjugate prior for the precision (i.e. inverse of the variance) of a normal distribution. It is also the conjugate prior for the exponential distribution.
In phylogenetics, the gamma distribution is the most commonly used approach to model among-sites rate variation[44] when maximum likelihood, Bayesian, or distance matrix methods are used to estimate phylogenetic trees. Phylogenetic analyzes that use the gamma distribution to model rate variation estimate a single parameter from the data because they limit consideration to distributions where α = λ. This parameterization means that the mean of this distribution is 1 and the variance is 1/α. Maximum likelihood and Bayesian methods typically use a discrete approximation to the continuous gamma distribution.[45][46]
Random variate generation
[edit]Given the scaling property above, it is enough to generate gamma variables with θ = 1, as we can later convert to any value of λ with a simple division.
Suppose we wish to generate random variables from Gamma(n + δ, 1), where n is a non-negative integer and 0 < δ < 1. Using the fact that a Gamma(1, 1) distribution is the same as an Exp(1) distribution, and noting the method of generating exponential variables, we conclude that if U is uniformly distributed on (0, 1], then −ln U is distributed Gamma(1, 1) (i.e. inverse transform sampling). Now, using the "α-addition" property of gamma distribution, we expand this result:
where Uk are all uniformly distributed on (0, 1] and independent. All that is left now is to generate a variable distributed as Gamma(δ, 1) for 0 < δ < 1 and apply the "α-addition" property once more. This is the most difficult part.
Random generation of gamma variates is discussed in detail by Devroye,[47]: 401–428 noting that none are uniformly fast for all shape parameters. For small values of the shape parameter, the algorithms are often not valid.[47]: 406 For arbitrary values of the shape parameter, one can apply the Ahrens and Dieter[48] modified acceptance-rejection method Algorithm GD (shape α ≥ 1), or transformation method[49] when 0 < α < 1. Also see Cheng and Feast Algorithm GKM 3[50] or Marsaglia's squeeze method.[51]
The following is a version of the Ahrens-Dieter acceptance–rejection method:[48]
- Generate U, V and W as iid uniform (0, 1] variates.
- If then and . Otherwise, and .
- If then go to step 1.
- ξ is distributed as Γ(δ, 1).
A summary of this is where is the integer part of α, ξ is generated via the algorithm above with δ = {α} (the fractional part of α) and the Uk are all independent.
While the above approach is technically correct, Devroye notes that it is linear in the value of α and generally is not a good choice. Instead, he recommends using either rejection-based or table-based methods, depending on context.[47]: 401–428
For example, Marsaglia's simple transformation-rejection method relying on one normal variate X and one uniform variate U:[26]
- Set and .
- Set .
- If and return , else go back to step 2.
With generates a gamma distributed random number in time that is approximately constant with α. The acceptance rate does depend on α, with an acceptance rate of 0.95, 0.98, and 0.99 for α = 1, 2, and 4. For α < 1, one can use to boost k to be usable with this method.
In Matlab numbers can be generated using the function gamrnd(), which uses the α, θ representation.
References
[edit]- ^ "Gamma distribution | Probability, Statistics, Distribution | Britannica". www.britannica.com. Archived from the original on 2024-05-19. Retrieved 2024-10-09.
- ^ Weisstein, Eric W. "Gamma Distribution". mathworld.wolfram.com. Archived from the original on 2024-05-28. Retrieved 2024-10-09.
- ^ "Gamma Distribution | Gamma Function | Properties | PDF". www.probabilitycourse.com. Archived from the original on 2024-06-13. Retrieved 2024-10-09.
- ^ "4.5: Exponential and Gamma Distributions". Statistics LibreTexts. 2019-03-11. Retrieved 2024-10-10.
- ^ Park, Sung Y.; Bera, Anil K. (2009). "Maximum entropy autoregressive conditional heteroskedasticity model" (PDF). Journal of Econometrics. 150 (2): 219–230. CiteSeerX 10.1.1.511.9750. doi:10.1016/j.jeconom.2008.12.014. Archived from the original (PDF) on 2016-03-07. Retrieved 2011-06-02.
- ^ Hogg, R. V.; Craig, A. T. (1978). Introduction to Mathematical Statistics (4th ed.). New York: Macmillan. pp. Remark 3.3.1. ISBN 0-02-355710-9.
- ^ Gopalan, Prem; Hofman, Jake M.; Blei, David M. (2013). "Scalable Recommendation with Poisson Factorization". arXiv:1311.1704 [cs.IR].
- ^ a b Papoulis, Pillai, Probability, Random Variables, and Stochastic Processes, Fourth Edition
- ^ Jeesen Chen, Herman Rubin, Bounds for the difference between median and mean of gamma and Poisson distributions, Statistics & Probability Letters, Volume 4, Issue 6, October 1986, Pages 281–283, ISSN 0167-7152, [1] Archived 2024-10-09 at the Wayback Machine.
- ^ Choi, K. P. "On the Medians of the Gamma Distributions and an Equation of Ramanujan" Archived 2021-01-23 at the Wayback Machine, Proceedings of the American Mathematical Society, Vol. 121, No. 1 (May, 1994), pp. 245–251.
- ^ a b Berg, Christian & Pedersen, Henrik L. (March 2006). "The Chen–Rubin conjecture in a continuous setting" (PDF). Methods and Applications of Analysis. 13 (1): 63–88. doi:10.4310/MAA.2006.v13.n1.a4. S2CID 6704865. Archived (PDF) from the original on 16 January 2021. Retrieved 1 April 2020.
- ^ a b Berg, Christian and Pedersen, Henrik L. "Convexity of the median in the gamma distribution" Archived 2023-05-26 at the Wayback Machine.
- ^ Gaunt, Robert E., and Milan Merkle (2021). "On bounds for the mode and median of the generalized hyperbolic and related distributions". Journal of Mathematical Analysis and Applications. 493 (1) 124508. arXiv:2002.01884. doi:10.1016/j.jmaa.2020.124508. S2CID 221103640.
{{cite journal}}: CS1 maint: multiple names: authors list (link) - ^ a b c Lyon, Richard F. (13 May 2021). "On closed-form tight bounds and approximations for the median of a gamma distribution". PLOS One. 16 (5) e0251626. arXiv:2011.04060. Bibcode:2021PLoSO..1651626L. doi:10.1371/journal.pone.0251626. PMC 8118309. PMID 33984053.
- ^ a b Lyon, Richard F. (13 May 2021). "Tight bounds for the median of a gamma distribution". PLOS One. 18 (9) e0288601. doi:10.1371/journal.pone.0288601. PMC 10490949. PMID 37682854.
- ^ Mathai, A. M. (1982). "Storage capacity of a dam with gamma type inputs". Annals of the Institute of Statistical Mathematics. 34 (3): 591–597. doi:10.1007/BF02481056. ISSN 0020-3157. S2CID 122537756.
- ^ Moschopoulos, P. G. (1985). "The distribution of the sum of independent gamma random variables". Annals of the Institute of Statistical Mathematics. 37 (3): 541–544. doi:10.1007/BF02481123. S2CID 120066454.
- ^ Penny, W. D. "KL-Divergences of Normal, Gamma, Dirichlet, and Wishart densities".
- ^ "LogGammaDistribution—Wolfram Language Documentation".
- ^ "ExpGammaDistribution—Wolfram Language Documentation".
- ^ "scipy.stats.loggamma — SciPy v1.8.0 Manual". docs.scipy.org.
- ^ Sun, Jingchao; Kong, Maiying; Pal, Subhadip (22 June 2021). "The Modified-Half-Normal distribution: Properties and an efficient sampling scheme" (PDF). Communications in Statistics - Theory and Methods. 52 (5): 1591–1613. doi:10.1080/03610926.2021.1934700. ISSN 0361-0926. S2CID 237919587. Retrieved 2 September 2022.
- ^ Dubey, Satya D. (December 1970). "Compound gamma, beta and F distributions". Metrika. 16 (1): 27–31. doi:10.1007/BF02613934. S2CID 123366328.
- ^ Minka, Thomas P. (2002). "Estimating a Gamma distribution" (PDF).
- ^ Choi, S. C.; Wette, R. (1969). "Maximum Likelihood Estimation of the Parameters of the Gamma Distribution and Their Bias". Technometrics. 11 (4): 683–690. doi:10.1080/00401706.1969.10490731.
- ^ a b Marsaglia, G.; Tsang, W. W. (2000). "A simple method for generating gamma variables". ACM Transactions on Mathematical Software. 26 (3): 363–372. doi:10.1145/358407.358414. S2CID 2634158.
- ^ Ye, Zhi-Sheng; Chen, Nan (2017). "Closed-Form Estimators for the Gamma Distribution Derived from Likelihood Equations". The American Statistician. 71 (2): 177–181. doi:10.1080/00031305.2016.1209129. S2CID 124682698. Archived from the original on 2023-05-26. Retrieved 2019-07-27.
- ^ Louzada, Francisco; Ramos, Pedro L.; Ramos, Eduardo (2019). "A Note on Bias of Closed-Form Estimators for the Gamma Distribution Derived from Likelihood Equations". The American Statistician. 73 (2): 195–199. doi:10.1080/00031305.2018.1513376. hdl:11449/184543. S2CID 126086375. Archived from the original on 2023-05-26. Retrieved 2019-07-27.
- ^ Fink, D. 1995 A Compendium of Conjugate Priors. In progress report: Extension and enhancement of methods for setting data quality objectives. (DOE contract 95‑831).
- ^ Jessica., Scheiner, Samuel M., 1956- Gurevitch (2001). "13. Failure-time analysis". Design and analysis of ecological experiments. Oxford University Press. ISBN 0-19-513187-8. OCLC 43694448. Archived from the original on 2024-10-09. Retrieved 2022-05-26.
{{cite book}}: CS1 maint: multiple names: authors list (link) CS1 maint: numeric names: authors list (link) - ^ Golubev, A. (March 2016). "Applications and implications of the exponentially modified gamma distribution as a model for time variabilities related to cell proliferation and gene expression". Journal of Theoretical Biology. 393: 203–217. Bibcode:2016JThBi.393..203G. doi:10.1016/j.jtbi.2015.12.027. ISSN 0022-5193. PMID 26780652.
- ^ Poon, Art; Davis, Bradley H; Chao, Lin (2005-07-01). "The Coupon Collector and the Suppressor Mutation". Genetics. 170 (3): 1323–1332. doi:10.1534/genetics.104.037259. ISSN 1943-2631. PMC 1451182. PMID 15879511.
- ^ Vineyard, Michael; Amoako-Gyampah, Kwasi; Meredith, Jack R (July 1999). "Failure rate distributions for flexible manufacturing systems: An empirical study". European Journal of Operational Research. 116 (1): 139–155. doi:10.1016/s0377-2217(98)00096-4. ISSN 0377-2217.
- ^ Rief, Matthias; Rock, Ronald S.; Mehta, Amit D.; Mooseker, Mark S.; Cheney, Richard E.; Spudich, James A. (2000-08-15). "Myosin-V stepping kinetics: A molecular model for processivity". Proceedings of the National Academy of Sciences. 97 (17): 9482–9486. Bibcode:2000PNAS...97.9482R. doi:10.1073/pnas.97.17.9482. ISSN 0027-8424. PMC 16890. PMID 10944217.
- ^ p. 43, Philip J. Boland, Statistical and Probabilistic Methods in Actuarial Science, Chapman & Hall CRC 2007
- ^ Wilks, Daniel S. (1990). "Maximum Likelihood Estimation for the Gamma Distribution Using Data Containing Zeros". Journal of Climate. 3 (12): 1495–1501. Bibcode:1990JCli....3.1495W. doi:10.1175/1520-0442(1990)003<1495:MLEFTG>2.0.CO;2. ISSN 0894-8755. JSTOR 26196366.
- ^ Belikov, Aleksey V. (22 September 2017). "The number of key carcinogenic events can be predicted from cancer incidence". Scientific Reports. 7 (1) 12170. Bibcode:2017NatSR...712170B. doi:10.1038/s41598-017-12448-7. PMC 5610194. PMID 28939880.
- ^ Belikov, Aleksey V.; Vyatkin, Alexey; Leonov, Sergey V. (2021-08-06). "The Erlang distribution approximates the age distribution of incidence of childhood and young adulthood cancers". PeerJ. 9 e11976. doi:10.7717/peerj.11976. ISSN 2167-8359. PMC 8351573. PMID 34434669.
- ^ J. G. Robson and J. B. Troy, "Nature of the maintained discharge of Q, X, and Y retinal ganglion cells of the cat", J. Opt. Soc. Am. A 4, 2301–2307 (1987)
- ^ M.C.M. Wright, I.M. Winter, J.J. Forster, S. Bleeck "Response to best-frequency tone bursts in the ventral cochlear nucleus is governed by ordered inter-spike interval statistics", Hearing Research 317 (2014)
- ^ N. Friedman, L. Cai and X. S. Xie (2006) "Linking stochastic dynamics to population distribution: An analytical framework of gene expression", Phys. Rev. Lett. 97, 168302.
- ^ DJ Reiss, MT Facciotti and NS Baliga (2008) "Model-based deconvolution of genome-wide DNA binding", Bioinformatics, 24, 396–403
- ^ MA Mendoza-Parra, M Nowicka, W Van Gool, H Gronemeyer (2013) "Characterising ChIP-seq binding patterns by model-based peak shape deconvolution" Archived 2024-10-09 at the Wayback Machine, BMC Genomics, 14:834
- ^ Yang, Ziheng (September 1996). "Among-site rate variation and its impact on phylogenetic analyses". Trends in Ecology & Evolution. 11 (9): 367–372. Bibcode:1996TEcoE..11..367Y. CiteSeerX 10.1.1.19.99. doi:10.1016/0169-5347(96)10041-0. PMID 21237881. Archived from the original on 2024-04-12. Retrieved 2023-09-06.
- ^ Yang, Ziheng (September 1994). "Maximum likelihood phylogenetic estimation from DNA sequences with variable rates over sites: Approximate methods". Journal of Molecular Evolution. 39 (3): 306–314. Bibcode:1994JMolE..39..306Y. CiteSeerX 10.1.1.19.6626. doi:10.1007/BF00160154. ISSN 0022-2844. PMID 7932792. S2CID 17911050. Archived from the original on 2024-10-09. Retrieved 2023-09-06.
- ^ Felsenstein, Joseph (2001-10-01). "Taking Variation of Evolutionary Rates Between Sites into Account in Inferring Phylogenies". Journal of Molecular Evolution. 53 (4–5): 447–455. Bibcode:2001JMolE..53..447F. doi:10.1007/s002390010234. ISSN 0022-2844. PMID 11675604. S2CID 9791493. Archived from the original on 2024-10-09. Retrieved 2023-09-06.
- ^ a b c Devroye, Luc (1986). Non-Uniform Random Variate Generation. New York: Springer-Verlag. ISBN 978-0-387-96305-1. Archived from the original on 2012-07-17. Retrieved 2012-02-26. See Chapter 9, Section 3.
- ^ a b Ahrens, J. H.; Dieter, U (January 1982). "Generating gamma variates by a modified rejection technique". Communications of the ACM. 25 (1): 47–54. doi:10.1145/358315.358390. S2CID 15128188.. See Algorithm GD, p. 53.
- ^ Ahrens, J. H.; Dieter, U. (1974). "Computer methods for sampling from gamma, beta, Poisson and binomial distributions". Computing. 12 (3): 223–246. CiteSeerX 10.1.1.93.3828. doi:10.1007/BF02293108. S2CID 37484126.
- ^ Cheng, R. C. H.; Feast, G. M. (1979). "Some Simple Gamma Variate Generators". Journal of the Royal Statistical Society. Series C (Applied Statistics). 28 (3): 290–295. doi:10.2307/2347200. JSTOR 2347200.
- ^ Marsaglia, G. The squeeze method for generating gamma variates. Comput, Math. Appl. 3 (1977), 321–325.
External links
[edit]- "Gamma-distribution", Encyclopedia of Mathematics, EMS Press, 2001 [1994]
- Weisstein, Eric W. "Gamma distribution". MathWorld.
- ModelAssist (2017) Uses of the gamma distribution in risk modeling, including applied examples in Excel Archived 2017-05-09 at the Wayback Machine.
- Engineering Statistics Handbook
Gamma distribution
View on Grokipediawhere is the shape parameter, is the rate parameter, and denotes the Gamma function, defined as .[2] This distribution arises naturally as the sum of independent exponential random variables with rate when is a positive integer, generalizing the exponential distribution (which corresponds to ).[3] The mean of a Gamma-distributed random variable is , while the variance is ; equivalently, in the scale parameterization with scale parameter , the mean is and variance .[2][1] The shape parameter controls the skewness and tail behavior: for small , the distribution is highly right-skewed, becoming more symmetric and approaching a normal distribution as increases.[1] Key properties include the additivity of independent Gamma variables with the same rate parameter—the sum of variables is —and its role as a conjugate prior for the Poisson and exponential likelihoods in Bayesian statistics.[2] Special cases of the Gamma distribution include the Erlang distribution (when is a positive integer, modeling interarrival times in a Poisson process) and the chi-squared distribution with degrees of freedom (equivalent to ).[2][3] It also connects to the beta distribution through normalization and serves as a building block for more complex models like the generalized gamma or Weibull-gamma distributions.[4] Originating in the era of Pierre-Simon Laplace in the late 18th century and motivated by problems in waiting times and sums of exponentials, the Gamma distribution has broad applications in fields such as reliability engineering for lifetime modeling, hydrology for precipitation amounts, queueing theory via the Erlang loss function, and financial modeling of event interarrival times.[5][4][3] In statistics, its incomplete forms and are essential for computing cumulative probabilities and hypothesis testing in chi-squared analyses.[4]
Definitions
Shape-Rate Parameterization
The gamma distribution in the shape-rate parameterization is a two-parameter family of continuous probability distributions defined on the nonnegative real line. It is characterized by the shape parameter , which influences the distribution's asymmetry and concentration, and the rate parameter , which controls the exponential decay of the density function. The support of the distribution is , with the probability density function evaluating to zero for .[6] The probability density function is given by where denotes the gamma function, defined as the integral . This form normalizes the density such that it integrates to 1 over , serving as the foundational expression for the distribution's probabilities. The shape parameter governs the spread and the presence of a peak (for ), with larger values leading to reduced skewness and a more bell-shaped curve, while the rate parameter determines the decay rate, inversely affecting the typical magnitude of observations.[6] The cumulative distribution function, which gives the probability that the random variable is less than or equal to , is expressed using the lower incomplete gamma function : This formulation arises directly from integrating the density function, with the incomplete gamma providing a standard way to compute cumulative probabilities, especially useful in statistical applications involving waiting times or sums of exponentials.[4][6] This parameterization originates as a generalization of the exponential distribution, which emerges when , reducing the density to and the gamma function to . In broader terms, the gamma distribution extends the gamma integral to model scenarios like the sum of independent exponential random variables (when is an integer), with the rate scaling the process. The shape-rate form highlights the decay aspect of , differing from the shape-scale parameterization that emphasizes direct scaling.[6]Shape-Scale Parameterization
The shape-scale parameterization of the gamma distribution employs two positive parameters: the shape parameter , which governs the distribution's form, and the scale parameter , which determines the spread of the distribution.[7] The probability density function (PDF) is given by where denotes the gamma function.[7] This form arises naturally in contexts where the scale parameter stretches or compresses the distribution along the positive real line.[7] The cumulative distribution function (CDF) in this parameterization is with representing the lower incomplete gamma function.[7] This shape-scale form is equivalent to the shape-rate parameterization, where the rate parameter is . To see this, substitute into the PDF: and , yielding , which matches the rate-based expression.[7] The scale parameter is particularly intuitive in modeling scenarios involving waiting times or aggregate sizes, as it represents the characteristic scale of the exponential components underlying the gamma distribution, effectively stretching the support to reflect larger typical values.[7] In statistical software, the shape-scale parameterization is commonly adopted for its alignment with intuitive scaling interpretations; for instance, the R programming language'sdgamma function implements the gamma distribution using shape and scale parameters.[8]
Properties
Moments and Central Moments
The raw moments of a random variable following a gamma distribution can be expressed using the properties of the gamma function. In the shape-scale parameterization, with probability density function for , , and , the -th raw moment is [2] In the shape-rate parameterization, with density for , , and , [2] These formulas arise from direct integration of against the gamma integral definition , yielding the ratio of gamma functions after substitution.[2] The first raw moment is the mean .[7] The second central moment, or variance, follows from , so [7] Alternatively, these can be derived from the moment-generating function (shape-scale) or (shape-rate), for or , respectively, by taking derivatives: the mean is and the variance is .[2] Higher central moments characterize the shape of the distribution. The skewness, defined as the standardized third central moment , is independent of or .[7] This positive value reflects the right-skewed nature of the gamma distribution, decreasing as the shape parameter increases. The kurtosis, , is [7] These measures are obtained by computing the third and fourth raw moments via the gamma function ratios and substituting into the central moment formulas, such as .[9] As , the skewness and excess kurtosis both approach 0, indicating that the gamma distribution converges to a normal distribution in shape, consistent with the central limit theorem applied to the gamma as a sum of exponential random variables.[10]Mode and Median
The mode of the gamma distribution, which is the point of maximum probability density, depends on the shape parameter α. In the shape-rate parameterization with rate λ, for α ≥ 1, the mode occurs at (α - 1)/λ. Equivalently, in the shape-scale parameterization with scale θ = 1/λ, the mode is at (α - 1)θ. For 0 < α < 1, the probability density function is monotonically decreasing from infinity at x = 0, so the mode is at 0; at α = 1, the distribution reduces to the exponential case, where the mode is also at 0.[7] The unimodality of the gamma distribution for α > 0 can be established by examining the derivative of the probability density function. Specifically, the logarithmic derivative of the density (score function) changes sign exactly once, confirming a single maximum.[11] The median m of the gamma distribution is defined as the value satisfying F(m) = 1/2, where F denotes the cumulative distribution function, but no closed-form expression exists in terms of elementary functions. One effective approximation is provided by the Wilson-Hilferty transformation, which normalizes the cube root of the variable: m ≈ θ \left[ \alpha^{1/3} \left(1 - \frac{1}{9\alpha} + \frac{z}{3 \sqrt{\alpha}}\right) \right]^3, where z ≈ -0.3746 is the adjustment for the 50th percentile to improve accuracy. Useful bounds for the median exist; for example, for α > 1, θ(α - 1/3) < m < θ(α + 1/4). More generally, for the standard gamma (θ = 1), tighter bounds are log(2) - 1/3 < ν(α)/α < e^{-γ}, where γ ≈ 0.57721 is the Euler-Mascheroni constant, scaled appropriately for general θ.[12] Due to the positive skewness of the gamma distribution for α > 1 (as noted in the moments section), the median is less than the mean in this case.[11]Sum and Scaling
The Gamma distribution possesses a reproductive property under summation of independent random variables sharing the same rate parameter . Specifically, if are independent and identically distributed as , then their sum follows a distribution.[13] This result generalizes to independent random variables with differing shapes , where .[13] The closure of the Gamma family under such convolutions, when rates are equal, constitutes its reproduction property and underscores its utility in modeling cumulative processes like waiting times for multiple events.[14] This summation property can be derived using the characteristic function of the Gamma distribution, given by for a random variable .[15] For independent summands, the characteristic function of the sum is the product , which matches that of a distribution.[16] Alternatively, the result follows from the convolution of the respective probability density functions, leveraging the integral representation involving the Gamma function, though the characteristic function approach is more direct for non-identical shapes.[17] Regarding scaling, if , then for any constant , the scaled variable follows a distribution.[18] This transformation preserves the shape parameter while adjusting the rate inversely with the scaling factor, as verified by substituting into the density function via the change-of-variables formula. In the limit of large shape parameters, sums of independent Gamma random variables, after centering at their mean and scaling by the standard deviation, converge in distribution to a standard normal by the central limit theorem.[19]Exponential Family Form
The gamma distribution can be expressed as a member of the two-parameter exponential family, which provides a unified framework for statistical inference and modeling. In the shape-rate parameterization, with shape parameter and rate parameter , the probability density function is given by Taking the natural logarithm yields which can be rewritten in the canonical exponential family form as where the natural parameter vector is , the sufficient statistics are , and the cumulant function is .[20][21] In the shape-scale parameterization, with scale parameter , the natural parameters adjust accordingly to , or equivalently, one natural parameter can be expressed as when fixing the shape for one-parameter submodels. The joint sufficient statistics are minimal for the parameters , enabling efficient inference via the factorization theorem.[20][21] This exponential family structure is particularly valuable in generalized linear models (GLMs), where the gamma distribution models positive continuous responses with constant coefficient of variation. Here, the shape parameter relates to the dispersion parameter , which scales the variance as and is estimated separately from the mean parameters. The form facilitates iteratively reweighted least squares (IRLS) for parameter estimation and supports conjugate prior specifications in Bayesian contexts, such as gamma priors for rate parameters.[22]Entropy and Divergences
The differential entropy of a random variable following a gamma distribution with shape parameter and rate parameter , denoted , is given by where is the gamma function and is the digamma function.[23] This expression is obtained by evaluating the definition of differential entropy, , where is the probability density function (PDF). Substituting the log-PDF yields , so Here, and , leading to the closed form after simplification.[24] For large , the gamma distribution converges to a normal distribution with mean and variance by the central limit theorem, and the entropy asymptotically approaches the Gaussian entropy formula: This approximation follows from Stirling's formula applied to and the asymptotic expansion .[23] The Kullback-Leibler (KL) divergence between two gamma distributions and is [25] where and . This closed-form expression is derived similarly to the entropy, as , using the same expectation properties.[26][27] In model selection, the KL divergence quantifies the information loss when approximating one gamma distribution with another, serving as a measure of fit for competing gamma models to observed data; for instance, it aids in discriminating gamma fits from alternatives like the log-normal in reliability analysis.[28]Generating Functions
The moment-generating function (MGF) of a random variable following a gamma distribution provides a useful tool for deriving moments and analyzing sums of independent variables. For the shape-rate parameterization, where the probability density function is for , , and , the MGF is defined as . Substituting the PDF yields which follows from recognizing the integral as the gamma function form .[29][2] The moments of are obtained by differentiating the MGF: the -th moment is , where denotes the -th derivative. For independent gamma random variables with the same rate parameter, the MGF of their sum is the product of individual MGFs, confirming closure under convolution.[1][29] The characteristic function, , is derived analogously by replacing with in the MGF integral. In the shape-scale parameterization, with PDF for , , and , it takes the form This follows from the substitution yielding , normalized appropriately. The PDF can be recovered from the characteristic function via the Fourier inversion theorem: .[15][2] The Laplace transform, for , is obtained similarly by substituting for in the MGF. In the shape-rate parameterization, it is derived from . This transform is particularly useful in solving differential equations involving gamma processes.[2][29]Related Distributions
Core Connections
The gamma distribution serves as a foundational model in probability theory, directly encompassing or linking to several canonical distributions through specific parameter choices or transformations. These connections highlight its versatility in modeling waiting times, sums of random variables, and ratios in statistical applications.[30] A primary special case occurs when the shape parameter , reducing the gamma distribution to the exponential distribution with rate parameter , which describes the time until the first event in a Poisson process.[31] When for positive integer , the distribution specializes to the Erlang distribution with integer shape and rate , representing the sum of independent exponential random variables each with rate .[32][33] The chi-squared distribution with degrees of freedom is equivalent to a gamma distribution in the shape-rate parameterization, specifically .[34] This relationship arises because the chi-squared is the sum of squares of independent standard normal variables, aligning with gamma's role in quadratic forms.[30] Key inter-distributional links include the beta and inverse gamma. If and are independent in the shape-rate form, then the ratio , providing a mechanism for normalizing gamma variables to the unit interval.[35] More generally, if are independent with common rate , then , where , extending the beta to multivariate proportions.[36] In the shape-scale parameterization, if , the reciprocal , which is useful for modeling precisions or variances in Bayesian contexts.[37] The following table summarizes parameter mappings for these equivalent or directly related distributions, using the shape-rate parameterization for gamma where applicable:| Distribution | Parameters | Mapping to Gamma(, ) (shape-rate) |
|---|---|---|
| Exponential() | rate | |
| Erlang(, ) | integer shape , rate | |
| Chi-squared() | degrees of freedom | , |
Compound and Limiting Forms
The gamma distribution serves as a mixing distribution in several compound forms, leading to well-known distributions in statistics. For instance, when the rate parameter of a Poisson distribution is treated as a gamma-distributed random variable with shape parameter and scale parameter , the resulting marginal distribution for the count variable is negative binomial with parameters and .[38] Similarly, the Student's t-distribution arises as a scale mixture where a normal random variable has precision following a gamma distribution; specifically, if and , the marginal distribution of is Student's t with degrees of freedom, location , and scale 1.[39] The generalized gamma distribution extends the standard gamma by introducing an additional shape parameter to enhance flexibility in modeling skewed data with varying tail behaviors. Its probability density function is given by where is the shape parameter, is the scale parameter, and is the power parameter.[40] This form nests the gamma distribution as the special case , the Weibull distribution when , and allows for broader applications in reliability and survival analysis. The gamma distribution is infinitely divisible, meaning it can be expressed as the distribution of a sum of an arbitrary number of i.i.d. random variables, which underpins its role in constructing Lévy processes such as the gamma process—a subordinator used in stochastic modeling of positive increments.[41] This property connects the gamma to stable distributions in the context of Lévy processes, where the gamma serves as a building block for infinitely divisible measures on the positive reals.[41] Further generalizations, such as the McDonald form of the generalized gamma distribution, introduce additional parameters to provide greater control over tail heaviness, making it suitable for modeling income distributions and other heavy-tailed phenomena. This extension builds on the standard generalized gamma by incorporating a beta-type mixing to adjust skewness and kurtosis flexibly.[42]Parameter Estimation
Method of Moments
The method of moments estimation for the parameters of the gamma distribution equates the theoretical mean and variance to their sample counterparts, yielding closed-form expressions for the shape parameter α and rate parameter λ. The theoretical mean is E[X] = α / λ and the theoretical variance is Var(X) = α / λ^2. Setting these equal to the sample mean \bar{x} and sample variance s^2 (defined as s^2 = \frac{1}{n-1} \sum_{i=1}^n (x_i - \bar{x})^2) gives the system of equations \bar{x} = α / λ and s^2 = α / λ^2. Solving for λ from the second equation yields λ = α / s^2, and substituting into the first equation gives α = \bar{x}^2 / s^2, so the estimators are \hat{α} = \bar{x}^2 / s^2 and \hat{λ} = \bar{x} / s^2.[43][44] An equivalent derivation uses the first two raw moments: E[X] = α / λ and E[X^2] = α(α + 1) / λ^2. Equating to the sample raw moments \bar{x} and m_2 = \frac{1}{n} \sum_{i=1}^n x_i^2 leads to the ratio m_2 / \bar{x}^2 = (α + 1)/α = 1 + 1/α, so 1/α = m_2 / \bar{x}^2 - 1. Since the biased sample variance is \tilde{s}^2 = m_2 - \bar{x}^2, this simplifies to 1/α = \tilde{s}^2 / \bar{x}^2, yielding the same estimators \hat{α} = \bar{x}^2 / \tilde{s}^2 and \hat{λ} = \bar{x} / \tilde{s}^2 (noting that using the unbiased s^2 instead of \tilde{s}^2 scales the estimate by (n-1)/n).[44][45] The estimator \hat{α} is biased when using the unbiased sample variance s^2, tending to be biased low for small sample sizes n due to the variability in the ratio of moments; an adjustment to reduce bias involves scaling the variance estimate by n/(n-2) in contexts where higher-order moment bias is considered, though this is approximate and primarily improves performance for moderate n.[45] These MOM estimators are computationally simple and do not require iterative optimization, but they exhibit higher variance compared to maximum likelihood estimators, particularly in small samples.[43] They are also inefficient when α is small (leading to high skewness in the distribution), as the moment-matching approach struggles with the heavy tails and asymmetry, potentially yielding poor fits. Additionally, the estimators require the implied coefficient of variation estimate \tilde{c} = \tilde{s}^2 / \bar{x}^2 > 0, which is always true for samples of positive data.[46][47]Maximum Likelihood
The maximum likelihood estimation (MLE) for the shape parameter and rate parameter of the gamma distribution is obtained by maximizing the log-likelihood function derived from a random sample of independent observations. The log-likelihood is given by This expression arises directly from the probability density function of the gamma distribution.[48] Setting the partial derivatives (score equations) to zero yields the MLEs. Differentiating with respect to gives , so , where is the sample mean. For , the equation is , where is the digamma function; substituting the expression for results in the transcendental equation . Often, method of moments estimates serve as initial guesses for solving this iteratively. There is no closed-form solution for , necessitating numerical optimization techniques such as Newton-Raphson or fixed-point iteration, which typically converge quickly (e.g., in about four iterations for the fixed-point method).[48][48][49] The MLEs and are consistent and asymptotically normal, with asymptotic efficiency under regularity conditions for the gamma family. The asymptotic covariance matrix of the estimators is the inverse of the observed or expected Fisher information matrix, , where the per-observation Fisher information is and is the trigamma function. This provides standard errors for inference, scaling with . In software, functions likefitdistr in R's MASS package implement these MLE computations using numerical optimization, returning parameter estimates and their standard errors based on the observed information.[50][50][51]
Bayesian Estimation
In Bayesian estimation of the Gamma distribution parameters, the focus is on incorporating prior beliefs to quantify uncertainty in the shape and rate . When is fixed and known, the conjugate prior for the rate parameter is a Gamma distribution, , where and are hyperparameters reflecting prior shape and rate, respectively.[52] For independent observations from , the likelihood is proportional to , leading to a posterior distribution .[53] This closed-form posterior arises because the Gamma prior is conjugate to the Gamma likelihood in this parameterization.[52] Under squared error loss, the Bayes estimator for is the posterior mean, given by which shrinks the maximum likelihood estimate toward the prior mean and provides a measure of uncertainty through the posterior variance .[52] Credible intervals for can be derived analytically from the posterior Gamma distribution or approximated via simulation methods such as Markov chain Monte Carlo (MCMC), which sample from the posterior to compute highest posterior density (HPD) intervals.[54] Estimating both and jointly presents challenges, as no simple proper conjugate prior exists for that maintains tractability with the Gamma likelihood.[52] Common approaches use a Gamma prior for combined with an improper uniform or log-uniform prior on (or ) to reflect vague beliefs about the shape.[53] The resulting joint posterior lacks a closed form and requires numerical methods like Laplace approximation or MCMC for summaries, such as marginal posterior means and credible intervals.[52] For instance, Gibbs sampling can generate samples from the conditional posteriors to approximate the marginal for .[54] In hierarchical models where is unknown and treated as drawn from a hyperprior, empirical Bayes methods estimate the hyperparameters of the prior on (e.g., via marginal maximum likelihood) before computing the posterior for .[55] This approach is particularly useful in settings with multiple related Gamma processes, allowing shrinkage of estimates across groups while avoiding full hierarchical computation.[55]Applications
Probabilistic Modeling
The gamma distribution plays a central role in modeling waiting times in stochastic processes, particularly as the distribution of the sum of independent exponential random variables, which corresponds to the Erlang distribution when the shape parameter is an integer. In a Poisson process with constant rate λ, the time until the k-th event occurs follows an Erlang distribution, a special case of the gamma distribution with shape parameter k and rate parameter λ, capturing the aggregate waiting time for multiple interarrival intervals.[56] This property makes the gamma distribution essential for analyzing cumulative times in renewal processes where events arrive independently at a constant average rate.[57] The gamma distribution's flexibility stems from its two-parameter family, allowing it to model a wide range of right-skewed positive continuous data, such as lifetimes or income distributions, where the shape parameter α controls the skewness and tail behavior. For small α, the distribution exhibits strong right-skewness, while as α increases, it becomes more symmetric and approaches a normal distribution due to the central limit theorem applied to the sum of exponential components.[58] This adaptability positions the gamma distribution as a versatile tool for phenomena exhibiting positive asymmetry and varying dispersion.[59] In Bayesian statistics, the gamma distribution serves as a conjugate prior for the precision parameter (inverse variance) of a normal likelihood, facilitating closed-form posterior updates within the normal-gamma family. When combined with a normal prior on the mean, this setup yields a posterior predictive distribution that follows a non-standardized Student's t-distribution, enabling robust inference under uncertainty in variance.[60] The conjugacy property simplifies computations and supports hierarchical modeling of normal data with unknown precision.[61] For handling overdispersion in count data, where the variance exceeds the mean beyond what a Poisson distribution allows, the gamma distribution models heterogeneity in the Poisson rate parameter through a gamma-Poisson mixture, resulting in the negative binomial distribution. This mixture accounts for unobserved variations in event rates across units, providing a probabilistic framework for overdispersed counts while maintaining interpretability.[62] The approach is particularly valuable in scenarios where Poisson assumptions fail due to extra variability.[63] The gamma distribution's membership in a scale family imparts scale invariance to certain hypothesis tests, such as those concerning the rate parameter, ensuring that test statistics remain unaltered under positive scaling of the data. This invariance is crucial for testing scale-related hypotheses, like comparing rates in exponential or gamma models, as it yields distribution-free critical values under the null.[64] Such properties enhance the robustness of inference for scale parameters in probabilistic models.[65]Practical Uses
In reliability engineering, the gamma distribution models the time to failure for components and systems exhibiting wear-out behaviors, particularly when multiple failure stages are involved. It is often combined with the Weibull distribution in accelerated life testing to analyze degradation paths, such as in two-stage models distinguishing failure initiation from propagation, enabling more accurate predictions of reliability under stress conditions.[66][67] In finance, the gamma distribution serves as a model for returns on positive-valued assets, capturing the skewness and variability in long-term investment outcomes through transformed rate-of-return frameworks.[68] Gamma processes further enhance option pricing by subordinating Brownian motion with gamma time changes, as in the variance gamma model, which addresses limitations in the Black-Scholes framework by better accommodating empirical skewness, kurtosis, and strike-maturity biases in European options.[69] Environmental science employs the gamma distribution to model rainfall amounts, such as monthly or daily totals, due to its flexibility in representing positive, right-skewed precipitation data; hierarchical Bernoulli-gamma approaches effectively handle zero-inflated occurrences alongside intensity.[70] Similarly, it characterizes wind speed distributions at monitoring sites, alongside other candidates like Weibull, to assess renewable energy potential and extreme weather risks.[71] In biology, the gamma distribution describes population growth rates and abundance patterns, emerging from stochastic logistic models that simulate fluctuations around equilibrium states via weighted multimodal forms.[72] In pharmacokinetics, it models drug response times and residence durations in circulatory systems, grounded in random walk assumptions for disposition kinetics.[73] The insurance industry uses the gamma distribution for modeling moderate claim sizes, providing a parametric fit for severity data in generalized linear frameworks. For heavy-tailed losses, composite Pareto-gamma variants, such as inverse gamma-Pareto mixtures, improve tail estimation and tariffication by blending exponential-like bodies with power-law extremes.[74][75] Post-2020 advancements in machine learning integrate the gamma distribution into transformer architectures, such as variational approximations for attention weights to mitigate gradient issues and probabilistic priors in adaptive filtering. It also models cosine similarities among sentence embeddings in small language models, enhancing interpretability of attention-driven representations.[76][77]Random Variate Generation
Sampling Methods
Generating random variates from the gamma distribution, denoted as Gamma(α, β) with shape parameter α > 0 and rate parameter β > 0, relies on several algorithmic approaches tailored to the value of α. For the special case where α = 1, the gamma distribution coincides with the exponential distribution with rate β, which can be sampled directly via the inverse cumulative distribution function: if U ~ Uniform(0,1), then X = - (1/β) \ln(1 - U) follows Exponential(β).[10] When α is a positive integer k, the gamma distribution is the Erlang distribution, representing the sum of k independent exponential random variables each with rate β; thus, variates can be generated by summing k such exponentials.[13] For general α > 1, acceptance-rejection methods provide efficient sampling by proposing from an exponential distribution with rate μ = β / α (mean α / β, matching the target's mean), enveloped such that c g(x) ≥ f(x) with c = sup f/g < ∞ due to the proposal's heavier tail. Acceptance occurs if a uniform variate U satisfies U ≤ f(Y) / (c g(Y)), where Y is the proposal; this method's efficiency improves with larger α. The seminal Ahrens-Dieter algorithm refines this for both integer and non-integer α > 1, employing a rejection technique with a piecewise majorizing function that combines uniform and exponential proposals in different regions, achieving low rejection rates (typically under 10%) across a wide range of α. For 0 < α < 1, the density peaks near zero, complicating direct proposals; acceptance-rejection remains viable but requires careful envelope design. The Ahrens-Dieter method extends here using a majorizing function that splits the domain at x=1, with a power-law envelope for x < 1 and an exponential tail for x > 1, yielding a constant c = (e + α)/(e Γ(α + 1)) and rejection probabilities around 0.2–0.5 depending on α. An improvement, Best's algorithm, adjusts the split point to d ≈ 0.07 + 0.75 √(1 - α) and uses a constant-height exponential envelope beyond d, reducing average rejections by up to 20% compared to Ahrens-Dieter for small α.Computational Considerations
Generating gamma random variates efficiently is crucial for simulations and statistical computing, with modern implementations achieving constant time complexity, O(1), per sample through optimized rejection sampling techniques.[78] These methods typically exhibit high acceptance rates, often exceeding 90% for shape parameters α > 0.5, ensuring minimal computational overhead; for instance, the Marsaglia-Tsang algorithm reports rates above 95% at α = 1 and approaching 100% for larger α.[79] Numerical stability becomes a concern when computing normalization constants like the gamma function Γ(α), which can overflow for large α due to rapid growth. To mitigate this, implementations often employ the log-gamma function, lgamma(α), which avoids direct evaluation and maintains precision across extended ranges.[80] In software libraries, NumPy's random module in Python utilizes the Marsaglia-Tsang method for α ≥ 1 and a rejection algorithm from Devroye for α < 1, providing fast generation suitable for large-scale simulations.[81] Similarly, R'srgamma function employs acceptance-rejection schemes based on Ahrens and Dieter algorithms, adapted for efficiency across parameter ranges.[82] For cases with α < 1, specialized methods like those in the gammadist package reduce rejection rates compared to standard approaches.[83]
Parallel generation is facilitated through vectorized operations on GPUs, leveraging libraries such as NVIDIA's cuRAND to initialize per-thread random states and implement sampling algorithms like Marsaglia-Tsang across thousands of cores simultaneously, enabling high-throughput simulations.[84]
Quality assurance of generated variates commonly involves the Kolmogorov-Smirnov (KS) test to assess goodness-of-fit against the theoretical gamma distribution, verifying uniformity in the empirical cumulative distribution. However, for small α (e.g., α < 1), challenges arise due to the distribution's high variance and heavy tails, leading to potentially higher rejection rates in sampling and reduced test power in detecting deviations.[83]