# ppass.msm: Passage probabilities In msm: Multi-State Markov and Hidden Markov Models in Continuous Time

## Description

Probabilities of having visited each state by a particular time in a continuous time Markov model.

## Usage

 1 2 3 4 ppass.msm(x=NULL, qmatrix=NULL, tot, start="all", covariates="mean", piecewise.times=NULL, piecewise.covariates=NULL, ci=c("none","normal","bootstrap"), cl=0.95, B=1000, cores=NULL, ...)

## Arguments

 x A fitted multi-state model, as returned by msm. qmatrix Instead of x, you can simply supply a transition intensity matrix in qmatrix. tot Finite time to forecast the passage probabilites for. start Starting state (integer). By default (start="all"), this will return a matrix one row for each starting state. Alternatively, this can be used to obtain passage probabilities from a set of states, rather than single states. To achieve this, state is set to a vector of weights, with length equal to the number of states in the model. These weights should be proportional to the probability of starting in each of the states in the desired set, so that weights of zero are supplied for other states. The function will calculate the weighted average of the passage probabilities from each of the corresponding states. covariates Covariate values defining the intensity matrix for the fitted model x, as supplied to qmatrix.msm. piecewise.times Currently ignored: not implemented for time-inhomogeneous models. piecewise.covariates Currently ignored: not implemented for time-inhomogeneous models. ci If "normal", then calculate a confidence interval by simulating B random vectors from the asymptotic multivariate normal distribution implied by the maximum likelihood estimates (and covariance matrix) of the log transition intensities and covariate effects. If "bootstrap" then calculate a confidence interval by non-parametric bootstrap refitting. This is 1-2 orders of magnitude slower than the "normal" method, but is expected to be more accurate. See boot.msm for more details of bootstrapping in msm. If "none" (the default) then no confidence interval is calculated. cl Width of the symmetric confidence interval, relative to 1. B Number of bootstrap replicates. cores Number of cores to use for bootstrapping using parallel processing. See boot.msm for more details. ... Arguments to pass to MatrixExp.

## Details

The passage probabilities to state s are computed by setting the sth row of the transition intensity matrix Q to zero, giving an intensity matrix Q* for a simplified model structure where state s is absorbing. The probabilities of passage are then equivalent to row s of the transition probability matrix Exp(tQ*) under this simplified model for t=tot.

Note this is different from the probability of occupying each state at exactly time t, given by pmatrix.msm. The passage probability allows for the possibility of having visited the state before t, but then occupying a different state at t.

The mean of the passage distribution is the expected first passage time, efpt.msm.

This function currently only handles time-homogeneous Markov models. For time-inhomogeneous models the covariates are held constant at the value supplied, by default the column means of the design matrix over all observations.

## Value

A matrix whose r, s entry is the probability of having visited state s at least once before time t, given the state at time 0 is r. The diagonal entries should all be 1.

## Author(s)

C. H. Jackson [email protected]

## References

Norris, J. R. (1997) Markov Chains. Cambridge University Press.