I think you want to do this rw2 + besag, the other way around, group
besag with rw2
On Thu, 2021-12-02 at 03:35 -0800, Stefan Siegert wrote:
> I have a spatio-temporal data set and want to fit a rw2 + besag
> kronecker product model, and use it to make predictions. For testing I
> started with an rw2 group iid model:
>
> inla(formula = Y ~ -1 + f(i_week, model='rw2', constr=FALSE,
> group=i_lad,
> control.group=list(model='iid')),
> data = d,
> family='binomial', Ntrials=d$n,
> control.predictor=list(compute=TRUE, link=1))
>
> All data in the last week are NA and so are predicted by extrapolating
> the RW2 (hence the constr=FALSE). The results look as expected:
>
> screenshot-20211202-11:18:01.png
>
> Then I swapped out 'iid' for 'besag', to borrow strength from spatial
> neighbors, as in:
>
> inla(formula = Y ~ -1 + f(i_week, model='rw2', constr=FALSE,
> group=i_lad,
>
> control.group=list(model='besag', graph=lad_adj)),
> data = d,
> family='binomial', Ntrials=d$n,
> control.predictor=list(compute=TRUE, link=1))
>
> The results change dramatically, and not in a good way:
>
> screenshot-20211202-11:19:27.png
>
> I think this has to do with the sum-to-zero constraint in the besag
> model. If so, is there any way to turn the constraint off inside
> control.group? (I tried control.group(..., constr=FALSE) but that
> didn't work.)
>
> Any suggestions are welcome - many thanks in advance!
Håvard Rue
he...@r-inla.org