Methods to fit a (dep-)mix model using multiple sets of starting values
Methods to fit a (dep-)mix model using multiple sets of starting values
Fit a model using multiple sets of starting values.
## S4 method for signature 'mix'multistart(object, nstart=10, initIters=10,...)
Arguments
object: An object of class mix or depmix.
nstart: The number of sets of starting values that are used.
initIters: The number of EM iterations that each set of starting values is run.
...: Not used currently.
Details
Starting values in the EM algorithm are generated by randomly assigning posterior state probabilities for each observation using a Dirichlet distribution. This is done nstart
times. The EM algorithm is run initIters times for each set of starting values. The then best fitting model is then optimized until convergence. A warning is provided about the number of sets of starting values that are infeasible, e.g. due to non-finite log likelihood, if that number is larger than zero. Note that the number of iterations reported in the final fitted model does not include the initial number of iterations that EM was run for.
Returns
A fitted (dep)mix object.
Examples
data(speed)# this example is from ?fit with fit now replaced by multistart and the # set.seed statement is left outmod1 <- depmix(list(rt~1,corr~1),data=speed,transition=~Pacc,nstates=2, family=list(gaussian(),multinomial("identity")),ntimes=c(168,134,137))set.seed(3)fmod1 <- fit(mod1)fmod2 <- multistart(mod1)fmod1
fmod2