---
title: "Mixture processes"
canonical: "https://modelassist.epixanalytics.com/space/EA/26574993/Mixture%20processes"
format: markdown
---
Sometimes a stochastic process can be a combination of two or more separate processes. For example, car accidents at some particular place and time could be considered to be a Poisson variable, but the mean number of accidents per unit time *l* may be a variable too. Perhaps the accident rate is dependent on the weather. Then the number of accidents in a particular period will be a mixture of a Poisson distribution and a distribution for *l*.

  


A mixture distribution can be written symbolically as follows:

![image](media://4d76db6c-f957-4b62-8cd3-abf6bfcf49cb)

  


> Macro (mathblock)

where *FA* represents the base distribution and *FB* represents the mixing distribution, i.e. the distribution of *Q*. So, for example we might have:

![image](media://7f1cc355-33b6-4d4b-89f3-e1a662f6a38e)

  


> Macro (mathblock)

  


which reads as "a Gamma mixture of Poisson distributions". *l* is [Gamma](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575231/) distributed and the mixture distribution has two parameters, *a* and *b*. In fact, this distribution turns out to be a [Negative Binomial](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575213/) (*a*, 1/(1+*b*)) distribution. This distribution is for example used in marketing and consumer behavior; think for example about consumers buying a certain product at a certain (Poisson) rate, and different people having different (Gamma distributed) underlying rates. However, we have even seen this flexible distribution applied to counts of fecal eggs of nematodes in cow feces!

  


There are a number of commonly used mixture distributions. For example:

![image](media://553e5c7a-26f4-4a0f-be86-cbc928e6dbe9)

  


> Macro (mathblock)

which is the [Beta-Binomial](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575203/) (*n*,*a*, *b*) distribution; and

  


![image](media://e0482454-b7fa-4e9f-ad66-ed6cce5d3b86)

> Macro (mathblock)

where the [Poisson](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575214/) distribution has parameter *l* = *j* *.p*, and *p* = Beta(*a*, *b, 1*). [Though also used in biology, this should not be confused with the Beta-Poisson dose-response model].

  


The cumulative distribution function for a mixture distribution with parameters *qi* is given by:

  


                *E*[*F*(*X*|*q1,* *q2, …,* *qm*)]

where the expectation is with respect to the parameters that are random variables. Thus, the functional form of mixture distributions can quickly become extremely complicated or even intractable. However, [Monte Carlo simulation](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575292/) allows us to very simply include mixture distributions in our model, because Crystal Ball generates samples for each iteration in the correct logical sequence. So, for example, a Beta-Binomial(*n*, *a*, *b*) distribution is easily generated by constructing a Binomial(Beta(*a*, *b, 1*), n) model in Excel/Crystal Ball as is shown in the model [BetaBinomial](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26574993/Mixture+processes#BetaBinomial)- make sure here that the Binomial distribution in Crystal Ball is "dynamic". This allows Crystal Ball to generate a value first in each iteration from the [Beta](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575217/) distribution, then create the appropriate [Binomial](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575204/) distribution using this value of *p*, and finally samples from that Binomial distribution.

  


 > Macro (anchor)



  


<details>
<summary>Crystal Ball</summary>

> Macro (inline-media-image)

 [BetaBinomial-CB.xlsx](/wiki/download/attachments/26579343/BetaBinomial-CB.xlsx?version=1&modificationDate=1506113485000&cacheVersion=1&api=v2)
</details>

  


<details>
<summary>@Risk</summary>

> Macro (inline-media-image)

[BetaBinomial-AtRISK.xlsx](/wiki/download/attachments/26581760/BetaBinomial-AtRISK.xlsx?version=1&modificationDate=1506097535000&cacheVersion=1&api=v2)
</details>

  


  


  


  


---