tpm <- matrix(c(0.8, 0.1, 0.2, 0.9), nrow = 2)
mu <- c(-2, 2)
sigma <- c(0.5, 1)
theta <- c(log(tpm[row(tpm) != col(tpm)]), mu, log(sigma))
data <- sim_hmm(Tp = 100, N = 2, theta = theta)
plot(data, type = "l")
Run the code above in your browser using DataLab