hmm_simulate_normal_data | R Documentation |
Simulate data distributed according to oHMMed with normal emission densities
hmm_simulate_normal_data(L, mat_T, means, sigma)
L |
(integer) number of simulations |
mat_T |
(matrix) a square matrix with the initial state |
means |
(numeric) |
sigma |
(numeric) |
Returns a list with the following elements:
data
: numeric vector with data
states
: an integer vector with "true" hidden states used to generate the data vector
pi
: numeric vector with prior probability of states
mat_T0 <- rbind(c(1-0.01, 0.01, 0),
c(0.01, 1-0.02, 0.01),
c(0, 0.01, 1-0.01))
L <- 2^7
means0 <- c(-1,0,1)
sigma0 <- 1
sim_data <- hmm_simulate_normal_data(L = L,
mat_T = mat_T0,
means = means0,
sigma = sigma0)
plot(density(sim_data$data), main = "Density of Simulated Normal Data")
sim_data
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.