Hi you all,
I am fitting a model accounting for spatial correlation, and some spatio-temporal correlations according to Blangiardo and Cameletti (2015) and Zuur and Ieno (2017), which in turn relied on Knorr-Held (2000).
The scope of my model is to predict changes in hunting bags of deer across 234 hunting districts, over 18 years.
The model I selected with CPOs, DIC and WAIC basically has a BYM correlation structure, plus a type III interaction between space and time, allowing for year-specific correlations in hunting bags between neighboring districts, which however do not have any consistent temporal pattern.
Find below the formula, where "year", "year1" and "year2" are years, from 1 to 18 and hg.num is the number of each of the 234 hunting districts:
mod <- inla(formula = value ~
f(hg.name.num,
model = "bym", graph = g,
hyper = HyperBYM,
adjust.for.con.comp = TRUE,
constr = TRUE,
scale.model = TRUE) +
f(year, model = "rw2", constr = TRUE, scale.model = TRUE) +
f(year1, model = "iid") +
f(year2, model = "iid", group = hg.name.num1, control.group = list(model =
"besag", graph = g)),
family = 'zeroinflatednbinomial1',
data = roe.df,
control.predictor = list(compute = TRUE),
control.compute = list(dic = TRUE, waic = TRUE,
cpo = TRUE, #Cross validation values
return.marginals.predictor = TRUE,
config = TRUE),
control.inla = list(cmin = 0),
control.family = list(hyper = hypNB))
```
The model looks reasonable, however I would like to plot spatial random effects, or the percentage change in my response due to the structures spatial effect. So, following Zuur and Ieno (2017), I calculated them as:
```
100 * (exp(mod$summary.random$hg.name.num$mean) - 1)
```
The problem is that I obtain 468 values, or basically duplicates of the 234 hunting grounds. I am not sure why this is happening, however if I plotted the first 234 values and values from 235 to 468 these are quite correlated.
It seems that my model is estimating two types of spatial random effects for each one of my 234 hunting districts.
Do you have any idea on why this might be happening?
Jacopo Cerri
Mammal Research Institute
Polish Academy of Sciences