Generates a state trajectory of length n_steps+1 (n_steps simulation steps plus the initial state). State names are in the range of 1:nrow(T).

msm.sim(T, initial_state, n_steps)

Arguments

T
column-normalized transition matrix encoding the MSM.
initial_state
State number of state to start with. Must be in range 1:nrow(T).
n_steps
Number of simulation steps.