Function cmb_random_hypoexponential

Function Documentation

static inline double cmb_random_hypoexponential(const unsigned n, const double *ma)

Hypoexponential on [0, oo), a sum of n exponentially distributed random variables, each with mean ma[i], where n > 0 and ma[i] > 0.

The mean equals the sum of ma[i], the variance the sum of ma[i]^2.

A slight generalization of the Erlang distribution by allowing each summed item its own exponential parameter. This will give a lower coefficient of variation than a single exponential, hence the name.

See also https://en.wikipedia.org/wiki/Hypoexponential_distribution