[R] mgcv and gamm4: REML, GCV, and AIC

Ben Bolker bbolker at gmail.com
Thu Aug 9 17:04:01 CEST 2012


john benson <smilodon2000 <at> hotmail.com> writes:


> I've been using gamm4 to build GAMMs for exploring environmental
> influences on genetic ancestry.  Things have gone well and I have 2
> very straightforward questions: 1. I've used method=REML.  Am I
> correct that this is an alternative method for estimating the smooth
> functions in GAMMs rather than GCV that is often used for GAMs?
> I've read up on REML and it makes sense, but I'm confused about
> whether GCV is used for any part of the model formation of a GAMM
> with method=REML.  I think it is not.  Is this why no GCV score is
> returned for GAMMs through mgcv and gamm4?  For Gams I've always
> used the GCV scores to help with model selection, but I assume these
> aren't available for GAMMs estimated with REML.

   To the best of my knowledge, REML and GCV are not doing
similar things.  REML is an approach for estimating variance
components in a less-biased way (as you will have seen in your
reading).  However, one major caveat with REML is that it is
inappropriate to compare models with different fixed effects
that have been estimated via REML, so (if that's what you're
doing) **you might not want to use REML** ...  In contrast, GCV is
used to estimate the degree of smoothing/penalization factor
for the smooth functions.

> 2. Instead I've been using AIC values with GAMMs.  Is it correct to
> use the AIC value from the underlying linear mixed model,
> i.e. extracted using summary(gamm1$mer)?  Or is there another AIC
> calculated specifically for the gam object?  Many thanks for help
> with these (admittedly simple and boring) questions, I really like
> the mgcv and gamm4 packages which I've found very user friendly in
> conjunction with Wood (2006).  John

  I seem to recall that this is a bit delicate, and that there
may be a discussion somewhere in the mgcv help files -- but I 
don't remember where and can't find it at the moment.  The thing to be
careful about is that the effective degrees of freedom are 
appropriately represented in the 'mer' part of the fit ...



More information about the R-help mailing list