Learn R Programming

LMest (version 2.4.5)

lk_comp_latent: Complete log-likelihood of the latent Markov model with covariates

Description

Function that computes complete log-likelihood of the latent Markov model with covariates in the distribution of the latent process (internal use).

Usage

lk_comp_latent(S, R, yv, Piv, PI, Psi, k, fort = TRUE, der = FALSE,
       dlPsi = NULL, dlPiv = NULL, dlPI = NULL)

Arguments

S

matrix of distinct response configurations

R

matrix of missing response configurations

yv

corresponding vector of frequencies

Piv

initial probability matrix

PI

transition probability matrices

Psi

conditional response probability matrix

k

number of latent classes

fort

to use fortran routine when possible

der

to compute derivatives

dlPsi

matrix of derivatives of the logarithm of the conditional response probabilities

dlPiv

matrix of derivatives of the logarithm of the intial probabilities

dlPI

matrix of derivatives of the logarithm of the transition probabilities

Value

lk

log-likelihood

Phi

matrix of the conditional probabilities of the observed response configurations

L

matrix of the forward probabilities

pv

vector of marginal probabilities

dlk

derivatives of the log-likelihood

dlPhi

matrix of derivatives of the log-conditional probabilities of the observed response configurations

dlL

matrix of derivatives of the log-forward probabilities

dlL2

matrix of second derivatives of the log-forward probabilities

dlpv

matrix of derivatives of the log-marginal probabilities

References

Baum, L. E., Petrie, T., Soules, G., and Weiss, N. (1970). A maximization technique occurring in the statistical analysis of probabilistic functions of Markov chains. Annals of Mathematical Statistics, 41, 164-171.