Generalized gamma distribution

From HandWiki
Short description: Probability Distribution
Generalized gamma
Probability density function
Gen Gamma PDF plot
Parameters [math]\displaystyle{ a\gt 0 }[/math] (scale), [math]\displaystyle{ d, p \gt 0 }[/math]
Support [math]\displaystyle{ x \;\in\; (0,\, \infty) }[/math]
PDF [math]\displaystyle{ \frac{p/a^d}{\Gamma(d/p)} x^{d-1}e^{-(x/a)^p} }[/math]
CDF [math]\displaystyle{ \frac{\gamma(d/p, (x/a)^p)}{\Gamma(d/p)} }[/math]
Mean [math]\displaystyle{ a \frac{\Gamma((d+1)/p)}{\Gamma(d/p)} }[/math]
Mode [math]\displaystyle{ a \left(\frac{d-1}{p}\right)^{\frac{1}{p}} \mathrm{for}\; d\gt 1, \mathrm{otherwise}\; 0 }[/math]
Variance [math]\displaystyle{ a^2\left(\frac{\Gamma((d+2)/p)}{\Gamma(d/p)} - \left(\frac{\Gamma((d+1)/p)}{\Gamma(d/p)}\right)^2\right) }[/math]
Entropy [math]\displaystyle{ \ln \frac{a \Gamma(d/p)}{p} + \frac{d}{p} + \left(\frac{1}{p}-\frac{d}{p}\right)\psi\left(\frac{d}{p}\right) }[/math]

The generalized gamma distribution is a continuous probability distribution with two shape parameters (and a scale parameter). It is a generalization of the gamma distribution which has one shape parameter (and a scale parameter). Since many distributions commonly used for parametric models in survival analysis (such as the exponential distribution, the Weibull distribution and the gamma distribution) are special cases of the generalized gamma, it is sometimes used to determine which parametric model is appropriate for a given set of data.[1] Another example is the half-normal distribution.

Characteristics

The generalized gamma distribution has two shape parameters, [math]\displaystyle{ d \gt 0 }[/math] and [math]\displaystyle{ p \gt 0 }[/math], and a scale parameter, [math]\displaystyle{ a \gt 0 }[/math]. For non-negative x from a generalized gamma distribution, the probability density function is[2]

[math]\displaystyle{ f(x; a, d, p) = \frac{(p /a^d) x^{d-1} e^{-(x/a)^p}}{\Gamma(d/p)}, }[/math]

where [math]\displaystyle{ \Gamma(\cdot) }[/math] denotes the gamma function.

The cumulative distribution function is

[math]\displaystyle{ F(x; a, d, p) = \frac{\gamma(d/p, (x/a)^p)}{\Gamma(d/p)} , \text{or} \, P\left( \frac{d}{p}, \left( \frac{x}{a} \right)^p \right) ; }[/math]

where [math]\displaystyle{ \gamma(\cdot) }[/math] denotes the lower incomplete gamma function, and [math]\displaystyle{ P(\cdot, \cdot) }[/math] denotes the regularized lower incomplete gamma function.

The quantile function can be found by noting that [math]\displaystyle{ F(x; a, d, p) = G((x/a)^p) }[/math] where [math]\displaystyle{ G }[/math] is the cumulative distribution function of the gamma distribution with parameters [math]\displaystyle{ \alpha = d/p }[/math] and [math]\displaystyle{ \beta = 1 }[/math]. The quantile function is then given by inverting [math]\displaystyle{ F }[/math] using known relations about inverse of composite functions, yielding:

[math]\displaystyle{ F^{-1}(q; a, d, p) = a \cdot \big[ G^{-1}(q) \big]^{1/p}, }[/math]

with [math]\displaystyle{ G^{-1}(q) }[/math] being the quantile function for a gamma distribution with [math]\displaystyle{ \alpha = d/p,\, \beta = 1 }[/math].

Related distributions

Alternative parameterisations of this distribution are sometimes used; for example with the substitution α  =   d/p.[3] In addition, a shift parameter can be added, so the domain of x starts at some value other than zero.[3] If the restrictions on the signs of a, d and p are also lifted (but α = d/p remains positive), this gives a distribution called the Amoroso distribution, after the Italian mathematician and economist Luigi Amoroso who described it in 1925.[4]

Moments

If X has a generalized gamma distribution as above, then[3]

[math]\displaystyle{ \operatorname{E}(X^r)= a^r \frac{\Gamma (\frac{d+r}{p})}{\Gamma( \frac{d}{p})} . }[/math]

Properties

Denote GG(a,d,p) as the generalized gamma distribution of parameters a, d, p. Then, given [math]\displaystyle{ c }[/math] and [math]\displaystyle{ \alpha }[/math] two positive real numbers, if [math]\displaystyle{ f \sim GG(a,d,p) }[/math], then [math]\displaystyle{ c f\sim GG(c a,d,p) }[/math] and [math]\displaystyle{ f^\alpha\sim GG\left(a^\alpha,\frac{d}{\alpha},\frac{p}{\alpha}\right) }[/math].

Kullback-Leibler divergence

If [math]\displaystyle{ f_1 }[/math] and [math]\displaystyle{ f_2 }[/math] are the probability density functions of two generalized gamma distributions, then their Kullback-Leibler divergence is given by

[math]\displaystyle{ \begin{align} D_{KL} (f_1 \parallel f_2) & = \int_{0}^{\infty} f_1(x; a_1, d_1, p_1) \, \ln \frac{f_1(x; a_1, d_1, p_1)}{f_2(x; a_2, d_2, p_2)} \, dx\\ & = \ln \frac{p_1 \, a_2^{d_2} \, \Gamma\left(d_2 / p_2\right)}{p_2 \, a_1^{d_1} \, \Gamma\left(d_1 /p_1\right)} + \left[ \frac{\psi\left( d_1 / p_1 \right)}{p_1} + \ln a_1 \right] (d_1 - d_2) + \frac{\Gamma\bigl((d_1+p_2) / p_1 \bigr)}{\Gamma\left(d_1 / p_1\right)} \left( \frac{a_1}{a_2} \right)^{p_2} - \frac{d_1}{p_1} \end{align} }[/math]

where [math]\displaystyle{ \psi(\cdot) }[/math] is the digamma function.[5]

Software implementation

In the R programming language, there are a few packages that include functions for fitting and generating generalized gamma distributions. The gamlss package in R allows for fitting and generating many different distribution families including generalized gamma (family=GG). Other options in R, implemented in the package flexsurv, include the function dgengamma, with parameterization: [math]\displaystyle{ \mu=\ln a + \frac{\ln d - \ln p}{p} }[/math], [math]\displaystyle{ \sigma=\frac{1}{\sqrt{pd}} }[/math], [math]\displaystyle{ Q=\sqrt{\frac{p}{d}} }[/math], and in the package ggamma with parametrisation: [math]\displaystyle{ a = a }[/math], [math]\displaystyle{ b = p }[/math], [math]\displaystyle{ k = d/p }[/math].

In the python programming language, it is implemented in the SciPy package, with parametrisation: [math]\displaystyle{ c = p }[/math], [math]\displaystyle{ a = d/p }[/math], and scale of 1.

See also

References

  1. Box-Steffensmeier, Janet M.; Jones, Bradford S. (2004) Event History Modeling: A Guide for Social Scientists. Cambridge University Press. ISBN:0-521-54673-7 (pp. 41-43)
  2. Stacy, E.W. (1962). "A Generalization of the Gamma Distribution." Annals of Mathematical Statistics 33(3): 1187-1192. JSTOR 2237889
  3. 3.0 3.1 3.2 Johnson, N.L.; Kotz, S; Balakrishnan, N. (1994) Continuous Univariate Distributions, Volume 1, 2nd Edition. Wiley. ISBN:0-471-58495-9 (Section 17.8.7)
  4. Gavin E. Crooks (2010), The Amoroso Distribution, Technical Note, Lawrence Berkeley National Laboratory.
  5. C. Bauckhage (2014), Computing the Kullback-Leibler Divergence between two Generalized Gamma Distributions, arXiv:1401.6853.