# Generalized integer gamma distribution

In probability and statistics, the generalized integer gamma distribution (GIG) is the distribution of the sum of independent gamma distributed random variables, all with integer shape parameters and different rate parameters. This is a special case of the generalized chi-squared distribution. A related concept is the generalized near-integer gamma distribution (GNIG).

## Definition

The random variable $X\!$ has a gamma distribution with shape parameter $r$ and rate parameter $\lambda$ if its probability density function is
    $f_{X}^(x)={\frac {\lambda ^{r}}{\Gamma (r)}}\,e^{-\lambda x}x^{r-1}~~~~~~(x>0;\,\lambda ,r>0)$
and this fact is denoted by $X\sim \Gamma (r,\lambda )\!.$
Let $X_{j}\sim \Gamma (r_{j},\lambda _{j})\!$, where $(j=1,\dots ,p),$ be $p$ independent random variables, with all $r_{j}$ being positive integers and all $\lambda _{j}\!$ different. In other words, each variable has the Erlang distribution with different shape parameters. The uniqueness of each shape parameter comes without loss of generality, because any case where some of the $\lambda _{j}$ are equal would be treated by first adding the corresponding variables: this sum would have a gamma distribution with the same rate parameter and a shape parameter which is equal to the sum of the shape parameters in the original distributions.
Then the random variable Y defined by
    $Y=\sum _{j=1}^{p}X_{j}$
has a GIG (generalized integer gamma) distribution of depth $p$ with shape parameters $r_{j}\!$ and rate parameters $\lambda _{j}\!$ $(j=1,\dots ,p)$. This fact is denoted by
    $Y\sim GIG(r_{j},\lambda _{j};p)\!.$
It is also a special case of the generalized chi-squared distribution.

### Properties

The probability density function and the cumulative distribution function of Y are respectively given by
    $f_{Y}^{\text{GIG}}(y|r_{1},\dots ,r_{p};\lambda _{1},\dots ,\lambda _{p})\,=\,K\sum _{j=1}^{p}P_{j}(y)\,e^{-\lambda _{j}\,y}\,,~~~~(y>0)$
and
    $F_{Y}^{\text{GIG}}(y|r_{1},\dots ,r_{p};\lambda _{1},\dots ,\lambda _{p})\,=\,1-K\sum _{j=1}^{p}P_{j}^{*}(y)\,e^{-\lambda _{j}\,y}\,,~~~~(y>0)$
where
    $K=\prod _{j=1}^{p}\lambda _{j}^{r_{j}}~,~~~~~P_{j}(y)=\sum _{k=1}^{r_{j}}c_{j,k}\,y^{k-1}$
and
    $P_{j}^{*}(y)=\sum _{k=1}^{r_{j}}c_{j,k}\,(k-1)!\sum _{i=0}^{k-1}{\frac {y^{i}}{i!\,\lambda _{j}^{k-i}}}$
with
| $c_{j,r_{j}}={\frac {1}{(r_{j}-1)!}}\,\mathop {\prod _{i=1}^{p}} _{i\neq j}(\lambda _{i}-\lambda _{j})^{-r_{i}}~,~~~~~~j=1,\ldots ,p\,,$ | (1) |
and
| $c_{j,r_{j}-k}={\frac {1}{k}}\sum _{i=1}^{k}{\frac {(r_{j}-k+i-1)!}{(r_{j}-k-1)!}}\,R(i,j,p)\,c_{j,r_{j}-(k-i)}\,,~~~~~~(k=1,\ldots ,r_{j}-1;\,j=1,\ldots ,p)$ | (2) |
where
| $R(i,j,p)=\mathop {\sum _{k=1}^{p}} _{k\neq j}r_{k}\left(\lambda _{j}-\lambda _{k}\right)^{-i}~~~(i=1,\ldots ,r_{j}-1)\,.$ | (3) |
Alternative expressions are available in the literature on generalized chi-squared distribution, which is a field where computer algorithms have been available for some years.

## Generalization

The GNIG (generalized near-integer gamma) distribution of depth $p+1$ is the distribution of the random variable
    $Z=Y_{1}+Y_{2}\!,$
where $Y_{1}\sim GIG(r_{j},\lambda _{j};p)\!$ and $Y_{2}\sim \Gamma (r,\lambda )\!$ are two independent random variables, where $r$ is a positive non-integer real and where $\lambda \neq \lambda _{j}$ $(j=1,\dots ,p)$.

### Properties

The probability density function of $Z\!$ is given by
    ${\begin{array}{l}\displaystyle f_{Z}^{\text{GNIG}}(z|r_{1},\dots ,r_{p},r;\,\lambda _{1},\dots ,\lambda _{p},\lambda )=\\[5pt]\displaystyle \quad \quad \quad K\lambda ^{r}\sum \limits _{j=1}^{p}{e^{-\lambda _{j}z}}\sum \limits _{k=1}^{r_{j}}{\left\{{c_{j,k}{\frac {\Gamma (k)}{\Gamma (k+r)}}z^{k+r-1}_{1}F_{1}(r,k+r,-(\lambda -\lambda _{j})z)}\right\}}{\rm {,}}~~~~(z>0)\end{array}}$
and the cumulative distribution function is given by
    ${\begin{array}{l}\displaystyle F_{Z}^{\text{GNIG}}(z|r_{1},\ldots ,r_{p},r;\,\lambda _{1},\ldots ,\lambda _{p},\lambda )={\frac {\lambda ^{r}\,{z^{r}}}{\Gamma (r+1)}}_{1}F_{1}(r,r+1,-\lambda z)\\[12pt]\quad \quad \displaystyle -K\lambda ^{r}\sum \limits _{j=1}^{p}{e^{-\lambda _{j}z}}\sum \limits _{k=1}^{r_{j}}{c_{j,k}^{*}}\sum \limits _{i=0}^{k-1}{\frac {z^{r+i}\lambda _{j}^{i}}{\Gamma (r+1+i)}}_{1}F_{1}(r,r+1+i,-(\lambda -\lambda _{j})z)~~~~(z>0)\end{array}}$
where
    $c_{j,k}^{*}={\frac {c_{j,k}}{\lambda _{j}^{k}}}\Gamma (k)$
with $c_{j,k}$ given by (1)-(3) above. In the above expressions $_{1}F_{1}(a,b;z)$ is the Kummer confluent hypergeometric function. This function has usually very good convergence properties and is nowadays easily handled by a number of software packages.

## Applications

The GIG and GNIG distributions are the basis for the exact and near-exact distributions of a large number of likelihood ratio test statistics and related statistics used in multivariate analysis. More precisely, this application is usually for the exact and near-exact distributions of the negative logarithm of such statistics. If necessary, it is then easy, through a simple transformation, to obtain the corresponding exact or near-exact distributions for the corresponding likelihood ratio test statistics themselves.
The GIG distribution is also the basis for a number of wrapped distributions in the wrapped gamma family.
As being a special case of the generalized chi-squared distribution, there are many other applications; for example, in renewal theory and in multi-antenna wireless communications.