How to extract the results of spatial random field?

30 views
Skip to first unread message

YK

unread,
Mar 31, 2021, 7:34:03 PM3/31/21
to R-inla discussion group
Hello All,

When I analyze the spatial model with spatial random field (MVN(0, R), where R is Matern covariate function), how do we extract the results of mean and variance for spatial random field?

I found the function "inla.spde.result()" to extract the SPDE results, but I cannot get the results.
Maybe because I used inla.spde2.pcmatern() in my analysis.

For your reference, my code is

loc #location data
stk # stack data
bound2 = inla.nonconvex.hull(loc, convex = 0.05, concave = -0.15)
mesh2 = inla.mesh.2d(boundary = bound2, max.edge = c(0.04, 0.04), cutoff = 0.08/5)
A = inla.spde.make.A(mesh2, loc = loc)
spde = inla.spde2.pcmatern(mesh = mesh2, alpha = 2, prior.range = c(0.01, 0.05), prior.sigma = c(1, 0.01))

# copy model (run successfully)
formula = y ~ 0 + intercept + f(i.c, model = spde) + f(i.e, copy = "i.c", fixed = FALSE)  
res = inla(formula, 
           data = inla.stack.data(stk), 
           family = c("binomial", "binomial"), 
           control.predictor = list(compute = TRUE, A = inla.stack.A(stk), link = 1), 
           control.results = list(return.marginals.random = FALSE, return.marginals.predictor = FALSE), 
           control.compute = list(waic = TRUE, dic = TRUE))

Sincerely,

Yuki Kanamori
Reply all
Reply to author
Forward
0 new messages