Hello,
I was trying to construct the precision matrix using with inla.spde2.precision(), but I got two different answers. The first approach is to directly pass the parameter theta=(log(tau), log(kappa)) to get the precision matrix; the second approach is to pass theta=(0, log(kappa)), and then multiple the resulting precision matrix by tau. According to the equation on Page 4 of Lindgren and Rue (2015, Bayesian modeling with R-INLA), I should get the same precision matrix. However, the following test indicates that they are quite different. Am I missing something here? Thank you very much for any suggestions.
set.seed(123)
#--- Set up 2D grid
n1 <- 15
n2 <- 15
n <- n1 * n2
coords <- as.matrix(expand.grid(x = seq(0, 1, length.out = n1),
y = seq(0, 1, length.out = n2)))
# Construct SPDE-based GMRF
mesh <- inla.mesh.2d(loc = coords,
cutoff = 0.05, # drop duplicates
max.edge = c(0.05, 0.1), # inner / outer edge length
offset = c(0.08, 0.1)) # extends mesh beyond data
spde <- inla.spde2.matern(mesh, alpha = 2) # nu=alpha - d/2
log_tau = log(2)
log_kappa = log(0.5)
# the precision matrix Q = tau^2 * Q_0, where Q_0=kappa^4 C + 2*kappa^2 G_1 + G_2
Q1 = inla.spde2.precision(spde, c(log_tau,log_kappa))
Q0 = inla.spde2.precision(spde, c(0,log_kappa))
Q2 = exp(log_tau) * Q0
norm(Q1-Q2,"F")
Thanks,
Pulong M