mgcv
which allows control of the numerical options for fitting a GAM.
Typically users will want to modify the defaults if model fitting fails to converge, or if the warnings are generated which suggest a
loss of numerical stability during fitting.gam.control(irls.reg=0.0,epsilon = 1e-04, maxit = 20,globit = 20,
mgcv.tol=1e-6,mgcv.half=15,nb.theta.mult=10000, trace = FALSE,
fit.method="magic",perf.iter=TRUE,rank.tol=.Machine$double.eps^0.5)
gam.fit
.globit
IRLS iterations with normal GCV optimization have been performed. Note that fit method "magic"
makes no distinction
between cautiomaxit
iterations will be performed using cautious GCV/UBRE optimization.nb.theta.mult
, while the minimum value is set to the initial value divided by
nb.theta.mult
TRUE
to turn on diagnostic output."mgcv"
to use the method described in Wood (2000). Set to "magic"
to use a
newer numerically more stable method, which allows regularization and mixtures of fixed and estimated smoothing parameters.
Set to "fastest
TRUE
to use Gu's approach to finding smoothing
parameters in which GCV or UBRE is
applied to the penalized linear modelling problem produced at each IRLS iteration. This method is very fast, but means that it
is often possible to finfit.method="magic"
."mgcv"
,
maxit
and globit
control the maximum iterations of the IRLS algorithm, as follows:
the algorithm will first execute up to
globit
steps in which the GCV/UBRE algorithm performs a global search for the best overall
smoothing parameter at every iteration. If convergence is not achieved within globit
iterations, then a further
maxit
steps are taken, in which the overall smoothing parameter estimate is taken as the
one locally minimising the GCV/UBRE score and resulting in the lowest EDF change. The difference
between the two phases is only significant if the GCV/UBRE function develops more than one minima.
The reason for this approach is that the GCV/UBRE score for the IRLS problem can develop "phantom"
minimima for some models: these are minima which are not present in the GCV/UBRE score of the IRLS
problem resulting from moving the parameters to the minimum! Such minima can lead to convergence
failures, which are usually fixed by the second phase.Wood, S.N. (2000) Modelling and Smoothing Parameter Estimation with Multiple Quadratic Penalties. J.R.Statist.Soc.B 62(2):413-428
Wood, S.N. (2003) Thin plate regression splines. J.R.Statist.Soc.B 65(1):95-114
gam
, gam.fit
, glm.control