sim_hmm | R Documentation |
Simulate a time series from a Gaussian-hidden Markov model
sim_hmm(Tp, N, theta)
Tp |
An |
N |
An |
theta |
A
|
A numeric
vector, the simulated time series.
f_ll_hmm()
for computing the log-likelihood of a Gaussian-hidden Markov
model
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.