Hi,
following the inla.mesh.assessment() documentation example, I'd do
# replace with your mesh construction:
bnd <- inla.mesh.segment(cbind(
c(0, 10, 10, 0, 0),
c(0, 0, 10, 10, 0)
), bnd = TRUE)
mesh <- inla.mesh.2d(boundary = bnd, max.edge = 1)
# Replace the spatial.range value with one relevant for your problem:
out <- inla.mesh.assessment(mesh, spatial.range = 3, alpha = 2)
# Plot the
sd.dev variable of the output:
library(ggplot2)
ggplot()+geom_sf(data=sf::st_as_sf(out),aes(color=
sd.dev))
In this mesh, the edges are around 0.7 units long, compared with the
testing range of 3, and the
sd.dev (an estimate of the ratio between
the pointwise
std.dev based on the mesh, against the
std.dev. from a
high resolution mesh) varies between ca 0.95 and 1.3.
Values around 1 indicate a close approximation of the high resolution
model, whereas smaller/larger values indicate a potentially too coarse
mesh, leading to higher approximation error.
In the plot, you can see that the large deviations are at the mesh
nodes, and slightly higher along the boundary.
With the same mesh but spatial.range=6, the largest deviation ratio is
now only 1.12, so the approximation of the spde model with that
correlation range is pretty good, and clearly better than for range =
3.
Finn
> --
> 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 view this discussion on the web, visit
https://groups.google.com/d/msgid/r-inla-discussion-group/1bcce3c1-5492-49d9-9679-387bcc4bd723n%40googlegroups.com.
--
Finn Lindgren
email:
finn.l...@gmail.com