Learn R Programming

LMest (version 2.4.5)

lk_obs_latent: Compute the observable log-likelihood of the LM model with covariates in the latent model

Description

Function that computes the observable log-likelihood of the LM model with covariates in the latent model (internal use).

Usage

lk_obs_latent(th, S, R, b, yv, Am, XXdis, Xlab, ZZdis, Zlab, param, fort = TRUE)

Arguments

th

vector of parameters

S

matrix of distinct response configurations

R

matrix of missing response configurations

b

number of response categories

yv

corresponding vector of frequencies

Am

design matrix for the logits

XXdis

design matrix used for estimation of the initial probabilities

Xlab

list of labels used for estimation of the initial probabilities

ZZdis

design matrix used for estimation of the transition probabilities

Zlab

list of labels used for estimation of the transition probabilities

param

type of parametrization for the transition probabilities ("multilogit" = standard multinomial logit for every row of the transition matrix, "difflogit" = multinomial logit based on the difference between two sets of parameters)

fort

to use fortran routine when possible

Value

lk

log-likelihood

sc

score vector

Psi

conditional response probabilities

be

parameters on initial probabilities

Ga

parameters on transition probabilities

Piv

initial probabilities

PI

transition probabilities

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