# Hyperexponential distribution

Diagram showing queueing system equivalent of a hyperexponential distribution

In probability theory, a hyperexponential distribution is a continuous probability distribution whose probability density function of the random variable X is given by

${\displaystyle f_{X}(x)=\sum _{i=1}^{n}f_{Y_{i}}(x)\;p_{i},}$

where each Yi is an exponentially distributed random variable with rate parameter λi, and pi is the probability that X will take on the form of the exponential distribution with rate λi.[1] It is named the hyperexponential distribution since its coefficient of variation is greater than that of the exponential distribution, whose coefficient of variation is 1, and the hypoexponential distribution, which has a coefficient of variation smaller than one. While the exponential distribution is the continuous analogue of the geometric distribution, the hyperexponential distribution is not analogous to the hypergeometric distribution. The hyperexponential distribution is an example of a mixture density.

An example of a hyperexponential random variable can be seen in the context of telephony, where, if someone has a modem and a phone, their phone line usage could be modeled as a hyperexponential distribution where there is probability p of them talking on the phone with rate λ1 and probability q of them using their internet connection with rate λ2.

## Properties

Since the expected value of a sum is the sum of the expected values, the expected value of a hyperexponential random variable can be shown as

${\displaystyle E[X]=\int _{-\infty }^{\infty }xf(x)\,dx=\sum _{i=1}^{n}p_{i}\int _{0}^{\infty }x\lambda _{i}e^{-\lambda _{i}x}\,dx=\sum _{i=1}^{n}{\frac {p_{i}}{\lambda _{i}}}}$

and

${\displaystyle E\!\left[X^{2}\right]=\int _{-\infty }^{\infty }x^{2}f(x)\,dx=\sum _{i=1}^{n}p_{i}\int _{0}^{\infty }x^{2}\lambda _{i}e^{-\lambda _{i}x}\,dx=\sum _{i=1}^{n}{\frac {2}{\lambda _{i}^{2}}}p_{i},}$

from which we can derive the variance:[2]

${\displaystyle \operatorname {Var} [X]=E\!\left[X^{2}\right]-E\!\left[X\right]^{2}=\sum _{i=1}^{n}{\frac {2}{\lambda _{i}^{2}}}p_{i}-\left[\sum _{i=1}^{n}{\frac {p_{i}}{\lambda _{i}}}\right]^{2}=\left[\sum _{i=1}^{n}{\frac {p_{i}}{\lambda _{i}}}\right]^{2}+\sum _{i=1}^{n}\sum _{j=1}^{n}p_{i}p_{j}\left({\frac {1}{\lambda _{i}}}-{\frac {1}{\lambda _{j}}}\right)^{2}.}$

The standard deviation exceeds the mean in general (except for the degenerate case of all the λs being equal), so the coefficient of variation is greater than 1.

The moment-generating function is given by

${\displaystyle E\!\left[e^{tx}\right]=\int _{-\infty }^{\infty }e^{tx}f(x)\,dx=\sum _{i=1}^{n}p_{i}\int _{0}^{\infty }e^{tx}\lambda _{i}e^{-\lambda _{i}x}\,dx=\sum _{i=1}^{n}{\frac {\lambda _{i}}{\lambda _{i}-t}}p_{i}.}$

## Fitting

A given probability distribution, including a heavy-tailed distribution, can be approximated by a hyperexponential distribution by fitting recursively to different time scales using Prony's method.[3]