stepPlot: Plot the steps of the fit of a mixture of regressions model.

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/stepPlot.R

Description

Fit a mixture of regressions model, one EM step at a time, plotting the result after each step.

Usage

1
2
3
stepPlot(fmla, ncomp = NULL, eqVar = FALSE, thetaStart = NULL,
         nsteps = 100, eps = 1e-06, digits = 7, maxTry = 5,
         seed = NULL, data)

Arguments

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 mixreg().

thetaStart

See mixreg().

nsteps

Integer scalar; the maximum number of EM steps to be undertaken.

eps

See mixreg().

digits

The number of digits to which the details about the EM steps are printed out.

maxTry

See mixreg().

seed

See mixreg().

data

A data frame containing the variables to which the model is to be fitted.

Details

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.

Value

An object of class "mixreg". See mixreg(). The model being fitted may not have converged.

Author(s)

Rolf Turner r.turner@auckland.ac.nz

References

See mixreg().

See Also

mixreg().

Examples

1
2
3
4
5
6
7
8
## 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.

mixreg documentation built on Oct. 14, 2021, 9:12 a.m.