powered by
This function simulates a Markov chain.
simulate_markov_chain( Gamma, T, delta = Gamma2delta(Gamma), seed = NULL, total_length = T )
A numeric vector of length T with states.
numeric
T
A transition probability matrix (tpm).
matrix
AN integer, the length of the Markov chain.
integer
A numeric probability vector, the initial distribution. If not specified, delta is set to the stationary distribution vector.
delta
Set a seed.
An integer, the total length of the output vector. Must be greater or equal than T.
if (FALSE) { Gamma <- matrix(c(0.5, 0.3, 0.5, 0.7), 2, 2) T <- 10 simulate_markov_chain(Gamma = Gamma, T = T) }
Run the code above in your browser using DataLab