Re: [S] Model selection in step.gam

Prof Brian Ripley (
Thu, 20 Aug 1998 10:11:49 +0100 (BST)

> From: (Rasmus Ejrnæs)
> Date: Thu, 20 Aug 1998 10:55:24 +0100
> I am still, but hopefully not for long, using S-Plus vers.3.3.
> From Venables & Ripley 1. ed. it appears that the "step"-function in
> S-Plus does not use the real AIC-criterion given by Akaike. From
> newsgroup postings dating back to february I understand that the
> documentation in the S-Plus 3.x manual is highly misleading.
> Can anybody tell me what selection criterion is then used in step.gam?

The code tests

tAIC <- deviance(tfit) + 2 * (n - tfit$df.resid) * scale

so it uses

deviance + scale x estimated no of parameters

(at least for non-singular models), and up to the difficulty of how
many parameters does a gam fit have this is the same criterion as step
(sometimes known as "Hastie's AIC").

The problems arise when `deviance' is not the -2*log-likelihood, for
instance in gaussian and gamma models. Then deviance/scale is an
approximation to const -2*log-likelihood, which may be adequate if the
scale estimate would not differ much between models, but can also be
very different. One further twist is that for gamma models the scale
estimate is not the MLE and can be quite different from the MLE.

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

----------------------------------------------------------------------- This message was distributed by To unsubscribe send e-mail to with the BODY of the message: unsubscribe s-news