Backfitting Algorithms for GAM

DESCRIPTION:

Backfitting algorithms for GAM.

USAGE:

s.wam(x, y, w, s, which, smooth.frame, maxit, tol, trace, se,  
      backchat, ...) 
lo.wam(x, y, w, s, which, smooth.frame, maxit, tol, trace, se,  
      backchat, ...) 
all.wam(x, y, w, s, which, smooth.frame, maxit, tol, trace, se, ...) 

REQUIRED ARGUMENTS:

x
a model matrix, as produced by model.matrix
y
a response vector
w
a weight vector (required)
s
starting values for the nonlinear part of the smooth terms (required, can be 0)
which
a character vector of term labels, indexing the columns of smooth.frame
smooth.frame
Either a model frame produced by gam, or the component by the same number returned by any of these functions for subsequent repeated calls.

OPTIONAL ARGUMENTS:

maxit
maximum number of backfitting iterations. The default is the parameter bf.maxit set in gam.control.
tol
tolerance used to establish convergence of backfitting. The default is bf.epsilon set in gam.control.
trace
if TRUE, iteration details are printed; default is FALSE.
se
if TRUE (default), standard errors are computed along with the fit.
backchat
if TRUE, the fortran code interacts directly with the S-PLUS code in gam to test for local-scoring convergence, and obtain an updated response and weights.
...
a sink for extra arguments.

VALUE:

An object is returned that is a subset of a gam object, with one additional element called smooth.frame (see below). These functions are not really intended for public use, and are fragile. In particular, the arguments are not checked for type.

DETAILS:

All three functions fit additive models by backfitting, or iteratively resmoothing partial residuals. They all use the modified backfitting algorithm of Buja, Hastie and Tibshirani (1989), described in Statistical Models in S.This algorithm separates out the parametric, linear part of the fit from the nonlinear part for each smooth term, and fits all these linear parts together using the QR algorithm.
If all the smooth terms are specified using s, then s.wam) is an interface to an efficient Fortran subroutine for performing the fit. Similarly for lo and lo.wam. If the model uses smoothers of both kinds, or others, all.wam is used. The character vector gam.wlist lists all the special .wam functions currently available, namely c("s", "lo").
The first time the functions are called, smooth.frame should be the model frame produced by the call to gam. The backfitting functions extract the attributes of all the columns indexed by which, which indicates which terms are smooth terms. These attributes get processed, and stored back on smooth.frame in a condensed form, and returned by the backfitting functions. On subsequent calls to the backfitter by gam, these processed smooth.framess are used directly.
All the smooth terms in the initial smooth.frame have an attribute call. When all.wam is used, these are evaluated repeatedly in the backfitting loop. This makes all.wam very general, and allows users to use their own smoothersin all.wam.

SEE ALSO:

, .