Density, distribution function, quantile function, random generation and
momentgenerating function (and its first two derivatives) for the
hypoexponential distribution with rates rate
.
1 2 3 4 5 
x, q 
vector of quantiles. 
p 
vector of probabilities. 
n 
number of observations. If 
difforder 
the order of derivative for the momentgenerating function; currently only implemented for 0, 1, 2. 
rate 
vector of (unique) rates. 
lower.tail 
logical; if 
log, log.p 
logical; if 
tailarea 
logical; if 
interval 
Passed to 
The sum of n independent exponentially distributed random variables X_{i} with rate parameters λ_{i} has a hypoexponential distribution with rate vector (λ_{1}, …, λ_{n}).
The hypoexponential distribution is a generalization of the Erlang distribution (a Gamma distribution with an integervalued shape parameter) and a special case of the phasetype distribution (see References section).
The quantile function is computed by numeric inversion (using
uniroot
).
dhypoexp
gives the density, phypoexp
gives the distribution
function (or the integrated tail area distribution function),
qhypoexp
gives the quantile function, rhypoexp
generates
random deviates and mgfhypoexp
gives the momentgenerating function
(or its derivative up to the second order).
If length(rate) == 1
, dhypoexp
, phypoexp
and
rhypoexp
are equivalent to dexp
,
pexp
and rexp
with rate parameter
rate
and should, in fact, be replaced by the latter ones for
computation speed.
Neuts, M. F. (1981) MatrixGeometric Solutions in Stochastic Models: An Algorithmic Approach, reprinted and corrected.
dexp
, dgamma
1 2 3 4 5 6 7 8 9 10 11  ## Random generation
rhypoexp(10, c(3, 5))
## Mean
mu < mgfhypoexp(0, c(3, 5), difforder = 1)
## Variance
mgfhypoexp(0, c(3, 5), difforder = 2)  mu^2
## Quantile
qhypoexp(0.5, c(3, 5))

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.