Parameters Probability density function ${\displaystyle a>0}$ (scale), ${\displaystyle d,p>0}$ ${\displaystyle x\;\in \;(0,\,\infty )}$ ${\displaystyle {\frac {p/a^{d)){\Gamma (d/p)))x^{d-1}e^{-(x/a)^{p))}$ ${\displaystyle {\frac {\gamma (d/p,(x/a)^{p})}{\Gamma (d/p)))}$ ${\displaystyle a{\frac {\Gamma ((d+1)/p)}{\Gamma (d/p)))}$ ${\displaystyle a\left({\frac {d-1}{p))\right)^{\frac {1}{p))\mathrm {for} \;d>1,\mathrm {otherwise} \;0}$ ${\displaystyle a^{2}\left({\frac {\Gamma ((d+2)/p)}{\Gamma (d/p)))-\left({\frac {\Gamma ((d+1)/p)}{\Gamma (d/p)))\right)^{2}\right)}$ ${\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)}$

The generalized gamma distribution is a continuous probability distribution with three parameters. It is a generalization of the two-parameter gamma distribution. 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 three parameters: ${\displaystyle a>0}$, ${\displaystyle d>0}$, and ${\displaystyle p>0}$. For non-negative x from a generalized gamma distribution, the probability density function is[2]

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

where ${\displaystyle \Gamma (\cdot )}$ denotes the gamma function.

${\displaystyle F(x;a,d,p)={\frac {\gamma (d/p,(x/a)^{p})}{\Gamma (d/p))),}$

where ${\displaystyle \gamma (\cdot )}$ denotes the lower incomplete gamma function.

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

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

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

## Related distributions

• If ${\displaystyle d=p}$ then the generalized gamma distribution becomes the Weibull distribution.
• If ${\displaystyle p=1}$ the generalised gamma becomes the gamma distribution.
• If ${\displaystyle p=d=1}$ then it becomes the exponential distribution.
• If ${\displaystyle p=2}$ and ${\displaystyle d=2m}$ then it becomes the Nakagami distribution.
• If ${\displaystyle p=2}$ and ${\displaystyle d=1}$ then it becomes a half-normal distribution.

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]

${\displaystyle \operatorname {E} (X^{r})=a^{r}{\frac {\Gamma ({\frac {d+r}{p)))}{\Gamma ({\frac {d}{p))))).}$

## Properties

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

## Kullback-Leibler divergence

If ${\displaystyle f_{1))$ and ${\displaystyle f_{2))$ are the probability density functions of two generalized gamma distributions, then their Kullback-Leibler divergence is given by

{\displaystyle {\begin{aligned}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{aligned))}

where ${\displaystyle \psi (\cdot )}$ 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: ${\displaystyle \mu =\ln a+{\frac {\ln d-\ln p}{p))}$, ${\displaystyle \sigma ={\frac {1}{\sqrt {pd))))$, ${\displaystyle Q={\sqrt {\frac {p}{d))))$, and in the package ggamma with parametrisation ${\displaystyle a=a}$, ${\displaystyle b=p}$, ${\displaystyle k=d/p}$.