powered by
This function simulates a Markov chain.
simulate_markov_chain(Gamma, T, delta = oeli::stationary_distribution(Gamma))
A numeric vector of length T with states.
numeric
T
[matrix()] A transition probability matrix.
matrix()
[integer(1)] The length of the Markov chain.
integer(1)
[numeric()] A probability vector, the initial distribution.
numeric()
By default, delta is the stationary distribution of Gamma.
delta
Gamma
Other simulation helpers: correlated_regressors(), ddirichlet_cpp(), dmvnorm_cpp(), dtnorm_cpp(), dwishart_cpp()
correlated_regressors()
ddirichlet_cpp()
dmvnorm_cpp()
dtnorm_cpp()
dwishart_cpp()
Gamma <- sample_transition_probability_matrix(dim = 3) simulate_markov_chain(Gamma = Gamma, T = 10)
Run the code above in your browser using DataLab