Overfitting in temporal model

26 views
Skip to first unread message

Dan

unread,
Jun 8, 2021, 9:40:57 AM6/8/21
to R-inla discussion group
I fitted a piecewise regression model for species counts, but for three species the model results are not accurate. Any ideas to fix this?

fit <- lapply(seq_along(X), function(x)
       inla(Y ~ 1 + year000 + y2006 + y2011 + f(year1, model = "ar1"), 
       data = data.frame(Y = X[[x]]$Count, year1 = 1:15,
                         year000 = (year-2003)*(year<2006),
                         y2006 = (year-2006)*(year>=2006)*(2011>year),
                         y2011 = (year-2011)*(year>=2011)), 
       family = "poisson", control.family = list(link = "log"), 
       control.compute = list(dic = TRUE,cpo = TRUE, po = TRUE)))

Thanks in advance

Elias T. Krainski

unread,
Jun 8, 2021, 3:13:00 PM6/8/21
to Dan, R-inla discussion group
Maybe 'ar1' is not smoothing enough. How about 'rw2'? Bwt, are you also trying a kind of segmented regression with these three fixed effects?

--
You received this message because you are subscribed to the Google Groups "R-inla discussion group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to r-inla-discussion...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/r-inla-discussion-group/94734860-f558-40b6-9e4f-9e29e7b7138fn%40googlegroups.com.

Udani Wijewardhana

unread,
Jun 8, 2021, 5:05:03 PM6/8/21
to Elias T. Krainski, R-inla discussion group
Hi Elisa,

Yes, this is a segmented regression model. 


From: Elias T. Krainski <eliask...@gmail.com>
Sent: Wednesday, June 9, 2021 5:12:46 AM
To: Dan <udaniwij...@gmail.com>
Cc: R-inla discussion group <r-inla-disc...@googlegroups.com>
Subject: Re: [r-inla] Overfitting in temporal model
 
Reply all
Reply to author
Forward
0 new messages