Transition probability matrix from an msmbayes model
Arguments
- draws
Object returned by
msmbayes.- t
prediction time or vector of prediction times
- new_data
Data frame with covariate values to predict for
- states
If
states="obs"(or"observed") then this describes mean sojourn times in the observable states. For phase-type models this is not generally equal to the sum of the phase-specific mean sojourn times, because an individual may transition out of the state before progressing to the next phase.If
states="phase"(or"true", or"latent") then for phase-type models, this describes mean sojourn times in the latent state space.- drop
Only used if there are no covariates supplied in
new_data. Then ifdrop=TRUEthis returns anstatesxnstatesmatrix, or ifdrop=FALSEthis returns a 3D array with first dimensionncovs=1.- type
"posterior"to returnrvarobjects containing posterior samples."mode"to return posterior modes (only applicable if model was fitted with posterior mode optimisation).
Value
Array or matrix of rvar objects giving the transition probability matrix at each requested prediction time and covariate value. See qdf for notes on the rvar format.
For phase-type models, if states="obs", so that we want
transition probabilities on the observable space, this returns the
probability of transition to any phase of each "destination" state,
for an individual who is in the first phase of each "starting"
state.
See also
pmatrixdf returns the same information in a tidy
data frame format.