simulate_nhmm {seqHMM} | R Documentation |
Simulate Non-homogeneous Hidden Markov Models
Description
Simulate sequences of observed and hidden states given the parameters of a non-homogeneous hidden Markov model.
Usage
simulate_nhmm(
n_states,
emission_formula,
initial_formula = ~1,
transition_formula = ~1,
data,
id,
time,
coefs = NULL,
init_sd = 2 * is.null(coefs)
)
Arguments
n_states |
An integer > 1 defining the number of hidden states. |
emission_formula |
of class |
initial_formula |
of class |
transition_formula |
of class |
data |
A data frame containing the variables used in the model
formulas. Note that this should also include also the response variable(s),
which are used to define the number of observed symbols (using |
id |
Name of the id variable in |
time |
Name of the time index variable in |
coefs |
Same as argument |
init_sd |
Standard deviation of the normal distribution used to
generate random coefficients. Default is |
Value
A list with the model used in simulation as well as the simulated hidden state sequences.