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))