simulate_HMM_data {regmhmm}R Documentation

Simulate Hidden Markov Model (HMM) Data

Description

Generate synthetic HMM data for testing and validation purposes. This function creates a simulated dataset with specified parameters, including initial probabilities, transition probabilities, emission matrix, and noise covariates.

Usage

simulate_HMM_data(seed_num, p_noise, N, N_persub, parameters_setting)

Arguments

seed_num

Seed for reproducibility.

p_noise

Number of noise covariates.

N

Number of subjects.

N_persub

Number of time points per subject.

parameters_setting

A list containing the parameters for the HMM.

Value

A list containing the design matrix (X_array) and response variable matrix (y_mat).

Examples

seed_num <- 1
p_noise <- 2
N <- 100
N_persub <- 50
parameters_setting <- list(
  init_vec = c(0.5, 0.5),
  trans_mat = matrix(c(0.7, 0.3, 0.2, 0.8), nrow = 2, byrow = TRUE),
  emis_mat = matrix(c(1, 0.5, 0.5, 2), nrow = 2, byrow = TRUE)
)
simulated_data <- simulate_HMM_data(seed_num, p_noise, N, N_persub, parameters_setting)


[Package regmhmm version 1.0.0 Index]