[R-sig-eco] Comparison of gam and gamm fits

Thackeray, Stephen J. sjtr at ceh.ac.uk
Wed Feb 8 10:13:02 CET 2012


Dear list members,

I apologise in advance for the large-ish email, but I thought it was important to paste in some plots for what follows.

I am using generalised additive models to capture patterns of seasonal and interannual variation in the abundance of zooplankton, in a lake ecosystem. I am trying to fit models with smoothers for year and day of year to capture the "average" pattern in each of these temporal dimensions, and then have added a two-dimensional (tensor product) smoother to try to model any changes in the seasonal pattern among years. I am mindful that I may need to deal with correlated errors in these models and so would like to fit error structures to see if they improve model fit, judged by AIC. Therefore, as a first step I re-fitted the gam model using gamm, to allow later inclusion of a correlation structure:

Daph_gam4<-gam((DAPHG+0.1)~s(Year,bs="cr")+s(DOY,bs="cr")+te(Year,DOY),family=Gamma(link="log"),data=ZooDat2)
Daph_gam4_no_ac<-gamm((DAPHG+0.1)~s(Year,bs="cr")+s(DOY,bs="cr")+te(Year,DOY),family=Gamma(link="log"),data=ZooDat2)

...where DAPHG is the abundance of a particular species of interest and DOY= day of year. I am using a Gamma distribution as the data are heavily skewed and on a continuous scale (numbers per litre lake water).

The problem I am having is that these two models produce dramatically different fits, see the image plots below. In this case the result of the gam model (Daph_gam4, labelled gam in the plot) bears a much greater resemblance to the original data. Could anyone help me to understand why these two model fits are so very different, when they are fitting the same smoothers?

Any help much appreciated!

Steve





Dr Stephen  Thackeray
Lake Ecosystem Group
Centre for Ecology and Hydrology
Lancaster Environment Centre
Library Avenue
Bailrigg
Lancaster
LA1 4AP
sjtr at ceh.ac.uk<mailto:sjtr at ceh.ac.uk>



-- 
This message (and any attachments) is for the recipient only. NERC
is subject to the Freedom of Information Act 2000 and the contents
of this email and any reply you make may be disclosed by NERC unless
it is exempt from release under the Act. Any material supplied to
NERC may be stored in an electronic records management system.


More information about the R-sig-ecology mailing list