Learn R Programming

LMest (version 3.1.2)

search.model.LM: Search for the global maximum of the log-likelihood

Description

Function that searches for the global maximum of the log-likelihood of different models given a vector of possible number of states to try for.

The function is no longer maintained. Please look at lmestSearch function.

Usage

search.model.LM(version = c("basic","latent","manifest","basic.cont", "latent.cont"),
                kv, ..., nrep = 2, tol1 = 10^-5, tol2 = 10^-10,out_se = FALSE)

Value

out.single

output of each single model (as from est_lm_basic, est_lm_cov_latent or est_lm_cov_manifest) for each k in kv

aicv

value of AIC index for each k in kv

bicv

value of BIC index for each k in kv

lkv

value of log-likelihood for each k in kv

Arguments

version

model to be estimated ("basic" = basic LM model (est_lm_basic function); "latent" = LM model with covariates in the distribution of the latent process (est_lm_cov_latent function); "manifest" = LM model with covariates in the measurement model (est_lm_cov_maifest function),"basic.cont" = basic LM model for continuous outcomes (est_lm_basic_cont function); "latent.cont" = LM model for continuous outcomes with covariates in the distribution of the latent process (est_lm_cov_latent_cont function))

kv

vector of possible number of latent states

...

additional arguments to be passed based on the model to be estimated (see details)

nrep

number of repetitions of each random initialization

tol1

tolerance level for checking convergence of the algorithm in the random initializations

tol2

tolerance level for checking convergence of the algorithm in the last deterministic initialization

out_se

TRUE for computing information matrix and standard errors

Author

Francesco Bartolucci, Silvia Pandolfi, University of Perugia (IT), http://www.stat.unipg.it/bartolucci

Details

The function combines deterministic and random initializations strategy to reach the global maximum of the model log-likelihood. It uses one deterministic initialization (start=0) and a number of random initializations (start=1) proportional to the number of latent states. The tolerance level is set equal to 10^-5. Starting from the best solution obtained in this way, a final run is performed (start=2) with a default tolerance level equal to 10^-10.

Arguments in ... depend on the model to be estimated. They match the arguments to be passed to functions est_lm_basic, est_lm_cov_latent, est_lm_cov_manifest, est_lm_basic_cont, or est_lm_cov_latent_cont.

Examples

Run this code
if (FALSE) {

# example for est_lm_basic
data(data_drug)
data_drug <- as.matrix(data_drug)
S <- data_drug[,1:5]-1
yv <- data_drug[,6]
n <- sum(yv)
# Search Basic LM model

res <- search.model.LM("basic", kv = 1:4, S, yv, mod = 1)
summary(res)

}

Run the code above in your browser using DataLab