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. To change the default
choise of fitting method, see gam
arguments method
and optimizer
.gam.control(irls.reg=0.0,epsilon = 1e-06, maxit = 100,
mgcv.tol=1e-7,mgcv.half=15, trace = FALSE,
rank.tol=.Machine$double.eps^0.5,
nlm=list(),optim=list(),newton=list(),
outerPIsteps=0,idLinksBases=TRUE,scalePenalty=TRUE,
keepData=FALSE)
TRUE
to turn on diagnostic output.mgcv
).nlm
if this is
used for outer estimation of smoothing parameters (not default). See details.optim
if this
is used for outer estimation of smoothing parameters (not default). See details.id
mechanism (see s
), should they also have the same
bases. Set this to FALSE
only if you are sure you know what you are gamm
is somewhat sensitive to the absolute scaling
of the penalty matrices of a smooth relative to its model matrix. This option rescales
the penalty matrices to accomodate this problem. Probably should be sdata
argument be kept in the gam
object? Strict compatibility with class glm
would keep it, but it wastes space to
do so.newton
is controlled by the list newton
with the following elements: conv.tol
(default
1e-6) is the relative convergence tolerance; maxNstep
is the maximum
length allowed for an element of the Newton search direction (default 5);
maxSstep
is the maximum length allowed for an element of the steepest
descent direction (only used if Newton fails - default 2); maxHalf
is
the maximum number of step halvings to permit before giving up (default 30).If outer iteration using nlm
is used for fitting, then the control list
nlm
stores control arguments for calls to routine
nlm
. The list has the following named elements: (i) ndigit
is
the number of significant digits in the GCV/UBRE score - by default this is
worked out from epsilon
; (ii) gradtol
is the tolerance used to
judge convergence of the gradient of the GCV/UBRE score to zero - by default
set to 10*epsilon
; (iii) stepmax
is the maximum allowable log
smoothing parameter step - defaults to 2; (iv) steptol
is the minimum
allowable step length - defaults to 1e-4; (v) iterlim
is the maximum
number of optimization steps allowed - defaults to 200; (vi)
check.analyticals
indicates whether the built in exact derivative
calculations should be checked numerically - defaults to FALSE
. Any of
these which are not supplied and named in the list are set to their default
values.
Outer iteration using optim
is controlled using list
optim
, which currently has one element: factr
which takes
default value 1e7.
Wood, S.N. (2008) Fast stable direct fitting and smoothness selection for generalized additive models. J.R.Statist.Soc.B 70(3):495-518.
gam
, gam.fit
, glm.control