Learn R Programming

mgcv (version 0.2-1)

gam: Generalized Additive Models using penalized regression splines and GCV

Description

Fits the specified generalized additive model to data. The GAM is represented using one dimensional penalized regression splines with smoothing parameters selected by GCV.

Usage

gam(formula,data,weights,family,scale)

Arguments

formula
A GAM formula. This is exactly like the formula for a glm exept that smooth terms can be added to the right hand side of the formula, and the l.h.s. must contain only the names of a variable, and not some transformation function applied to a named variabl

Details

Each smooth model terms is represented using a cubic penalized regression spline. Knots of the spline are placed evenly throughout the covariate values to which the term refers: For example, if fitting 101 data with a 10 knot spline of x then there would be a knot at every 10th (ordered) x value. The use of penalized regression splines turns the gam fitting problem into a penalized glm fitting problem, which can be fitted using a slight modification of glm.fit : gam.fit. The penalized glm approach also allows smoothing parameters for all smooth terms to be selected simultaneously by GCV or UBRE. This is achieved as part of fitting by calling mgcv within gam.fit. Details are given in Wood (2000).