powered by
This function simulates a Markov chain.
simulate_markov_chain(Gamma, T, delta = stationary_distribution(Gamma))
A numeric vector of length T with states.
numeric
T
A transition probability matrix.
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 of Gamma.
delta
Gamma
Gamma <- sample_transition_probability_matrix(dim = 3) simulate_markov_chain(Gamma = Gamma, T = 10)
Run the code above in your browser using DataLab