lhmm {proclhmm}R Documentation

MMLE of LHMM

Description

Maximum marginalized likelihood estimation of LHMM. Marginalization over latent trait is computed numerically using Guassian-Hermite quadratures from statmod. Optimization is performed through optim.

Usage

lhmm(action_seqs, K, paras, n_pts = 100, verbose = TRUE, ...)

Arguments

action_seqs

a list of n action sequences

K

number of hidden states

paras

a list of elements named para_a, para_b, para_alpha, para_beta, and para_P1, providing initial values of model parameters

n_pts

number of quadrature points

verbose

logical. If TRUE, progress messages are printed.

...

additional arguments passed to optim

Value

A list containing the following elements

seqs action sequences coded in integers
K number of hidden states
N number of distinct actions
paras_init a list containing initial values of parameters
paras_est a list containing parameter estimates
theta_est a vector of length n. estimated latent traits
init_mllh initial value of the marginalized likelihood function
opt_mllh maximized marginalized likelihood function
opt_res object returned by optim

Examples

# generate data
paras_true <- sim_lhmm_paras(5, 2)
sim_data <- sim_lhmm(10, paras_true, 3, 5)
# randomly initialize parameters
paras_init <- sim_lhmm_paras(5, 2)
# fit model
lhmm_res <- lhmm(sim_data$seqs, 2, paras_init)


[Package proclhmm version 1.0.0 Index]