gam2objective {mgcv}R Documentation

Objective functions for GAM smoothing parameter estimation


Estimation of GAM smoothing parameters is most stable if optimization of the UBRE or GCV score is outer to the penalized iteratively re-weighted least squares scheme used to estimate the model given smoothing parameters. These functions evaluate the GCV/UBRE score of a GAM model, given smoothing parameters, in a manner sutable for use by optim or nlm. Not normally called directly, but rather service routines for gam.outer.




lsp The log smoothing parameters.
args List of arguments required to call gam.fit2.
printWarn Should gam.fit2 print some warnings? Used to suppress warnings that are only of interest for the final fitted model, until that model is reached.
... Other arguments for passing to gam.fit2.


gam2objective and gam2derivative are functions suitable for calling by optim, to evaluate the GCV/UBRE score and it's derivatives w.r.t. log smoothing parameters.

gam3objective is an equaivalent to gam2objective, suitable for optimization by nlm - derivatives of the GCV/UBRE function are calculated and returned as attributes.

The basic idea of optimizing smoothing parameters `outer' to the P-IRLS loop was first proposed in O'Sullivan et al. (1986).


Simon N. Wood


O 'Sullivan, Yandall & Raynor (1986) Automatic smoothing of regression functions in generalized linear models. J. Amer. Statist. Assoc. 81:96-103.

See Also

gam.fit2, gam, mgcv, magic

[Package mgcv version 1.3-23 Index]