Hello R-INLA Community,

68 views
Skip to first unread message

Getachew Dejene

unread,
Nov 7, 2024, 10:36:11 AM11/7/24
to R-inla discussion group

Hello R-INLA Community,

I’m working with a "spatio-temporal" dataset structured as follows: 

Data_structure.png

My goal is to model seasonal patterns with a 131-week period across 21 counties, and I’m incorporating trigonometric functions as a function of time (using week to capture the seasonal variation). The model I’m aiming to fit is as follows:

Where:

  • : Baseline effect for each county (random intercept).
  • and : Coefficients for sine and cosine terms to capture seasonality.
  • : Spatial effect for each county.
  • : Temporal random effect for each week.
  • : Residual error term.

To achieve this, I specified the model formula in R-INLA as:

####### 

 formula_trig <- cases ~ sin_week + cos_week + f(County, model = "iid") + 

 f(ID.County, model = "bym", graph = Al_g) +   f(week, model = "rw1") 

########  

model <- inla( formula_trig, family = "poisson", 

 data = df, control.predictor = list(compute = TRUE), control.compute = list(dic = TRUE, waic = TRUE) 

, Since I’m relatively new to R-INLA, I’m reaching out for guidance on: 

  1. Best practices for using trigonometric functions within a spatio-temporal model in INLA.
  2. Model setup advice, especially around specifying spatial and temporal random effects.
  3. Any recommended resources or tutorials that could help me understand how to incorporate time-based trigonometric functions for seasonal patterns.

Any insights, examples, or references to relevant materials would be greatly appreciated!

Thank you very much for your time and help!

Best regards!!


Reply all
Reply to author
Forward
0 new messages