We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

Neill Prohaska • 5 years ago

I've been figuring out GAMs lately and am particularly interested in using them to analyze time series data (for which your blogpost on using GAMs to model seasonal data was extremely helpful). Which leads me to wonder whether it would be possible to take the approach you have outlined in this blogpost, but using the penalized B-spline in a GAMM model that deals with temporal autocorrelation via the argument "correlation = corARMA(form = ~ 1|time, p = `x`)" ?

I've tried to make this work, but get an error message that the basis function is not supported in a random effects model ("Error in smooth2random.mgcv.smooth(sm, names(data)) : Can not convert this smooth class to a random effect"). In my case I am interested in extrapolating only slightly beyond the range of one of my explanatory variables that has a fairly linear response at its upper-limit so the TPRS prediction might not actually be a terrible way to go, but it seems like serial-autocorrelation is likely a more general problem with the kinds of data that folks might want to model and extrapolate from using the B-spline.

Carlos HenrĂ­quez • 5 years ago

Dear Gavin, thanks for your posts.

I am wondering how to apply this procedure for my time series of Temperature. I intend to extrapolate my data from (2002 to 2014) until 2030 using the B-spline approach.