Density, distribution function, random generation and moment-generating
function (and its first two derivatives) for the hypo-exponential
distribution with rates rate.
number of observations. If length(n) > 1, the length is
taken to be the number required.
difforder
the order of derivative for the moment-generating function;
currently only implemented for 0, 1, 2.
rate
vector of (unique) rates.
lower.tail
logical; if TRUE, probabilities are
$\mathbf{P}(X \le x)$, otherwise $\mathbf{P}(X >
x)$.
log, log.p
logical; if TRUE, probabilities $p$ are given
as $\log(p)$.
tailarea
logical; if TRUE, probabilities are given for the
integrated tail area distribution.
Value
dhypoexp gives the density, phypoexp gives the distribution
function (or the integrated tail area distribution function),
rhypoexp generates random deviates and mgfhypoexp gives the
moment-generating function (or its derivative up to the second order)
Details
The sum of $n$ independent exponentially distributed random variables
$X_{i}$ with rate parameters $\lambda_{i}$ has a hypo-exponential
distribution with rate vector $(\lambda_{1}, \dots, \lambda_{n})$.
The hypo-exponential distribution is a generalization of the Erlang
distribution (a Gamma distribution with an integer-valued shape parameter)
and a special case of the phase-type distribution (see References section).
References
Neuts, M. F. (1981) Matrix-Geometric Solutions in Stochastic Models:
An Algorithmic Approach, reprinted and corrected.