| stepPlot | R Documentation |
Fit a mixture of regressions model, one EM step at a time, plotting the result after each step.
stepPlot(fmla, ncomp = NULL, eqVar = FALSE, thetaStart = NULL,
nsteps = 100, eps = 1e-06, digits = 7, maxTry = 5,
seed = NULL, data)
fmla |
The formula specifying the regression in the mixture model that is to be fitted. |
ncomp |
Integer scalar; the number of components in the model. Defaults to 2. |
eqVar |
See |
thetaStart |
See |
nsteps |
Integer scalar; the maximum number of EM steps to be undertaken. |
eps |
See |
digits |
The number of digits to which the details about the EM steps are printed out. |
maxTry |
See |
seed |
See |
data |
A data frame containing the variables to which the model is to be fitted. |
Can only be used in an interactive session. May give some insight into convergence problems or into the reasons for unexpected results in the fit.
An object of class "mixreg". See mixreg().
The model being fitted may not have converged.
Rolf Turner r.turner@auckland.ac.nz
See mixreg().
mixreg().
## Not run: # Interactive session is required.
vfit <- visualFit(y~x,data=kilnAfull,ncomp=3)
stepPlot(y ~ x,ncomp=3,data=kilnAfull,thetaStart=vfit$theta)
## End(Not run)
# The result is clearly slightly wrong in respect of the second ("middle")
# component, which has a slope that is too low. The outlier in
# kilnAfull may be "pulling up" the left hand end of the fitted line.