sim_lhmm: Simulating action sequences using LHMM

View source: R/sim.R

sim_lhmmR Documentation

Simulating action sequences using LHMM

Description

sim_lhmm generate n action sequences from LHMM based on given parameters. The lengths of the generated sequences are simulated from a Poission distribution with mean mean_len and at least min_len. The latent trait is generated from standard normal.

Usage

sim_lhmm(n, paras, min_len, mean_len, return_state = TRUE)

Arguments

n

number of action sequences to be generated

paras

a list containing specified LHMM parameters: para_a, para_b, para_alpha, para_beta, and para_P1.

min_len

minimum length of generated sequences

mean_len

mean length of generated sequences

return_state

logical. Whether generated hidden state sequences should be returned or not.

Value

If return_state = TRUE, sim_hmm returns a list of three elements

seqs a list of n generated action sequences
theta latent traits as a vector of length n
state_seqs a list of n hidden state sequences

If return_state = FALSE, the returned list only contains seqs and theta.

Examples

paras <- sim_lhmm_paras(5,2)
sim_data <- sim_lhmm(20, paras, 4, 10)


proclhmm documentation built on June 22, 2024, 10:02 a.m.