rmarkov: Generate a sample of a discrete-state Markov chain
Description
Generates a sequence of discrete states from a discrete-time Markov chain with transition matrix P.
Usage
rmarkov(n, P, start = rep(1, ncol(P)))
Arguments
n
length of the generated sequence.
P
transition matrix (rows are normalized to sum to 1).
start
vector with nonnegative values that defines the discrete starting
distribution at t=0 (start is normalized to sum to 1). The default is
a discrete uniform distribution.