Residual spatial fields

68 views
Skip to first unread message

Tim Meehan

unread,
Aug 22, 2024, 12:56:18 PM8/22/24
to R-inla discussion group
Hi all,

I am working on a model in inlabru with count data sampled on 9 
different occasions. I'd like to demonstrate a general spatial pattern 
in the data using a spatial field. But I'd also like to account for variation in the spatial 
field across sampling occasions. So I am considering having two 
spatial field terms in my model statement, one for a 'temporally
averaged' spatial field and one grouped version for the 'residuals' 
around the temporally averaged term (see below). I suppose I could 
just do a single grouped field, but I am hoping that the way I am 
formulating the model below will make it easier to get predictions 
for the average field. Does this approach make sense?

cmp1 <- count ~ 
    # global intercept
    Intercept(1) + 
    # 'average' zero-centered spatial field?
     field(geometry, model = spde1) +  
    # 'residual' zero-centered spatial fields?
     field_residuals(geometry, model = spde2, group = date_int,
                  control.group = list(model = 'iid', hyper = pc_prior))

# given
spde1 <- spde2 <- inla.spde2.pcmatern(
  mesh = mesh1,
  prior.range = c(10000, 0.5),
  prior.sigma = c(1, 0.01)
)

pc_prior <- list(prec = list(prior = "pc.prec", param = c(1, 0.01)))

predict(object=fit1, newdata=pix1, formula=exp(Intercept + field))

Finn Lindgren

unread,
Aug 22, 2024, 1:45:21 PM8/22/24
to Tim Meehan, R-inla discussion group
Hi Rim,

Yes, in principle this makes sense. You just need to look out for potential nonidentifiability (the common field is confounded with the average of the residual fields). With 9 time points, this is probably ok, but you should check if the average of the residual fields has a noticeable spatial pattern. If it does, you might want to include that average pattern in the interpretation of the posterior common pattern.
Finn

On 22 Aug 2024, at 17:56, Tim Meehan <tme...@gmail.com> wrote:

Hi all,
--
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/b7e77461-fb54-4f2c-980a-5fcf67574883n%40googlegroups.com.

Tim Meehan

unread,
Aug 23, 2024, 10:21:25 AM8/23/24
to Finn Lindgren, R-inla discussion group

Thanks, Finn!

Reply all
Reply to author
Forward
0 new messages