Discover

GAMMA DISTRIBUTION

{{Probability distribution |
name =Gamma|
type =density|
pdf_image =
Probability density plots of gamma distributions
|
cdf_image =
Cumulative distribution plots of gamma distributions
|
parameters =k > 0, shape (real)
heta > 0, scale (real)|
support =x in [0; infty)!|
pdf =x^{k-1} rac{exp{left(-x/ heta
ight)}}{Gamma(k), heta^k},!|
cdf = rac{gamma(k, x/ heta)}{Gamma(k)},!|
mean =k heta,!|
median =no simple closed form|
mode =(k-1) heta,! for k geq 1,! |
variance =k heta^2,!|
skewness = rac{2}{sqrt{k}},!|
kurtosis = rac{6}{k},!|
entropy =k + ln heta + lnGamma(k) !
+ (1-k)psi(k) !|
mgf =(1 - heta,t)^{-k},! for t < 1/ heta,!|
char =(1 - heta,i,t)^{-k},!|
}}
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'' exponentially distributed random variables, each of which has mean ''θ''.

Contents
Characterization
Probability density function
Cumulative distribution function
Properties
Summation
Scaling
Exponential family
Information entropy
Kullback-Leibler divergence
Laplace Transform
Parameter estimation
Maximum likelihood estimation
Bayesian minimum mean-squared error
Generating gamma distributed random variables
Related distributions
Specializations
Others
References
See also

Characterization


A gamma distributed random variable ''X'' with scale ''θ'' and shape ''k'' is denoted
:X sim Gamma(k, heta) ,,mathrm{ or },, X sim extrm{Gamma}(k, heta)
Probability density function

The probability density function of the gamma distribution can be expressed in terms of the gamma function:
: f(x;k, heta) = x^{k-1} rac{e^{-x/ heta}}{ heta^k , Gamma(k)}
mathrm{ for } x > 0,, mathrm{ and },, k, heta > 0.
(This parameterization is used in the infobox and the plots.)
Alternatively, the gamma distribution can be parameterized in terms of a shape parameter lpha = k and an inverse scale parameter eta = 1/ heta, called a rate parameter:
: g(x;lpha,eta) = x^{lpha-1} rac{eta^{lpha} , e^{-eta,x} }{Gamma(lpha)} mathrm{for} x > 0 ,!.
Both parameterizations are common because either can be more convenient depending on the situation.
Cumulative distribution function

The cumulative distribution function can be expressed in terms of the incomplete gamma function,
: F(x;k, heta) = int_0^x f(u;k, heta),du
= rac{gamma(k, x/ heta)}{Gamma(k)} ,!

Properties


Summation

If ''X''i has a Γ(αi, β) distribution for ''i'' = 1, 2, ..., ''N'', then
:
sum_{i=1}^N X_i
sim
Gamma left( sum_{i=1}^N lpha_i, eta
ight) ,!

provided all ''X''i are independent.
The gamma distribution exhibits infinite divisibility.
Scaling

For any ''t'' > 0 it holds that ''tX'' is distributed Γ(''k'', ''t''θ), demonstrating that ''θ'' is a scale parameter.
Exponential family

The Gamma distribution is a two-parameter exponential family with natural parameters k-1 and 1/ heta, and natural statistics X and ln(X).
Information entropy

The information entropy is given by
: rac{-1}{ heta^k Gamma(k)} int_0^{infty} rac{x^{k-1}}{e^{x/ heta}} left[ (k-1)ln x - x/ heta - k ln heta - lnGamma(k)
ight] ,dx !
:: = -left[ (k-1) (ln heta + psi(k)) - k - k ln heta - lnGamma(k)
ight] !
:: = k + ln heta + lnGamma(k) + (1-k)psi(k) !
where ψ(''k'') is the digamma function.
Kullback-Leibler divergence

The directed Kullback-Leibler divergence between Γ(α0, β0) ('true' distribution) and Γ(α, β) ('approximating' distribution) is given by
:
D_{mathrm{KL}}(lpha,eta || lpha_0, eta_0) = logleft( rac{Gamma({lpha_0})eta_0^{lpha_0}}{Gamma(lpha)eta^{lpha_0}}
ight)+(lpha-{lpha_0})psi(lpha)+lpha rac{eta-eta_0}{eta_0}

Laplace Transform

The Laplace transformation of the gamma distribution is
:
F(s)= rac{eta^lpha}{(s+eta)^lpha}

Parameter estimation


Maximum likelihood estimation

The likelihood function for ''N'' iid observations (x_1,ldots,x_N) is
:L( heta)=prod_{i=1}^N f(x_i;k, heta),!
from which we calculate the log-likelihood function
:ell( heta) = (k-1) sum_{i=1}^N ln{(x_i)} - sum x_i/ heta - Nkln{( heta)} - Nln{Gamma(k)}.
Finding the maximum with respect to heta by taking the derivative and setting it equal to zero yields the maximum likelihood estimate of the θ parameter:
:hat{ heta} = rac{1}{kN}sum_{i=1}^N x_i. ,!
Substituting this into the log-likelihood function gives
:ell=(k-1)sum_{i=1}^Nln{(x_i)}-Nk-Nkln{left( rac{sum x_i}{kN}
ight)}-Nln{(Gamma(k))}. ,!
Finding the maximum with respect to ''k'' by taking the derivative and setting it equal to zero yields
:ln{(k)}-psi(k)=ln{left( rac{1}{N}sum_{i=1}^N x_i
ight)}- rac{1}{N}sum_{i=1}^Nln{(x_i)} ,!
where
:psi(k) = rac{Gamma'(k)}{Gamma(k)} !
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
:ln(k)-psi(k) pprox rac{1}{k}left( rac{1}{2} + rac{1}{12k+2}
ight). ,!
If we let
:s = ln{left( rac{1}{N}sum_{i=1}^N x_i
ight)} - rac{1}{N}sum_{i=1}^Nln{(x_i)},,!
then ''k'' is approximately
:k pprox rac{3-s+sqrt{(s-3)^2 + 24s}}{12s}
which is within 1.5% of the correct value. An explicit form for the Newton-Raphson update of this initial guess is given by Choi and Wette (1969) as the following expression:
:k leftarrow k - rac{ ln k - psileft(k
ight) - s }{ 1/k - psi'left(k
ight) }
where psi'left(cdot
ight) 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':
:
psileft(k
ight) = egin{cases}
ln(k) - ( 1 + ( 1 - ( 1/10 - 1 / ( 21 k^2 ) ) / k^2 ) / ( 6 k ) ) / ( 2 k ), quad k geq 8 \
psileft( k + 1
ight) - 1/k, quad k < 8
end{cases}

and
:
psi'left(k
ight) = egin{cases}
( 1 + ( 1 + ( 1 - ( 1/5 - 1 / ( 7 k^2 ) ) / k^2 ) / ( 3 k ) ) / ( 2 k ) ) / k, quad k geq 8, \
psi'left( k + 1
ight) + 1/k^2, quad k < 8.
end{cases}

For details, see Choi and Wette (1969).
Bayesian minimum mean-squared error

With known ''k'' and unknown heta, the posterior PDF for theta (using the standard scale-invariant prior for heta) is
:
P( heta | k, x_1, ..., x_N) propto 1/ heta prod_{i=1}^N f(x_i;k, heta).,!

Denoting
: y equiv sum_{i=1}^N x_i , qquad P( heta | k, x_1, dots , x_N) = C(x_i) heta^{-N k-1} e^{-y / heta}. !
Integration over θ can be carried out using a change of variables, revealing that 1/θ is gamma-distributed with parameters scriptstyle lpha = N k, eta = y.
:
int_0^{infty} heta^{-N k-1+m} e^{-y / heta}, d heta = int_0^{infty} x^{N k -1 -m} e^{-x y} , dx = y^{-(N k -m)} Gamma(N k -m). !

The moments can be computed by taking the ratio (''m'' by ''m'' = 0)
:
E(x^m) = rac {Gamma (N k -m)} {Gamma(N k)} y^m, !

which shows that the mean +/- standard deviation estimate of the posterior distribution for theta is
: rac {y} {N k -1} +/- rac {y^2} {(N k-1)^2 (N k-2)}.

Generating gamma distributed random variables


Given the scaling property above, it is enough to generate gamma variables with ''β'' = 1 as we can later convert to any value of ''β'' with simple division.
Using the fact that a Γ(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 Γ(1, 1).
Now, using the "α-addition" property of gamma distribution, we expand this result:
:sum_{k=1}^n {-ln U_k} sim Gamma(n, 1),
where ''Uk'' are all uniformly distributed on (0, 1] and independent.
All that is left now is to generate a variable distributed as Γ(δ, 1) for 0 < δ < 1
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 ''m'' be 1.
# Generate V_{2m - 1} and V_{2m} — independent uniformly distributed on (0, 1] variables.
# If V_{2m - 1} le v_0, where v_0 = rac e {e + delta}, then go to step 4, else go to step 5.
# Let xi_m = V_{2m - 1}^{1 / delta}, eta_m = V_{2m} xi _m^ {delta - 1}. Go to step 6.
# Let xi_m = 1 - ln {V_{2m - 1}}, eta_m = V_{2m} e^{-xi_m}.
# If eta_m > xi_m^{delta - 1} e^{-xi_m}, then increment ''m'' and go to step 2.
# Assume xi = xi_m to be the realization of Gamma (delta, 1)
Now, to summarize,
: heta left( xi - sum _{i=1} ^{[k]} {ln U_i}
ight) sim Gamma (k, heta),
where
[''k''] is the integral part of ''k'', and ''ξ'' has been generating using the algorithm above with δ = {''k''} (the fractional part of ''k''),
''Uk'' and ''Vl'' are distributed as explained above and are all independent.
The GNU Scientific Library (which has ports for Visual Studio) has robust routines for sampling many distributions including the Gamma distribution.

Related distributions


Specializations


★ If X sim {Gamma}(k=1, heta=1/lambda),, then ''X'' has an exponential distribution with rate parameter λ.

★ If X sim {Gamma}(k=v/2, heta=2),, then ''X'' is identical to χ2(''ν''), the chi-square distribution with ''ν'' degrees of freedom.

★ If k is an integer, the gamma distribution is an Erlang distribution and is the probability distribution of the waiting time until the k-th "arrival" in a one-dimensional Poisson process with intensity 1/θ.

★ If X^2 sim {Gamma}(3/2, 2a^2),, then ''X'' has a Maxwell-Boltzmann distribution with parameter ''a''.

X sim mathrm{SkewLogistic}( heta),, then mathrm{log}(1 + e^{-X}) sim Gamma (1, heta),
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 (''X''1 / ''S'', ..., ''Xn'' / ''S''), where ''S'' = ''X''1 + ... + ''Xn'', follows a Dirichlet distribution with parameters α1, ..., α''n''.

References



★ R. V. Hogg and A. T. Craig. ''Introduction to Mathematical Statistics'', 4th edition. New York: Macmillan, 1978. ''(See Section 3.3.)''



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-69

See also



Phase-type distribution

Hypoexponential distribution

Wishart distribution



This article provided by Wikipedia. To edit the contents of this article, click here for original source.

psst.. try this: add to faves