ID ydata std1 y1 s12 y2 s23 y3 s3... ... ...
st.est <- inla.stack(data = list(y=ydata), A = list(Ay),effects = list(spde = 1:n.spde), tag = "est")st.pred <- inla.stack(data = list(y=NA), A = list(Ay),effects = list(spde=1:n.spde), tag = "pred")st <- inla.stack(st.est, st.pred)## Fix the sigma_e^2 to be 1 and scale them according to the data in inla(...,scale = scale)## Default uses log(1/sigma_e^2) to be loggamma distribution with intial value = 0.hyper <- list(prec = list(fixed = TRUE, initial = 0))formula = y ~ -1 + f(spde, model = my_spde)prec_scale <- rep(1/std, 2)res_inla <- inla(formula, data = inla.stack.data(st, spde = spde), family = "gaussian",scale = prec,_scale, control.family = list(hyper = hyper),control.predictor=list(A=inla.stack.A(st), compute =TRUE))
Hi Zha,
If you want the predictions at the data locations, there is no
need for a new stack as such predictions will be already computed
if asked, just set compute=TRUE in control.predictor().
The 'scale' is the scale for the precision, which is the inverse of the squared standard deviation.
Best,
Elias
--
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 post to this group, send email to r-inla-disc...@googlegroups.com.
Visit this group at https://groups.google.com/group/r-inla-discussion-group.
For more options, visit https://groups.google.com/d/optout.