multistart | R Documentation |
Fit a model using multiple sets of starting values.
## S4 method for signature 'mix'
multistart(object, nstart=10, initIters=10, ...)
object |
An object of class |
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. |
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.
A fitted (dep)mix
object.
Ingmar Visser & Maarten Speekenbrink
data(speed)
# this example is from ?fit with fit now replaced by multistart and the
# set.seed statement is left out
mod1 <- 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.