# Compound probability distribution

In probability and statistics, a compound probability distribution (also known as a mixture distribution or contagious distribution) is the probability distribution that results from assuming that a random variable is distributed according to some parametrized distribution, with (some of) the parameters of that distribution themselves being random variables. If the parameter is a scale parameter, the resulting mixture is also called a scale mixture.

The compound distribution ("unconditional distribution") is the result of marginalizing (integrating) over the latent random variable(s) representing the parameter(s) of the parametrized distribution ("conditional distribution").

## Definition

A compound probability distribution is the probability distribution that results from assuming that a random variable $\displaystyle{ X }$ is distributed according to some parametrized distribution $\displaystyle{ F }$ with an unknown parameter $\displaystyle{ \theta }$ that is again distributed according to some other distribution $\displaystyle{ G }$. The resulting distribution $\displaystyle{ H }$ is said to be the distribution that results from compounding $\displaystyle{ F }$ with $\displaystyle{ G }$. The parameter's distribution $\displaystyle{ G }$ is also called the mixing distribution or latent distribution. Technically, the unconditional distribution $\displaystyle{ H }$ results from marginalizing over $\displaystyle{ G }$, i.e., from integrating out the unknown parameter(s) $\displaystyle{ \theta }$. Its probability density function is given by:

$\displaystyle{ p_H(x) = \int\limits p_F(x|\theta)\,p_G(\theta) \operatorname{d}\!\theta}$

The same formula applies analogously if some or all of the variables are vectors.

From the above formula, one can see that a compound distribution essentially is a special case of a marginal distribution: The joint distribution of $\displaystyle{ x }$ and $\displaystyle{ \theta }$ is given by $\displaystyle{ p(x,\theta)=p(x|\theta)p(\theta) }$, and the compound results as its marginal distribution: $\displaystyle{ {\textstyle p(x) = \int p(x,\theta) \operatorname{d}\!\theta } }$. If the domain of $\displaystyle{ \theta }$ is discrete, then the distribution is again a special case of a mixture distribution.

## Properties

The compound distribution $\displaystyle{ H }$ will depend on the specific expression of each distribution, as well as which parameter of $\displaystyle{ F }$ is distributed according to the distribution $\displaystyle{ G }$, and the parameters of $\displaystyle{ H }$ will include any parameters of $\displaystyle{ G }$ that are not marginalized, or integrated, out. The support of $\displaystyle{ H }$ is the same as that of $\displaystyle{ F }$, and if the latter is a two-parameter distribution parameterized with the mean and variance, some general properties exist.

The compound distribution's first two moments are given by:

$\displaystyle{ \operatorname{E}_H[X] = \operatorname{E}_G\bigl[\operatorname{E}_F[X|\theta]\bigr] }$

$\displaystyle{ \operatorname{Var}_H(X) = \operatorname{E}_G\bigl[\operatorname{Var}_F(X|\theta)\bigr] + \operatorname{Var}_G\bigl(\operatorname{E}_F[X|\theta]\bigr) }$ (Law of total variance)

If the mean of $\displaystyle{ F }$ is distributed as $\displaystyle{ G }$, which in turn has mean $\displaystyle{ \mu }$ and variance $\displaystyle{ \sigma^2 }$ the expressions above imply $\displaystyle{ \operatorname{E}_H[X] = \operatorname{E}_G[\theta] = \mu }$ and $\displaystyle{ \operatorname{Var}_H(X) = \operatorname{Var}_F(X|\theta) + \operatorname{Var}_G(Y) = \tau^2 + \sigma^2 }$, where $\displaystyle{ \tau^2 }$ is the variance of $\displaystyle{ F }$.

### Proof

let $\displaystyle{ F }$ and $\displaystyle{ G }$ be probability distributions parameterized with mean a variance as \displaystyle{ \begin{align} x &\sim \mathcal{F}(\theta,\tau^2) \\ \theta &\sim \mathcal{G}(\mu,\sigma^2) \end{align} } then denoting the probability density functions as $\displaystyle{ f(x|\theta) = p_F(x|\theta) }$ and $\displaystyle{ g(\theta) = p_G(\theta) }$ respectively, and $\displaystyle{ h(x) }$ being the probability density of $\displaystyle{ H }$ we have \displaystyle{ \begin{align} \operatorname{E}_H[X] = \int_F x h(x)dx &= \int_F x \int_G f(x|\theta) g(\theta) d\theta dx \\ &= \int_G \int_F x f(x|\theta) dx\ g(\theta) d\theta \\ &= \int_G \operatorname{E}_F[X|\theta] g(\theta) d\theta \end{align} }

and we have from the parameterization $\displaystyle{ \mathcal{F} }$ and $\displaystyle{ \mathcal{G} }$ that

\displaystyle{ \begin{align} \operatorname{E}_F[X|\theta] &= \int_F x f(x|\theta)dx = \theta \\ \operatorname{E}_G[\theta] &= \int_G \theta g(\theta)d\theta = \mu \end{align} } and therefore the mean of the compound distribution $\displaystyle{ \operatorname{E}_H[X] = \mu }$ as per the expression for its first moment above.

The variance of $\displaystyle{ H }$ is given by $\displaystyle{ \operatorname{E}_H[X^2] - (\operatorname{E}_H[X])^2 }$, and \displaystyle{ \begin{align} \operatorname{E}_H[X^2] = \int_F x^2 h(x)dx &= \int_F x^2 \int_G f(x|\theta) g(\theta) d\theta dx \\ &= \int_G \int_F x^2 f(x|\theta) dx\ g(\theta) d\theta \\ &= \int_G \tau^2 + \theta^2 g(\theta) d\theta \end{align} } in the last step we use the fact that $\displaystyle{ \operatorname{Var}_F(X|\theta) = \langle x^2 \rangle - \langle x \rangle^2 = \langle x^2 \rangle - \theta^2 }$, and we also have that $\displaystyle{ \operatorname{Var}_G(\theta) = \langle \theta^2 \rangle - \langle \theta \rangle^2 = \langle \theta^2 \rangle - \mu^2 }$, so the expression above becomes: \displaystyle{ \begin{align} \operatorname{E}_H[X^2] &= \int_G \tau^2 + \theta^2 g(\theta) d\theta \\ &= \tau^2 + \sigma^2 + \mu^2 \end{align} } and finally \displaystyle{ \begin{align} \operatorname{Var}_H(X) &= \operatorname{E}_H[X^2] - (\operatorname{E}_H[X])^2 \\ &= \tau^2 + \sigma^2 \end{align} }

## Applications

### Testing

Distributions of common test statistics result as compound distributions under their null hypothesis, for example in Student's t-test (where the test statistic results as the ratio of a normal and a chi-squared random variable), or in the F-test (where the test statistic is the ratio of two chi-squared random variables).

### Overdispersion modeling

Compound distributions are useful for modeling outcomes exhibiting overdispersion, i.e., a greater amount of variability than would be expected under a certain model. For example, count data are commonly modeled using the Poisson distribution, whose variance is equal to its mean. The distribution may be generalized by allowing for variability in its rate parameter, implemented via a gamma distribution, which results in a marginal negative binomial distribution. This distribution is similar in its shape to the Poisson distribution, but it allows for larger variances. Similarly, a binomial distribution may be generalized to allow for additional variability by compounding it with a beta distribution for its success probability parameter, which results in a beta-binomial distribution.

### Bayesian inference

Besides ubiquitous marginal distributions that may be seen as special cases of compound distributions, in Bayesian inference, compound distributions arise when, in the notation above, F represents the distribution of future observations and G is the posterior distribution of the parameters of F, given the information in a set of observed data. This gives a posterior predictive distribution. Correspondingly, for the prior predictive distribution, F is the distribution of a new data point while G is the prior distribution of the parameters.

### Convolution

Convolution of probability distributions (to derive the probability distribution of sums of random variables) may also be seen as a special case of compounding; here the sum's distribution essentially results from considering one summand as a random location parameter for the other summand.

## Computation

Compound distributions derived from exponential family distributions often have a closed form. If analytical integration is not possible, numerical methods may be necessary.

Compound distributions may relatively easily be investigated using Monte Carlo methods, i.e., by generating random samples. It is often easy to generate random numbers from the distributions $\displaystyle{ p(\theta) }$ as well as $\displaystyle{ p(x|\theta) }$ and then utilize these to perform collapsed Gibbs sampling to generate samples from $\displaystyle{ p(x) }$.

A compound distribution may usually also be approximated to a sufficient degree by a mixture distribution using a finite number of mixture components, allowing to derive approximate density, distribution function etc.

Parameter estimation (maximum-likelihood or maximum-a-posteriori estimation) within a compound distribution model may sometimes be simplified by utilizing the EM-algorithm.

## Similar terms

The notion of "compound distribution" as used e.g. in the definition of a Compound Poisson distribution or Compound Poisson process is different from the definition found in this article. The meaning in this article corresponds to what is used in e.g. Bayesian hierarchical modeling.

The special case for compound probability distributions where the parametrized distribution $\displaystyle{ F }$ is the Poisson distribution is also called mixed Poisson distribution.