This is a driver which allows fitting of mixtures of GAMs.
1 2 3 
formula 
A formula which is interpreted relative to the formula
specified in the call to 
family 
A character string naming a 
offset 
This can be used to specify an a priori known component to be included in the linear predictor during fitting. 
control 
A list of fit control parameters returned by

optimizer 
An array specifying the numerical optimization method
to use to optimize the smoothing parameter estimation criterion; for
more details see 
in.out 
Optional list for initializing outer iteration; for more
details see 
eps 
Observations with an aposteriori probability smaller or
equal to 
... 
Additional arguments to be pased to the GAM fitter. 
Returns an object of class FLXMRmgcv
.
Bettina Gruen
1 2 3 4 5 6 7 8 9  set.seed(2012)
x < seq(0, 1, length.out = 100)
z < sample(0:1, length(x), replace = TRUE)
y < rnorm(length(x), ifelse(z, 5 * sin(x * 2 * pi), 10 * x  5))
fitted_model < flexmix(y ~ s(x), model = FLXMRmgcv(),
cluster = z + 1,
control = list(tolerance = 10^3))
plot(y ~ x, col = clusters(fitted_model))
matplot(x, fitted(fitted_model), type = "l", add = TRUE)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.