Usage
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)
Arguments
p
vector of probabilities.
n
number of observations. If length(n) > 1
, the length is
taken to be the number required.
l1
Intensity for transition between phase 1 and phase 2.
mu1
Intensity for transition from phase 1 to exit.
mu2
Intensity for transition from phase 2 to exit.
log
logical; if TRUE, return log density or log hazard.
log.p
logical; if TRUE, probabilities p are given as
log(p).
lower.tail
logical; if TRUE (default), probabilities are P[X <= x],="" otherwise,="" p[x=""> x].=>
Alternative parameterisation
An individual following this distribution can be seen as coming from
a mixture of two populations:
1) "short stayers" whose mean sojourn time is $M_1 =
1/(\lambda_1+\mu_1)$ and sojourn distribution is
exponential with rate $\lambda_1 + \mu_1$.
2) "long stayers" whose mean sojourn time $M_2 =
1/(\lambda_1+\mu_1) + 1/\mu_2$ and sojourn
distribution is the sum of two exponentials with rate $\lambda_1 +
\mu_1$
and $\mu_2$
respectively. The individual is a "long stayer" with probability
$p=\lambda_1/(\lambda_1 + \mu_1)$.
Thus a two-phase distribution can be more intuitively parameterised by
the short and long stay means $M_1 < M_2$ and the long stay
probability $p$. Given these parameters, the transition
intensities are $\lambda_1=p/M_1$,
$\mu_1=(1-p)/M_1$, and $\mu_2=1/(M_2-M_1)$. This can be useful for choosing intuitively reasonable
initial values for procedures to fit these models to data.
The hazard is increasing at least if $M_2 < 2M_1$,
and also only if $(M_2 - 2M_1)/(M_2 - M_1) < p$.
For increasing hazards with $\lambda_1 + \mu_1 \leq \mu_2$, the maximum hazard
ratio between any time $t$ and time 0 is $1/(1-p)$.
For increasing hazards with $\lambda_1 + \mu_1 \geq \mu_2$, the maximum hazard ratio is $M_1/((1-p)(M_2 -
M_1))$. This is the minimum hazard ratio for
decreasing hazards.General phase-type distributions
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.