Spatially varying coefficient model

222 views
Skip to first unread message

Vera Tibot

unread,
Feb 9, 2021, 10:35:27 AM2/9/21
to R-inla discussion group
Hello all,

this question is more about modelling but hopefully, someone can give me some insights.

I would like to fit the following spatio-temporal model using the inlabru package

y_it  ~ a_i + b_i * X1_t + c_i * X2_t

where y_it is the response variable for grid point i and time t and a_i, b_i, c_i are assumed to be IID draws from the gaussian random fields N(a, Sa), N(b, Sb), and N(c, Sc) respectively.

The predictors X1 and X2 vary over time and for a given time they are the same for all grid points. 

The idea is to have a model where the coefficients (a, b, c) vary over space continuously (the existing models fit a separate regression model for each grid point..).

Does this make sense? Should I be worried of identifiability problems?

Thank you for your time,

Vera
  

Helpdesk

unread,
Feb 9, 2021, 11:51:17 AM2/9/21
to Vera Tibot, R-inla discussion group

f(idx, x, model = ...)

will give a model for the regression coefficients with covariates x

this view can be nicely unified, see

https://arxiv.org/abs/1806.02084


the only detail, is that constr=T might not be what you want, like

f(time, x, model="rw1")

then the coefficients sum to zero, but you would want

f(time, x, model="rw1", constr=FALSE)


Best
H
> --
> 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/432c86ac-db5a-489b-9a7a-0fb45ea59991n%40googlegroups.com
> .

--
Håvard Rue
he...@r-inla.org

Vera Tibot

unread,
Feb 10, 2021, 4:16:21 AM2/10/21
to R-inla discussion group
Ah ok, I see! Many thanks for the prompt reply, I'll have a look at the paper. 

Best 

Vera Tibot

unread,
Mar 22, 2021, 2:37:22 PM3/22/21
to R-inla discussion group
Hi again,

In the paper https://arxiv.org/abs/1806.02084, a sum-to-zero constraint (constr=TRUE) is imposed in both the examples presented. If I understand correctly, in the first example (5.1), it's done to avoid confounding between the fixed and spatially varying effects for the PM variable (Eq. 15), while in the second case (5.2, Eq. 15) it is used to avoid the confounding between the spatially structured residual (epsilon) and the spatially varying random effects (area and Oarea).

In the previous email, Professor Rue suggested that for the spatially varying coefficient model described above, constr=FALSE should be used. Can someone help me to clarify this point? I thought that for the model to be identifiable a sum-to-zero constraint would be necessary (so constr=TRUE in the inla code).

Thank  you!  

V

Helpdesk

unread,
Mar 23, 2021, 12:04:46 PM3/23/21
to Vera Tibot, R-inla discussion group

Usually, if you want to have a flexible version of

beta * x(s)

for a varying covariate x over s, like

beta(s) * x(s)

then you do not want or need that sum_s beta(s)=0. this is kind of only
justified, you you want to separate the average effect of beta from the
variation, like

beta * x(s) + beta(s) * x(s)

coded as

~ ... + x + f(s, x, model="...", constr=TRUE)

where sum_s beta(s)=0.

Vera Tibot

unread,
Mar 24, 2021, 2:19:18 PM3/24/21
to R-inla discussion group
I see, thanks for the fast reply. A part from the separability of the model terms, might it also matter in order for the model to successfully run? I am asking because in the model above if I don't set constr = TRUE for the spatially varying terms,  I run into numerical singular matrices ("Function: GMRFLib_factorise_sparse_matrix_TAUCS(), Line: 876, Thread: 0. Fail to factorize Q. ").

Thank you

Helpdesk

unread,
Mar 25, 2021, 6:54:23 AM3/25/21
to Vera Tibot, R-inla discussion group

you might need a proper prior for the intercept, try with

control.fixed=list(prec.intercept=1)

to see if that help
Reply all
Reply to author
Forward
0 new messages