
Last chance! 50% off unlimited learning
Sale ends in
Density, distribution, quantile functions and other utilities for the Coxian phase-type distribution with two phases.
d2phase(x, l1, mu1, mu2, log=FALSE)
p2phase(q, l1, mu1, mu2, lower.tail=TRUE, log.p=FALSE)
q2phase(p, l1, mu1, mu2, lower.tail=TRUE, log.p=FALSE)
r2phase(n, l1, mu1, mu2)
h2phase(x, l1, mu1, mu2, log=FALSE)
d2phase
gives the density, p2phase
gives the distribution
function, q2phase
gives the quantile function, r2phase
generates random deviates, and h2phase
gives the hazard.
vector of quantiles.
vector of probabilities.
number of observations. If length(n) > 1
, the length is
taken to be the number required.
Intensity for transition between phase 1 and phase 2.
Intensity for transition from phase 1 to exit.
Intensity for transition from phase 2 to exit.
logical; if TRUE, return log density or log hazard.
logical; if TRUE, probabilities p are given as log(p).
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x].
An individual following this distribution can be seen as coming from a mixture of two populations:
1) "short stayers" whose mean sojourn time is
2) "long stayers" whose mean sojourn time
Thus a two-phase distribution can be more intuitively parameterised by
the short and long stay means
The hazard is increasing at least if
For increasing hazards with
For increasing hazards with
This is a special case of the n-phase Coxian phase-type distribution, which in turn is a special case of the (general) phase-type distribution. The actuar R package implements a general n-phase distribution defined by the time to absorption of a general continuous-time Markov chain with a single absorbing state, where the process starts in one of the transient states with a given probability.
C. H. Jackson chris.jackson@mrc-bsu.cam.ac.uk
This is the distribution of the time to reach state 3 in a
continuous-time Markov model with three states and transitions permitted
from state 1 to state 2 (with intensity
The density is
if
otherwise. The distribution function is
if
The mean is
The variance is
If
The hazard at
C. Dutang, V. Goulet and M. Pigeon (2008). actuar: An R Package for Actuarial Science. Journal of Statistical Software, vol. 25, no. 7, 1-37. URL http://www.jstatsoft.org/v25/i07