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()
The stationary distribution is used by default.
Other simulation helpers: Simulator, correlated_regressors(), ddirichlet_cpp(), dmvnorm_cpp(), dtnorm_cpp(), dwishart_cpp()
Simulator
correlated_regressors()
ddirichlet_cpp()
dmvnorm_cpp()
dtnorm_cpp()
dwishart_cpp()
Gamma <- matrix(c(0.8, 0.2, 0.3, 0.7), byrow = TRUE, nrow = 2) delta <- c(0.6, 0.4) simulate_markov_chain(Gamma = Gamma, T = 20, delta = delta)
Run the code above in your browser using DataLab