# Dirichlet negative multinomial distribution

In probability theory and statistics, the Dirichlet negative multinomial distribution is a multivariate distribution on the non-negative integers. It is a multivariate extension of the beta negative binomial distribution. It is also a generalization of the negative multinomial distribution (NM(k, p)) allowing for heterogeneity or overdispersion to the probability vector. It is used in quantitative marketing research to flexibly model the number of household transactions across multiple brands.
If parameters of the Dirichlet distribution are ${\boldsymbol {\alpha }}$, and if
    $X\mid p\sim \operatorname {NM} (x_{0},\mathbf {p} ),$
where
    $\mathbf {p} \sim \operatorname {Dir} (\alpha _{0},{\boldsymbol {\alpha }}),$
then the marginal distribution of X is a Dirichlet negative multinomial distribution:
    $X\sim \operatorname {DNM} (x_{0},\alpha _{0},{\boldsymbol {\alpha }}).$
In the above, $\operatorname {NM} (x_{0},\mathbf {p} )$ is the negative multinomial distribution and $\operatorname {Dir} (\alpha _{0},{\boldsymbol {\alpha }})$ is the Dirichlet distribution.

## Motivation
### Dirichlet negative multinomial as a compound distribution

The Dirichlet distribution is a conjugate distribution to the negative multinomial distribution. This fact leads to an analytically tractable compound distribution. For a random vector of category counts $\mathbf {x} =(x_{1},\dots ,x_{m})$, distributed according to a negative multinomial distribution, the compound distribution is obtained by integrating on the distribution for p which can be thought of as a random vector following a Dirichlet distribution:
    $\Pr(\mathbf {x} \mid x_{0},\alpha _{0},{\boldsymbol {\alpha }})=\int _{\mathbf {p} }\mathrm {NegMult} (\mathbf {x} \mid x_{0},\mathbf {p} )\mathrm {Dir} (\mathbf {p} \mid \alpha _{0},{\boldsymbol {\alpha }}){\textrm {d}}\mathbf {p}$
    $\Pr(\mathbf {x} \mid x_{0},\alpha _{0},{\boldsymbol {\alpha }})={\frac {\Gamma \left(\sum _{i=0}^{m}{x_{i}}\right)}{\Gamma (x_{0})\prod _{i=1}^{m}x_{i}!}}{\frac {1}{\mathrm {B} ({\boldsymbol {\alpha }}_{+})}}\int _{\mathbf {p} }\prod _{i=0}^{m}p_{i}^{x_{i}+\alpha _{i}-1}{\textrm {d}}\mathbf {p}$
which results in the following formula:
    $\Pr(\mathbf {x} \mid x_{0},\alpha _{0},{\boldsymbol {\alpha }})={\frac {\Gamma \left(\sum _{i=0}^{m}{x_{i}}\right)}{\Gamma (x_{0})\prod _{i=1}^{m}x_{i}!}}{\frac {{\mathrm {B} }(\mathbf {x_{+}} +{\boldsymbol {\alpha }}_{+})}{\mathrm {B} ({\boldsymbol {\alpha }}_{+})}}$
where $\mathbf {x_{+}}$ and ${\boldsymbol {\alpha }}_{+}$ are the $m+1$ dimensional vectors created by appending the scalars $x_{0}$ and $\alpha _{0}$ to the $m$ dimensional vectors $\mathbf {x}$ and ${\boldsymbol {\alpha }}$ respectively and $\mathrm {B}$ is the multivariate version of the beta function. We can write this equation explicitly as
    $\Pr(\mathbf {x} \mid x_{0},\alpha _{0},{\boldsymbol {\alpha }})=x_{0}{\frac {\Gamma (\sum _{i=0}^{m}x_{i})\Gamma (\sum _{i=0}^{m}\alpha _{i})}{\Gamma (\sum _{i=0}^{m}(x_{i}+\alpha _{i}))}}\prod _{i=0}^{m}{\frac {\Gamma (x_{i}+\alpha _{i})}{\Gamma (x_{i}+1)\Gamma (\alpha _{i})}}.$
Alternative formulations exist. One convenient representation is
    $\Pr(\mathbf {x} \mid x_{0},\alpha _{0},{\boldsymbol {\alpha }})={\frac {\Gamma (x_{\bullet })}{\Gamma (x_{0})\prod _{i=1}^{m}\Gamma (x_{i}+1)}}\times {\frac {\Gamma (\alpha _{\bullet })}{\prod _{i=0}^{m}\Gamma (\alpha _{i})}}\times {\frac {\prod _{i=0}^{m}\Gamma (x_{i}+\alpha _{i})}{\Gamma (x_{\bullet }+\alpha _{\bullet })}}$
where $x_{\bullet }=x_{0}+x_{1}+\cdots +x_{m}$ and $\alpha _{\bullet }=\alpha _{0}+\alpha _{1}+\cdots +\alpha _{m}$.
This can also be written
    $\Pr(\mathbf {x} \mid x_{0},\alpha _{0},{\boldsymbol {\alpha }})={\frac {\mathrm {B} (x_{\bullet },\alpha _{\bullet })}{\mathrm {B} (x_{0},\alpha _{0})}}\prod _{i=1}^{m}{\frac {\Gamma (x_{i}+\alpha _{i})}{x_{i}!\Gamma (\alpha _{i})}}.$

## Properties
### Marginal distributions

To obtain the marginal distribution over a subset of Dirichlet negative multinomial random variables, one only needs to drop the irrelevant $\alpha _{i}$'s (the variables that one wants to marginalize out) from the ${\boldsymbol {\alpha }}$ vector. The joint distribution of the remaining random variates is $\mathrm {DNM} (x_{0},\alpha _{0},{\boldsymbol {\alpha _{(-)}}})$ where ${\boldsymbol {\alpha _{(-)}}}$ is the vector with the removed $\alpha _{i}$'s. The univariate marginals are said to be beta negative binomially distributed.

### Conditional distributions

If m-dimensional x is partitioned as follows
    $\mathbf {x} ={\begin{bmatrix}\mathbf {x} ^{(1)}\\\mathbf {x} ^{(2)}\end{bmatrix}}{\text{ with sizes }}{\begin{bmatrix}q\times 1\\(m-q)\times 1\end{bmatrix}}$
and accordingly ${\boldsymbol {\alpha }}$
    ${\boldsymbol {\alpha }}={\begin{bmatrix}{\boldsymbol {\alpha }}^{(1)}\\{\boldsymbol {\alpha }}^{(2)}\end{bmatrix}}{\text{ with sizes }}{\begin{bmatrix}q\times 1\\(m-q)\times 1\end{bmatrix}}$
then the conditional distribution of $\mathbf {X} ^{(1)}$ on $\mathbf {X} ^{(2)}=\mathbf {x} ^{(2)}$ is $\mathrm {DNM} (x_{0}^{\prime },\alpha _{0}^{\prime },{\boldsymbol {\alpha }}^{(1)})$ where
    $x_{0}^{\prime }=x_{0}+\sum _{i=1}^{m-q}x_{i}^{(2)}$
and
    $\alpha _{0}^{\prime }=\alpha _{0}+\sum _{i=1}^{m-q}\alpha _{i}^{(2)}$.
That is,
    $\Pr(\mathbf {x} ^{(1)}\mid \mathbf {x} ^{(2)},x_{0},\alpha _{0},{\boldsymbol {\alpha }})={\frac {\mathrm {B} (x_{\bullet },\alpha _{\bullet })}{\mathrm {B} (x_{0}^{\prime },\alpha _{0}^{\prime })}}\prod _{i=1}^{q}{\frac {\Gamma (x_{i}^{(1)}+\alpha _{i}^{(1)})}{(x_{i}^{(1)}!)\Gamma (\alpha _{i}^{(1)})}}$

#### Conditional on the sum

The conditional distribution of a Dirichlet negative multinomial distribution on $\sum _{i=1}^{m}x_{i}=n$ is Dirichlet-multinomial distribution with parameters $n$ and ${\boldsymbol {\alpha }}$. That is
    $\Pr(\mathbf {x} \mid \sum _{i=1}^{m}x_{i}=n,x_{0},\alpha _{0},{\boldsymbol {\alpha }})={\frac {n!\Gamma \left(\sum _{i=1}^{m}\alpha _{i}\right)}{\Gamma \left(n+\sum _{i=1}^{m}\alpha _{i}\right)}}\prod _{i=1}^{m}{\frac {\Gamma (x_{i}+\alpha _{i})}{x_{i}!\Gamma (\alpha _{i})}}$.
Notice that the expression does not depend on $x_{0}$ or $\alpha _{0}$.

### Aggregation

If
    $X=(X_{1},\ldots ,X_{m})\sim \operatorname {DNM} (x_{0},\alpha _{0},\alpha _{1},\ldots ,\alpha _{m})$
then, if the random variables with positive subscripts i and j are dropped from the vector and replaced by their sum,
    $X'=(X_{1},\ldots ,X_{i}+X_{j},\ldots ,X_{m})\sim \operatorname {DNM} \left(x_{0},\alpha _{0},\alpha _{1},\ldots ,\alpha _{i}+\alpha _{j},\ldots ,\alpha _{m}\right).$

### Correlation matrix

For $\alpha _{0}>2$ the entries of the correlation matrix are
    $\rho (X_{i},X_{i})=1.$
    $\rho (X_{i},X_{j})={\frac {\operatorname {cov} (X_{i},X_{j})}{\sqrt {\operatorname {var} (X_{i})\operatorname {var} (X_{j})}}}={\sqrt {\frac {\alpha _{i}\alpha _{j}}{(\alpha _{0}+\alpha _{i}-1)(\alpha _{0}+\alpha _{j}-1)}}}.$

### Heavy tailed

The Dirichlet negative multinomial is a heavy tailed distribution. It does not have a finite mean for $\alpha _{0}\leq 1$ and it has infinite covariance matrix for $\alpha _{0}\leq 2$. Therefore the moment generating function does not exist.

## Applications
### Dirichlet negative multinomial as a Pólya urn model

In the case when the $m+2$ parameters $x_{0},\alpha _{0}$ and ${\boldsymbol {\alpha }}$ are positive integers the Dirichlet negative multinomial can also be motivated by an urn model - or more specifically a basic Pólya urn model. Consider an urn initially containing $\sum _{i=0}^{m}{\alpha _{i}}$ balls of $m+1$ various colors including $\alpha _{0}$ red balls (the stopping color). The vector ${\boldsymbol {\alpha }}$ gives the respective counts of the other balls of various $m$ non-red colors. At each step of the model, a ball is drawn at random from the urn and replaced, along with one additional ball of the same color. The process is repeated over and over, until $x_{0}$ red colored balls are drawn. The random vector $\mathbf {X}$ of observed draws of the other $m$ non-red colors are distributed according to a $\mathrm {DNM} (x_{0},\alpha _{0},{\boldsymbol {\alpha }})$. Note, at the end of the experiment, the urn always contains the fixed number $x_{0}+\alpha _{0}$ of red balls while containing the random number $\mathbf {X} +{\boldsymbol {\alpha }}$ of the other $m$ colors.