Rev 8553 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{gam.outer}\alias{gam.outer}%- Also NEED an `\alias' for EACH other topic documented here.\title{Minimize GCV or UBRE score of a GAM using `outer' iteration}\description{Estimation of GAM smoothing parameters is most stable ifoptimization of the smoothness selection score (GCV, GACV, UBRE/AIC, REML, ML etc)is outer to the penalized iterativelyre-weighted least squares scheme used to estimate the model given smoothingparameters.This routine optimizes a smoothness selection score in this way. Basically thescore is evaluated for each trial set of smoothing parameters byestimating the GAM for those smoothing parameters. The score is minimizedw.r.t. the parameters numerically, using \code{newton} (default), \code{bfgs}, \code{optim} or \code{nlm}. Exact(first and second) derivatives of the score can be used by fitting with\code{\link{gam.fit3}}. Thisimproves efficiency and reliability relative to relying on finitedifference derivatives.Not normally called directly, but rather a service routine for \code{\link{gam}}.}\usage{gam.outer(lsp,fscale,family,control,method,optimizer,criterion,scale,gamma,G,start=NULL,nei=NULL,...)}%- maybe also `usage' for other objects documented here.\arguments{\item{lsp}{The log smoothing parameters.}\item{fscale}{Typical scale of the GCV or UBRE/AIC score.}\item{family}{the model family.}\item{control}{control argument to pass to \code{\link{gam.fit3}} etc.}\item{method}{method argument to \code{\link{gam}} defining the smoothness criterion to use (but depending on whether or not scale known).}\item{optimizer}{The argument to \code{\link{gam}} defining the numerical optimization method to use. }\item{criterion}{Which smoothness selction criterion to use. One of \code{"UBRE"},\code{"GCV"}, \code{"GACV"}, \code{"REML"} or \code{"P-REML"}. }\item{scale}{Supplied scale parameter. Positive indicates known.}\item{gamma}{ The degree of freedom inflation factor for the GCV/UBRE/AIC score.}\item{G}{List produced by \code{mgcv:::gam.setup}, containing most of what'sneeded to actually fit a GAM.}\item{start}{starting parameter values.}\item{nei}{List specifying neighbourhood structure if NCV used. See \code{\link{gam}}.}\item{...}{other arguments, typically for passing on to \code{gam.fit3} (ultimately).}}\details{See Wood (2008) for full details on `outer iteration'.}\references{Wood, S.N. (2011) Fast stable restricted maximum likelihoodand marginal likelihood estimation of semiparametric generalized linearmodels. Journal of the Royal Statistical Society (B) 73(1):3-36}\author{ Simon N. Wood \email{simon.wood@r-project.org}}\seealso{\code{\link{gam.fit3}}, \code{\link{gam}}, \code{\link{magic}}}\keyword{models} \keyword{smooth} \keyword{regression}%-- one or more ...