mySpec <- hmm(
K = 3, R = 1,
observation =
Gaussian(mu = -5, sigma = 1)
+ Gaussian(mu = 0, sigma = 1)
+ Gaussian(mu = 5, sigma = 1),
initial = Dirichlet(alpha = c(1, 1, 1)),
transition = Dirichlet(alpha = c(1, 1, 1)),
name = "Univariate Gaussian Generative"
)
set.seed(9000)
y <- as.matrix(
c(rnorm(100, 5, 1), rnorm(100, 0, 1), rnorm(100, -5, 1))
)
myModel <- compile(mySpec)
myFit <- draw_samples(mySpec, myModel, y = y, chains = 1, iter = 500, seed = 9000)
print(myFit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.