Am I doing something wrong here, where I get .00000 value for the a1 coefficient. I allow zhi and u to follow spatial correlation (using spde/mesh), and I use copy and weight options. I estimated this model with with and without the scale.model option. Same problem...
stk_31 = inla.stack(data = list(Y = cbind(y2, NA, NA)),
A = list(A.est,1,1,1,1),
effects = list(
list(s1.field=spde$n.spde, weight1.s1 = rep(1,spde$n.spde)),
list(beta.01 = rep(1,n)),
list(beta.x1 = 1:n), ## index for the errored var with b_x coeff
list(beta.x11 = cx1),
list(idx1.x1 = 1:n, weight1.x1 = rep(1,n))),
tag = "est_1"
)
stk_32 = inla.stack(data = list(Y = cbind(NA, zeros, NA)),
A = list(A.est,1,1,1),
effects = list(
list(s2.field=spde$n.spde,weight2.s2 = rep(-1,spde$n.spde)),
list(alpha.01 = rep(1,n)),
list(alpha.z11 = cz1),
list(idx2.x1 = 1:n, weight2.x1 = rep(-1,n))),
tag = "est_2"
)
stk_33 = inla.stack(data = list(Y = cbind(NA, NA, x2)),
A = list(A.est,1),
effects = list(
list(u.field= spde$n.spde, s3.field=spde$n.spde,
weight3.s3 = rep(1,spde$n.spde)),
list(idx3.x1 = 1:n, weight3.x1 = rep(1,n))),
tag = "est_3"
)
stk_pool <-inla.stack(stk_31,stk_32,stk_33)
#Model with 2 equations (measurement err. r.e are spatial)
formula3b <- Y ~ -1 +
f(s1.field, weight1.s1, copy="s3.field", fixed=FALSE,
hyper=list(theta=list(param=c(-1, 10)))) +
f(s2.field, weight2.s2, copy= "s3.field") +
f(s3.field, weight3.s3, model = spde) + ## , copy = "s2.field") +
f(u.field, model=spde) +
beta.01 + beta.x11 + alpha.01 + alpha.z11 ## alpha.01 + alpha.z11
precprior <- list(theta=list(param=c(1, 0.1)))
r_mesh <- inla(formula3b, family=c("gaussian","gaussian","gaussian"),
data=inla.stack.data(stk_pool),
control.predictor=list(compute=TRUE, A=inla.stack.A(stk_pool)),
control.family=list(list(hyper=precprior), list(hyper=precprior),list(hyper=precprior)) )
summary(r_mesh)