Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Temporal autocorrelation in GAM

I'm modelling species count data that has been collected sporadically over the last ~40 years against a range of environmental predictors. At present, my GAM looks like this:

k = gam(CountIndividuals ~ s(Date, bs = 'cr', k = 8) + 
s(ENSO, bs = 'cr', k = 4) + s(mean_wind_speed, bs = 'cr', k = 4) + 
s(CHL, bs = 'cr', k = 4) + s(SST, bs = 'cr', k = 4) + 
s(SIOD, bs = 'cr', k = 4), family = nb(link = log), 
data = Shy_Albatross, method = "REML")

I've been worried about autocorrelation in the variables, however upon inspecting k$residuals with ACF() and PACF() there didn't appear to be any autocorrelation.

My question is whether I need to assess each variable in the model individually? There should be autocorrelation in there values, however I'm not sure whether that is relevant.

like image 636
Nicholas Patt Avatar asked Dec 04 '25 16:12

Nicholas Patt


1 Answers

An assumption of the model is that the observations are conditionally independent. If you model the autocorrelation through terms in the model, and it is reasonable to expect that the smooth functions of Date and the other variables in the model are accounting for the temporal structure in the data such that once we consider the model, the observations are independent.

By looking at the residuals you are looking at the observations conditional upon the model.

like image 55
Gavin Simpson Avatar answered Dec 07 '25 05:12

Gavin Simpson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!