[R-sig-ME] Autocorrelation in a GAMM for nightly time series

Gavin Simpson gavin.simpson at ucl.ac.uk
Thu Jun 6 16:42:05 CEST 2013


On Thu, 2013-06-06 at 16:29 +1200, Andrew Digby wrote:
> > 
> > From: Ben Bolker <bbolker at gmail.com>
> > Subject: Re: [R-sig-ME] Autocorrelation in a GAMM for nightly time series
> > Date: 5 June 2013 13:35:51 NZST
> > To: r-sig-mixed-models at r-project.org
> > 
> > 
> > Andrew Digby <andrewdigby at ...> writes:
> > 
> >> I'm analysing call counts of a nocturnal species in 
> >> response to temporal and environmental effects. Over a
> >> period of 3 years I divide each night into 10 equal-length blocks, 
> >> and count the calls of each sex in each
> >> block. 
> > 
> > [snip]
<snip/>
> 
> Thanks very much for that, Ben. The amount of help you provide through
> these forums is truly impressive!
<snip />
> So thanks to your help the model is improved, although the
> autocorrelation problem remains. I have a couple of remaining
> questions regarding this, which I'd really appreciate advice with: 

Can I just check that you are using the normalised residuals here? The
default for `resid()` will give you deviance? residuals and won't take
the covariance matrix into account. The normalised residuals will do
that:

resid(mod$lme, type = "normalised")

See ?resid.lme with the nlme package loaded.

This often catches peoples out (me included) at first.

G

> 1) ACF confidence intervals: because I have a large dataset (~40,000
> counts in ~11,000 bins), the 95% confidence intervals of the acf
> [acf(resid(gamm.model, type='n')] are tiny: about +/- 0.01. So while
> the peaks in the ACF  exceed these, they're still small correlations:
> ~0.1. Because my data have lots of time gaps in them, since they're
> just lots of nights merged together, can I rely on these confidence
> intervals and ACF calculation? Am I overstating the importance of the
> ACF? When I construct a variogram (as per Zuur et al's 2009 book),
> it's pretty flat, suggesting that there are no major independence
> problems.
> 
> 2) This model seems to need a complex correlation structure: an AR
> correlation between time bins in the same night (TimeofNight |
> NightofYear), AND correlation (AR?) between the same time bin on
> different nights (1 | TimeofNight). Several sources warn against using
> over-complicated correlation structures. But if the ACF shows residual
> autocorrelation with more basic structures, isn't a more realistic
> structure needed; or am I putting too much emphasis on the ACF CIs
> (question 1)?
> 
> Again, many thanks.
> 
> Andrew
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
> 


-- 
Gavin Simpson, PhD                          [t] +1 306 337 8863
Adjunct Professor, Department of Biology    [f] +1 306 337 2410
Institute of Environmental Change & Society [e] gavin.simpson at uregina.ca
523 Research and Innovation Centre          [tw] @ucfagls
University of Regina
Regina, SK S4S 0A2, Canada

%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%



More information about the R-sig-mixed-models mailing list