Gamma
Template:Probability distribution In probability theory and statistics, the gamma distribution is a two-parameter family of continuous probability distributions. It has a scale parameter θ and a shape parameter k. If k is an integer then the distribution represents the sum of k independent exponentially distributed random variables, each of which has a mean of θ (which is equivalent to a rate parameter of θ −1) .
The gamma distribution is frequently a probability model for waiting times; for instance, in life testing, the waiting time until death is a random variable that is frequently modeled with a gamma distribution.<ref>See Hogg and Craig Remark 3.3.1. for an explicit motivation.test</ref> Gamma distributions were fitted to rainfall amounts from different storms, and differences in amounts from seeded and unseeded storms were reflected in differences in estimated k and parameters <ref>Template:Citation</ref>
Characterization
A random variable X that is gamma-distributed with scale θ and shape k is denoted
Probability density function
The probability density function of the gamma distribution can be expressed in terms of the gamma function parameterized in terms of a shape parameter k and scale parameter θ. Both k and θ will be positive values.
The equation defining the probability density function of a gamma-distributed random variable x is
(This parameterization is used in the infobox and the plots.)
Alternatively, the gamma distribution can be parameterized in terms of a shape parameter α = k and an inverse scale parameter β = 1/θ, called a rate parameter:
If α is a positive integer, then
Both parametrizations are common because either can be more convenient depending on the situation.
Cumulative distribution function
The cumulative distribution function is the regularized gamma function:
where is the lower incomplete gamma function.
It can also be expressed as follows, if k is a positive integer (i.e., the distribution is an Erlang distribution)<ref>Papoulis, Pillai, Probability, Random Variables, and Stochastic Processes, Fourth Edition</ref>:
Properties
Summation
If Xi has a Γ(ki, θ) distribution for i = 1, 2, ..., N, then
provided all Xi' are independent.
The gamma distribution exhibits infinite divisibility.
Scaling
If
then for any α > 0,
Exponential family
The Gamma distribution is a two-parameter exponential family with natural parameters k − 1 and −1/θ, and natural statistics X and ln (X).
Information entropy
The information entropy is given by
where ψ(k) is the digamma function.
One can also show that (if we use the shape parameter k and the inverse scale parameter β),
Or alternately, using the scale parameter θ,
Kullback–Leibler divergence
The directed Kullback–Leibler divergence between Γ(θ0, β0) ('true' distribution) and Γ(θ, β) ('approximating' distribution), for shape parameter θ and inverse scale parameter β is given by
Laplace transform
The Laplace transform of the gamma PDF is
Parameter estimation
Maximum likelihood estimation
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:
Substituting this into the log-likelihood function gives
Finding the maximum with respect to k by taking the derivative and setting it equal to zero yields
where
is the digamma function.
There is no closed-form solution for k. 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 k is approximately
which is within 1.5% of the correct value.Template:Fact An explicit form for the Newton-Raphson update of this initial guess is given by Choi and Wette (1969) as the following expression:
where denotes the trigamma function (the derivative of the digamma function).
The digamma and trigamma functions can be difficult to calculate with high precision. However, approximations known to be good to several significant figures can be computed using the following approximation formulae:
and
For details, see Choi and Wette (1969).
Bayesian minimum mean-squared error
With known k and unknown , the posterior PDF for theta (using the standard scale-invariant prior for ) is
Denoting
Integration over θ can be carried out using a change of variables, revealing that 1/θ is gamma-distributed with parameters .
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 theta is
Generating gamma-distributed random variables
Given the scaling property above, it is enough to generate gamma variables with as we can later convert to any value of with simple division.
Using the fact that a distribution is the same as an distribution, and noting the method of generating exponential variables, we conclude that if is uniformly distributed on , then − is distributed . Now, using the "α-addition" property of gamma distribution, we expand this result:
where are all uniformly distributed on and independent.
All that is left now is to generate a variable distributed as for and apply the "α-addition" property once more. This is the most difficult part.
We provide an algorithm without proof. It is an instance of the acceptance-rejection method:
- Let be 1.
- Generate , and as independent uniformly distributed on variables.
- If , where , then go to step 4, else go to step 5.
- Let . Go to step 6.
- Let .
- If , then increment and go to step 2.
- Assume to be the realization of
Now, to summarize,
where is the integral part of , and has been generated using the algorithm above with (the fractional part of ), and are distributed as explained above and are all independent.
Related distributions
Specializations
- If , then X has an exponential distribution with rate parameter λ.
- If , then X is identical to χ2(ν), the chi-square distribution with ν degrees of freedom. Conversely, if and c is a positive constant, then .
- 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 X has a Maxwell-Boltzmann distribution with parameter a.
- , then , i.e. an exponential distribution: see skew-logistic distribution.
Conjugate prior
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 σ, and inverse gamma with known shape parameter.
The Gamma distribution's conjugate prior is <ref name="fink">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).</ref>:
Where Z is the normalizing constant, which has no closed form solution. The posterior distribution can be found by updating the parameters as follows.
,
Where is the number of observations, and is the observation.
Others
- If X has a Γ(k, θ) distribution, then 1/X has an inverse-gamma distribution with parameters k and θ-1.
- If X and Y are independently distributed Γ(α, θ) and Γ(β, θ) respectively, then X / (X + Y) has a beta distribution with parameters α and β.
- If Xi are independently distributed Γ(αi,θ) respectively, then the vector (X1 / S, ..., Xn / S), where S = X1 + ... + Xn, follows a Dirichlet distribution with parameters α1, ..., αn.
- For large k the gamma distribution converges to Gaussian distribution with mean and variance .
- The Gamma distribution is the conjugate prior for the precision of the normal distribution with known mean.
- The Wishart distribution is a multivariate generalization 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.
- Among the discrete distributions, the negative binomial distribution is sometimes considered the discrete analogue of the Gamma distribution
Applications
Template:Expand-section The gamma distribution has been used to model the size of insurance claims and rainfalls. This means aggregate insurance claims and the amount of rainfall accumulated in a reservoir are modelled by a gamma process.
See also
Notes
<references/>
References
- R. V. Hogg and A. T. Craig. Introduction to Mathematical Statistics, 4th edition. New York: Macmillan, 1978. (See Section 3.3.)
- Template:MathWorld
- Engineering Statistics Handbook
- S. C. Choi and R. Wette. (1969) Maximum Likelihood Estimation of the Parameters of the Gamma Distribution and Their Bias, Technometrics, 11(4) 683–690
Template:ProbDistributions Template:Common univariate probability distributions
az:Qamma paylanması ca:Distribució gamma de:Gammaverteilung es:Distribución gamma fa:توزیع گاما fr:Distribution Gamma ko:감마 분포 it:Distribuzione Gamma he:התפלגות גמא hu:Gamma-eloszlás nl:Gamma-verdeling ja:ガンマ分布 pl:Rozkład gamma pt:Distribuição gama ru:Гамма-распределение sl:Porazdelitev gama fi:Gamma-jakauma sv:Gammafördelning tr:Gamma dağılımı uk:Гамма-розподіл zh:伽玛分布