Using the above formula, I tried to use diagonal=1e-06, diagonal=1e-05, diagonal=1e-04 and diagonal=1e-03 , and the spatial predictions are not the same for all these diagonal values. So, I am afraid if this is because the diagonal values have been misplaced, and constr=TRUE option wasn't included.
My work is on spatiotemporal modeling of geostatistical spatiotemporal data using SPDE approach. Let me show part of my code and I will proceed with the questions,Formula <- y ~ -1 + Intercept + f(field, model=spde, group=field.group, diagonal=1e-06,control.group=list(model="rw1", scale.model=TRUE, adjust.for.con.comp=TRUE))In previous discussions, it has been mentioned that for intrinsic models (which are almost singular) we need to specify constr=TRUE and add diagonal=1e-06 by default (and very small values in general) to make them non-singular.Q1) Is the above formula correct for specifying the diagonal value to be added on the precision matrix of rw1?
Q2) When we use rw1 or rw2 model under control.group, how is it possible to include the constr=TRUE option in r-inla?
Using the above formula, I tried to use diagonal=1e-06, diagonal=1e-05, diagonal=1e-04 and diagonal=1e-03 , and the spatial predictions are not the same for all these diagonal values. So, I am afraid if this is because the diagonal values have been misplaced, and constr=TRUE option wasn't included.
-- Håvard Rue Department of Mathematical Sciences Norwegian University of Science and Technology N-7491 Trondheim, Norway Voice: +47-7359-3533 URL : http://www.math.ntnu.no/~hrue Mobile: +47-9260-0021 Email: havar...@math.ntnu.no R-INLA: www.r-inla.org
Dear Håvard,
Thank you for the detailed explanation and your quick reply. I needed to know on both ‘constr=TRUE’ and ‘diagonal=‘ options, and sorry for the unclarity on the previous post. And your answers are helpful to understand how to use them.
Formula <- y ~ -1 + Intercept + f(field, model=spde, group=field.group, diagonal=0, control.group=list(model="rw1", scale.model=TRUE))
So, in this case, I found the following trouble.
Function: GMRFLib_factorise_sparse_matrix_TAUCS(), Line: 829, Thread: 0
Fail to factorize Q. I will try to fix it
This is actually the main reason why I previously added diagonal=1e-06. This problem will go away when I add diagonal=1e-06. But I guess, in previous formula, the diagonal=1e-06 is not added on the precision matrix of either "rw1" or "spde" model separately, rather on the joint precision matrix. Keeping diagonal=0 and replacing rw1 by ar1 model also get ride of the problem. I therefore suspect this can be related to the use of rw1, but not to the spde model like as you explained.
And then I tried the following
Formula <- y ~ -1 + Intercept + f(field, model=spde, group=field.group, diagonal=0, control.group=list(model="rw1", scale.model=TRUE, diagonal=1e-06))
but I found the following problem
Error in inla.check.control(control.group) :
Name `diagonal' in control-argument `control.group', is void.
Q1) So would you mind please to help me how to get rid of this?
Formula <- y ~ -1 + Intercept + f(field, model=spde, group=field.group, diagonal=0, constr=TRUE, control.group=list(model="rw1", scale.model=TRUE))
Here also, I found the following problem:
Error in INLA::f(field, model = spde, group = field.group, constr = TRUE, :
Option 'constr=TRUE' is disabled for model='spde2' and 'spde' and 'spde3'
So, I removed constr=TRUE option here, and this okay because I don’t need to put this constraint for the spde model. What I previously needed was to constrain the rw1 and rw2 models, but now you already told me that constr=TRUE is the default for these models under the ’control.group’ feature. This clarify my confusion.
Finally, the only worry is about the “diagonal=“ option. So, I will really appreciate your inputs on this. Thank you so much for everything.
Kind regards,
Yimer
Formula <- y ~ -1 + Intercept + f(field, model=spde, group=field.group, diagonal=0, control.group=list(model="rw1", scale.model=TRUE))