simulate_hmm {fHMM} | R Documentation |
Simulate data
Description
This helper function simulates HMM data.
Usage
simulate_hmm(
controls = list(),
hierarchy = FALSE,
states = if (!hierarchy) 2 else c(2, 2),
sdds = if (!hierarchy) "normal" else c("normal", "normal"),
horizon = if (!hierarchy) 100 else c(100, 30),
period = if (hierarchy && is.na(horizon[2])) "m" else NA,
true_parameters = fHMM_parameters(controls = controls, hierarchy = hierarchy, states =
states, sdds = sdds),
seed = NULL
)
Arguments
controls |
Either a The
Either none, all, or selected elements can be specified. Unspecified parameters are set to their default values. Important: Specifications in |
hierarchy |
A If By default, |
states |
An If By default, |
sdds |
A
The distribution parameters, i.e. the
can be fixed via, e.g., If By default, |
horizon |
A If By default, If |
period |
Only relevant if In this case, a
By default, |
true_parameters |
An object of class |
seed |
Set a seed for the data simulation. No seed per default. |
Value
A list
containing the following elements:
-
time_points
, thevector
(ormatrix
in the hierarchical case) of time points, -
markov_chain
, thevector
(ormatrix
in the hierarchical case) of the simulated states, -
data
, thevector
(ormatrix
in the hierarchical case) of the simulated state-dependent observations, -
T_star
, thenumeric
vector of fine-scale chunk sizes in the hierarchical case
Examples
simulate_hmm(states = 2, sdds = "normal", horizon = 10)