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.
search.model.LM(version = c("basic","latent","manifest","basic.cont", "latent.cont"),
kv, ..., nrep = 2, tol1 = 10^-5, tol2 = 10^-10,out_se = FALSE)
output of each single model (as from est_lm_basic
, est_lm_cov_latent
or est_lm_cov_manifest
) for each k in kv
value of AIC index for each k in kv
value of BIC index for each k in kv
value of log-likelihood for each k in kv
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))
vector of possible number of latent states
additional arguments to be passed based on the model to be estimated (see details)
number of repetitions of each random initialization
tolerance level for checking convergence of the algorithm in the random initializations
tolerance level for checking convergence of the algorithm in the last deterministic initialization
TRUE for computing information matrix and standard errors
Francesco Bartolucci, Silvia Pandolfi, University of Perugia (IT), http://www.stat.unipg.it/bartolucci
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
.
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