This function provides an automatic grid search for latent class mixed
models estimated with
a call of
the number of departures from random initial values
the number of iterations in the optimization algorithm
an object of class
a cluster created by makeCluster from package parallel or an integer specifying the number of cores to use for parallel computation
The function permits the estimation of a model from a grid of random initial values to reduce the odds of a convergence towards a local maximum.
The function was inspired by the emEM technique described in Biernacki et al. (2003). It consists in:
1. randomly generating
rep sets of initial values for
the estimates of
minit (this is done internally using option
2. running the optimization algorithm for the model specified in
rep sets of initial values with a maximum number of
maxit each time.
3. retaining the estimates of the random initialization that provides the
best log-likelihood after
4. running the optimization algorithm from these estimates for the final estimation.
an object of class
mpjlcmm corresponding to the call specified in m.
Cecile Proust-Lima and Viviane Philipps
Biernacki C, Celeux G, Govaert G (2003). Choosing Starting Values for the EM Algorithm for Getting the Highest Likelihood in Multivariate Gaussian Mixture models. Computational Statistics and Data Analysis, 41(3-4), 561-575.
1 2 3 4 5 6 7 8 9 10 11
## Not run: # initial model with ng=1 for the random initial values m1 <- hlme(Y ~ Time * X1, random =~ Time, subject = 'ID', ng = 1, data = data_hlme) # gridsearch with 10 iterations from 50 random departures m2d <- gridsearch(rep = 50, maxiter = 10, minit = m1, hlme(Y ~ Time * X1, mixture =~ Time, random =~ Time, classmb =~ X2 + X3, subject = 'ID', ng = 2, data = data_hlme)) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.