GammaDistributionCopy to clipboard.
✖
GammaDistribution
represents a gamma distribution with shape parameter α and scale parameter β.
represents a generalized gamma distribution with shape parameters α and γ, scale parameter β, and location parameter μ.
Details

- The probability density for value
in a gamma distribution is proportional to
for
, and is zero for
. »
- The probability density for value
in a generalized gamma distribution is proportional to
for
, and is zero elsewhere.
- GammaDistribution allows α, β, and γ to be any positive real numbers and μ to be any real number.
- GammaDistribution allows β and μ to be any quantities of the same unit dimensions, and α, γ to be dimensionless quantities. »
- GammaDistribution can be used with such functions as Mean, CDF, and RandomVariate. »
Background & Context
- GammaDistribution[α,β,γ,μ] represents a continuous statistical distribution defined over the interval
and parametrized by a real number μ (called a "location parameter"), two positive real numbers α and γ (called "shape parameters") and a positive real number β (called a "scale parameter"). The parameter μ determines the horizontal location of the probability density function (PDF) of the gamma distribution. The shape of the PDF is entirely dependent upon the combination of values taken by α, β, and γ and may be either unimodal or monotonically decreasing, with a potential singularity approaching the lower boundary of its domain. In addition, the tails of the PDF are "thin", in the sense that the PDF decreases exponentially for large values of
. (This behavior can be made quantitatively precise by analyzing the SurvivalFunction of the distribution.) The four-parameter version is sometimes referred to as the generalized gamma distribution, while the two-parameter form GammaDistribution[α,β] (which is equivalent to GammaDistribution[α,β,1,0]) is often referred to as "the" gamma distribution.
- The (two-parameter) gamma distribution dates back to the 1830s work of Laplace, who obtained it as a posterior conjugate prior to distribution for the precision of normal variates, though the generalizations to three- and four-parameter forms can be traced back to Liouville's work on the Dirichlet integral formula. The name of the gamma distribution derives from the presence of the gamma function in its PDF. The gamma distribution is used to model a number of quantities across various fields. In statistics, the gamma distribution is the distribution associated with the sum of squares of independent unit normal variables and has been used to approximate the distribution of positive definite quadratic forms (i.e. those having the form
) in multinormally distributed variables. The gamma distribution has also been used in many other fields, including meteorology, mathematical finance, statistical ecology, population dynamics, genomics, neuroscience, and actuarial science.
- RandomVariate can be used to give one or more machine- or arbitrary-precision (the latter via the WorkingPrecision option) pseudorandom variates from a gamma distribution. Distributed[x,GammaDistribution[α,β,γ,μ]], written more concisely as xGammaDistribution[α,β,γ,μ], can be used to assert that a random variable x is distributed according to a gamma distribution. Such an assertion can then be used in functions such as Probability, NProbability, Expectation, and NExpectation.
- The probability density and cumulative distribution functions may be given using PDF[GammaDistribution[α,β,γ,μ],x] and CDF[GammaDistribution[α,β,γ,μ],x]. The mean, median, variance, raw moments, and central moments may be computed using Mean, Median, Variance, Moment, and CentralMoment, respectively.
- DistributionFitTest can be used to test if a given dataset is consistent with a gamma distribution, EstimatedDistribution to estimate a gamma parametric distribution from given data, and FindDistributionParameters to fit data to a gamma distribution. ProbabilityPlot can be used to generate a plot of the CDF of given data against the CDF of a symbolic gamma distribution and QuantilePlot to generate a plot of the quantiles of given data against the quantiles of a symbolic gamma distribution.
- TransformedDistribution can be used to represent a transformed gamma distribution, CensoredDistribution to represent the distribution of values censored between upper and lower values, and TruncatedDistribution to represent the distribution of values truncated between upper and lower values. CopulaDistribution can be used to build higher-dimensional distributions that contain a gamma distribution, and ProductDistribution can be used to compute a joint distribution with independent component distributions involving gamma distributions.
- The gamma distribution is related to several other distributions. As previously noted, GammaDistribution is firmly rooted in its relationship to NormalDistribution and MultinormalDistribution and is the conjugate prior (in Bayesian inference) to a handful of distributions, including PoissonDistribution, NormalDistribution, ExponentialDistribution, and GompertzMakehamDistribution. GammaDistribution generalizes ChiSquareDistribution (the PDF of GammaDistribution[ν/2,
,2,0] is the same as that of ChiSquareDistribution[ν]), ExponentialDistribution (the PDF of ExponentialDistribution[1/λ] is the same as that of GammaDistribution[1,λ]), and MaxwellDistribution (the PDF of MaxwellDistribution[σ] is precisely the same as GammaDistribution[3/2,
σ,2,0]). It can be transformed to obtain distributions such as InverseGammaDistribution, MoyalDistribution, and LogGammaDistribution. GammaDistribution is also related to PearsonDistribution, ErlangDistribution, BetaDistribution, ExpGammaDistribution, RayleighDistribution, ChiDistribution, WeibullDistribution, and StudentTDistribution.
Examples
open allclose allBasic Examples (8)Summary of the most common use cases
Probability density function of a gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-jgw0ur


https://wolfram.com/xid/0g7i85n6c86-46x0tj


https://wolfram.com/xid/0g7i85n6c86-5k5ir5

Cumulative distribution function of a gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-0gdx3h


https://wolfram.com/xid/0g7i85n6c86-wn1d14


https://wolfram.com/xid/0g7i85n6c86-pxmuhh

Mean and variance of a gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-wdk


https://wolfram.com/xid/0g7i85n6c86-r2d

Median of a gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-jpc9ef

Probability density function of a generalized gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-xm25ss


https://wolfram.com/xid/0g7i85n6c86-x7nrjq


https://wolfram.com/xid/0g7i85n6c86-1ydlgx

Cumulative distribution function of a generalized gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-3rcwk7


https://wolfram.com/xid/0g7i85n6c86-zfgyku


https://wolfram.com/xid/0g7i85n6c86-odto6g

Mean and variance of a generalized gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-hdr8qb


https://wolfram.com/xid/0g7i85n6c86-y3azkg

Median of a generalized gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-f28src

Scope (12)Survey of the scope of standard use cases
Generate a sample of pseudorandom numbers from a gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-qhtk5j
Compare its histogram to the PDF:

https://wolfram.com/xid/0g7i85n6c86-03mwaz

Generate a set of pseudorandom numbers that have generalized gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-wrjnbe
Compare its histogram to the PDF:

https://wolfram.com/xid/0g7i85n6c86-jxitl8

Distribution parameters estimation:

https://wolfram.com/xid/0g7i85n6c86-45b7g2
Estimate the distribution parameters from sample data:

https://wolfram.com/xid/0g7i85n6c86-epi747

Compare the density histogram of the sample with the PDF of the estimated distribution:

https://wolfram.com/xid/0g7i85n6c86-f8ui5o

Skewness depends only on the shape parameters α and γ:

https://wolfram.com/xid/0g7i85n6c86-dkwm33

Skewness of gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-smp

In the limit, gamma distribution becomes symmetric:

https://wolfram.com/xid/0g7i85n6c86-k422in

Skewness of generalized gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-ek34pv

Kurtosis depends only on the shape parameters α and γ:

https://wolfram.com/xid/0g7i85n6c86-9igkqq

Kurtosis of gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-qke

In the limit kurtosis nears the kurtosis of NormalDistribution:

https://wolfram.com/xid/0g7i85n6c86-bnpxuo

Kurtosis of generalized gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-yz2fre

Different moments with closed forms as functions of parameters:

https://wolfram.com/xid/0g7i85n6c86-js043h

https://wolfram.com/xid/0g7i85n6c86-rx074o

Closed form for symbolic order:

https://wolfram.com/xid/0g7i85n6c86-xo1fnb


https://wolfram.com/xid/0g7i85n6c86-pknsqa

Closed form for symbolic order:

https://wolfram.com/xid/0g7i85n6c86-o5ehui


https://wolfram.com/xid/0g7i85n6c86-zg9ct4


https://wolfram.com/xid/0g7i85n6c86-9gzmth

Closed form for symbolic order:

https://wolfram.com/xid/0g7i85n6c86-t1zkc3

Different moments of generalized gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-f4yfjm

https://wolfram.com/xid/0g7i85n6c86-xqhud7


https://wolfram.com/xid/0g7i85n6c86-5udluv


https://wolfram.com/xid/0g7i85n6c86-z5zkug


https://wolfram.com/xid/0g7i85n6c86-kshtug

Hazard function of a gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-w9468z


https://wolfram.com/xid/0g7i85n6c86-ggals4


https://wolfram.com/xid/0g7i85n6c86-l4cfan


https://wolfram.com/xid/0g7i85n6c86-nre5li

Hazard function of a generalized gamma distribution with :

https://wolfram.com/xid/0g7i85n6c86-q3hboz


https://wolfram.com/xid/0g7i85n6c86-clzwrp

Quantile function of a gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-tp9xac


https://wolfram.com/xid/0g7i85n6c86-jm6ggb


https://wolfram.com/xid/0g7i85n6c86-s0begi

Quantile function of a generalized gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-t8khg4


https://wolfram.com/xid/0g7i85n6c86-mcaxii

Consistent use of Quantity in parameters yields QuantityDistribution:

https://wolfram.com/xid/0g7i85n6c86-grnpzf


https://wolfram.com/xid/0g7i85n6c86-8tfiv

Applications (6)Sample problems that can be solved with this function
The lifetime of a device has gamma distribution. Find the reliability of the device:

https://wolfram.com/xid/0g7i85n6c86-4m8ue6

The hazard function increasing in time for :

https://wolfram.com/xid/0g7i85n6c86-xz8iwk

Find the reliability of two such devices in series:

https://wolfram.com/xid/0g7i85n6c86-xfhpfa

Find the reliability of two such devices in parallel:

https://wolfram.com/xid/0g7i85n6c86-7trpvs

Compare the reliability of both systems for and
:

https://wolfram.com/xid/0g7i85n6c86-qqswjr

A device has three lifetime stages: A, B, and C. The time spent in each phase follows an exponential distribution with a mean time of 10 hours; after phase C, a failure occurs. Find the distribution of the time to failure of this device:

https://wolfram.com/xid/0g7i85n6c86-5i8qj1


https://wolfram.com/xid/0g7i85n6c86-5ya45a

Find the mean time to failure:

https://wolfram.com/xid/0g7i85n6c86-q2gtyu

Find the probability that such a device would be operational for at least 40 hours:

https://wolfram.com/xid/0g7i85n6c86-unvo2d


https://wolfram.com/xid/0g7i85n6c86-2qc2wn

Simulate time to failure for 30 independent devices:

https://wolfram.com/xid/0g7i85n6c86-rmigql

In the morning rush hour, customers enter a coffee shop at a rate of 8 customers every 10 minutes. The time between customer arrivals follows an exponential distribution and the time between arrivals follows a GammaDistribution[k,1/λ] distribution. Find the probability of at least 40 customers arriving in 45 minutes:

https://wolfram.com/xid/0g7i85n6c86-feq10c

Find the average waiting time until the 40 customer arrives:

https://wolfram.com/xid/0g7i85n6c86-kq8n70

Find the probability that the time until the 40 customer arrives is at least 1 hour:

https://wolfram.com/xid/0g7i85n6c86-ic4mj

Simulate the waiting time until the 40 customer arrives during rush hour over 30 days:

https://wolfram.com/xid/0g7i85n6c86-c1wlwk

Mixtures of gamma distributions can be used to model multimodal data:

https://wolfram.com/xid/0g7i85n6c86-z240sm


https://wolfram.com/xid/0g7i85n6c86-oc3rab

Histogram of waiting times for eruptions of the Old Faithful geyser exhibits two modes:

https://wolfram.com/xid/0g7i85n6c86-uza3m3

Fit a MixtureDistribution to the data:

https://wolfram.com/xid/0g7i85n6c86-ywlicz

https://wolfram.com/xid/0g7i85n6c86-4l1127


https://wolfram.com/xid/0g7i85n6c86-xnf1zt

Compare the histogram to the PDF of estimated distribution:

https://wolfram.com/xid/0g7i85n6c86-jj3do1

Find the probability that the waiting time is over 80 minutes:

https://wolfram.com/xid/0g7i85n6c86-34sioc


https://wolfram.com/xid/0g7i85n6c86-clhrkj

Find most common waiting times:

https://wolfram.com/xid/0g7i85n6c86-pzqe67

Simulate waiting times for the next 60 eruptions:

https://wolfram.com/xid/0g7i85n6c86-rym6x3

https://wolfram.com/xid/0g7i85n6c86-ekk8we

LogNormalDistribution data can be modeled by a gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-fg63nf

https://wolfram.com/xid/0g7i85n6c86-jsaju

Compare the histogram to the PDF of estimated distribution:

https://wolfram.com/xid/0g7i85n6c86-ryv8f6

Comparing log-likelihoods with estimation by lognormal distribution:

https://wolfram.com/xid/0g7i85n6c86-156q9b


https://wolfram.com/xid/0g7i85n6c86-2fsujd

Stacy distribution is a special case of generalized GammaDistribution:

https://wolfram.com/xid/0g7i85n6c86-xfuj29

https://wolfram.com/xid/0g7i85n6c86-pn3d0k


https://wolfram.com/xid/0g7i85n6c86-2h7lw

Properties & Relations (32)Properties of the function, and connections to other functions
Gamma distribution is closed under scaling by a positive factor:

https://wolfram.com/xid/0g7i85n6c86-mbvwxc

Generalized gamma distribution is closed under translation and scaling by a positive factor:

https://wolfram.com/xid/0g7i85n6c86-zb8rju

Gamma distribution is closed under addition:

https://wolfram.com/xid/0g7i85n6c86-9aifwc

For identically distributed variables:

https://wolfram.com/xid/0g7i85n6c86-724t15


https://wolfram.com/xid/0g7i85n6c86-2bavp5


https://wolfram.com/xid/0g7i85n6c86-niknri

GammaDistribution[α,β] converges to a normal distribution as α->∞:

https://wolfram.com/xid/0g7i85n6c86-gf5dne


https://wolfram.com/xid/0g7i85n6c86-dxb20o

Relationships to other distributions:

ChiSquareDistribution is a special case of gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-n5r


https://wolfram.com/xid/0g7i85n6c86-d3eh0g


https://wolfram.com/xid/0g7i85n6c86-36fjyi

Scaled ChiSquareDistribution follows gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-mxcd7c

ChiDistribution is a special case of GammaDistribution:

https://wolfram.com/xid/0g7i85n6c86-9lmra4


https://wolfram.com/xid/0g7i85n6c86-zsx0sz


https://wolfram.com/xid/0g7i85n6c86-gp649d

ExponentialDistribution is a special case of gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-my7xgl


https://wolfram.com/xid/0g7i85n6c86-0my6az


https://wolfram.com/xid/0g7i85n6c86-ejuasl

Sum of variates from ExponentialDistribution has gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-jxz6or


https://wolfram.com/xid/0g7i85n6c86-pklxrb


https://wolfram.com/xid/0g7i85n6c86-rszauw


https://wolfram.com/xid/0g7i85n6c86-1ay9ln

Gamma distribution and InverseGammaDistribution have an inverse relationship:

https://wolfram.com/xid/0g7i85n6c86-dnmum3

https://wolfram.com/xid/0g7i85n6c86-fgdsyu


https://wolfram.com/xid/0g7i85n6c86-bfhwph


https://wolfram.com/xid/0g7i85n6c86-b8s9et

The generalized gamma distribution simplifies to a gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-n50t29


https://wolfram.com/xid/0g7i85n6c86-bj6kpc


https://wolfram.com/xid/0g7i85n6c86-l49kr

MaxwellDistribution is a special case of GammaDistribution:

https://wolfram.com/xid/0g7i85n6c86-uv8mbt


https://wolfram.com/xid/0g7i85n6c86-izjymu


https://wolfram.com/xid/0g7i85n6c86-1vzh66

MoyalDistribution is a transformation of a GammaDistribution:

https://wolfram.com/xid/0g7i85n6c86-visqwi

https://wolfram.com/xid/0g7i85n6c86-6cbn85


https://wolfram.com/xid/0g7i85n6c86-03w6mi


https://wolfram.com/xid/0g7i85n6c86-dv9mgp

RayleighDistribution is a special case of GammaDistribution:

https://wolfram.com/xid/0g7i85n6c86-i22zjc


https://wolfram.com/xid/0g7i85n6c86-d75cft


https://wolfram.com/xid/0g7i85n6c86-ik1ogt

NakagamiDistribution is a special case of GammaDistribution:

https://wolfram.com/xid/0g7i85n6c86-qa07k7


https://wolfram.com/xid/0g7i85n6c86-11xhvn


https://wolfram.com/xid/0g7i85n6c86-yhulqh

WeibullDistribution is a special case of generalized gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-1ym5gs


https://wolfram.com/xid/0g7i85n6c86-nn5fw


https://wolfram.com/xid/0g7i85n6c86-ksry65

HalfNormalDistribution is a special case of generalized gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-u0fr2w


https://wolfram.com/xid/0g7i85n6c86-bvjfbm


https://wolfram.com/xid/0g7i85n6c86-dx1m1z

Generalized gamma distribution can be obtained as a transformation from gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-emg0q9


https://wolfram.com/xid/0g7i85n6c86-kvgv5g


https://wolfram.com/xid/0g7i85n6c86-nzanrl

ErlangDistribution is a special case of gamma distribution:

https://wolfram.com/xid/0g7i85n6c86-1itjbf


https://wolfram.com/xid/0g7i85n6c86-brty7o


https://wolfram.com/xid/0g7i85n6c86-daqy8z

Gamma distribution is related to LogGammaDistribution:

https://wolfram.com/xid/0g7i85n6c86-hsuq8g

https://wolfram.com/xid/0g7i85n6c86-1et4jg


https://wolfram.com/xid/0g7i85n6c86-lgm52b


https://wolfram.com/xid/0g7i85n6c86-u24x8k

GammaDistribution is related to ExpGammaDistribution:

https://wolfram.com/xid/0g7i85n6c86-16lit8

https://wolfram.com/xid/0g7i85n6c86-82qxqd


https://wolfram.com/xid/0g7i85n6c86-ntchhx


https://wolfram.com/xid/0g7i85n6c86-jyf6rv

BetaPrimeDistribution can be obtained as a quotient of generalized GammaDistribution:

https://wolfram.com/xid/0g7i85n6c86-i5cosi

ParetoDistribution can be obtained as a quotient of GammaDistribution:

https://wolfram.com/xid/0g7i85n6c86-8i6sh8

GammaDistribution is a special case of type 3 PearsonDistribution:

https://wolfram.com/xid/0g7i85n6c86-yh1j16


https://wolfram.com/xid/0g7i85n6c86-bcxz8w


https://wolfram.com/xid/0g7i85n6c86-sk48d6

BetaDistribution can be obtained as a transformation of two independent gamma variables:

https://wolfram.com/xid/0g7i85n6c86-cxy6u

KDistribution can be obtained from ExponentialDistribution and GammaDistribution:

https://wolfram.com/xid/0g7i85n6c86-4n5qhk

Difference of gamma distributions follows VarianceGammaDistribution:

https://wolfram.com/xid/0g7i85n6c86-n7odkt

KDistribution can be represented as a parameter mixture of RayleighDistribution and GammaDistribution:

https://wolfram.com/xid/0g7i85n6c86-rp7do3

NegativeBinomialDistribution is a mixture of PoissonDistribution and GammaDistribution:

https://wolfram.com/xid/0g7i85n6c86-qkgjoa

GeometricDistribution is a mixture of PoissonDistribution and GammaDistribution:

https://wolfram.com/xid/0g7i85n6c86-rbh64k

StudentTDistribution is a parameter mixture of a NormalDistribution with GammaDistribution:

https://wolfram.com/xid/0g7i85n6c86-r3i4sw

ParetoDistribution can be obtained as a quotient of ExponentialDistribution and GammaDistribution:

https://wolfram.com/xid/0g7i85n6c86-gruq01

https://wolfram.com/xid/0g7i85n6c86-lvqs29


https://wolfram.com/xid/0g7i85n6c86-eh4z3p


https://wolfram.com/xid/0g7i85n6c86-7r8hq7

Possible Issues (2)Common pitfalls and unexpected behavior
GammaDistribution is not defined when either α or β is not a positive real number:

https://wolfram.com/xid/0g7i85n6c86-ebk


Substitution of invalid parameters into symbolic outputs gives results that are not meaningful:

https://wolfram.com/xid/0g7i85n6c86-t70

Wolfram Research (2007), GammaDistribution, Wolfram Language function, https://reference.wolfram.com/language/ref/GammaDistribution.html (updated 2016).
Text
Wolfram Research (2007), GammaDistribution, Wolfram Language function, https://reference.wolfram.com/language/ref/GammaDistribution.html (updated 2016).
Wolfram Research (2007), GammaDistribution, Wolfram Language function, https://reference.wolfram.com/language/ref/GammaDistribution.html (updated 2016).
CMS
Wolfram Language. 2007. "GammaDistribution." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/GammaDistribution.html.
Wolfram Language. 2007. "GammaDistribution." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/GammaDistribution.html.
APA
Wolfram Language. (2007). GammaDistribution. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GammaDistribution.html
Wolfram Language. (2007). GammaDistribution. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GammaDistribution.html
BibTeX
@misc{reference.wolfram_2025_gammadistribution, author="Wolfram Research", title="{GammaDistribution}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/GammaDistribution.html}", note=[Accessed: 29-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_gammadistribution, organization={Wolfram Research}, title={GammaDistribution}, year={2016}, url={https://reference.wolfram.com/language/ref/GammaDistribution.html}, note=[Accessed: 29-March-2025
]}