paths: Find all possible trajectories through a given multi-state model
Description
For a given multi-state model, specified through a transition matrix,
paths recursively finds all the possible trajectories or paths
through that multi-state starting from a specified state. DO NOT USE for
reversible or cyclic multi-state models.
Usage
paths(trans, start = 1)
Value
A matrix, each row of which specifies a possible path through the
multi-state model.
Arguments
trans
The transition matrix describing the multi-state model, see
msprep
start
The starting state for the trajectories
Author
Hein Putter <H.Putter@lumc.nl>
Details
The function is recursive. It starts in start, looks at what states
can be visited from start, and appends the results of the next call
to the current value (matrix). If the transition matrix contains loops, the
function will find infinitely many paths, so do not use paths for
reversible or cyclic multi-state models. A warning is not yet incorporated!