View source: R/spatial_rsr_spde.R
| spatial_spde | R Documentation |
Specify a continuous Matern spatial field using the SPDE approach (Lindgren, Rue & Lindstrom 2011). Builds a triangular mesh from observation coordinates, computes FEM matrices, and passes them to tulpa's SPDE Laplace engine with CHOLMOD sparse solver.
spatial_spde(
coords,
data = NULL,
mesh = NULL,
boundary = NULL,
max_edge = NULL,
cutoff = 0,
nu = 1,
prior_range = NULL,
prior_sigma = NULL
)
coords |
A formula |
data |
Optional data.frame for formula evaluation. |
mesh |
A pre-built |
boundary |
Optional boundary: a two-column matrix of polygon vertices, an sf polygon, or NULL for convex hull with extension. |
max_edge |
Maximum edge length for mesh refinement. A single value
or |
cutoff |
Minimum distance between mesh vertices. Default 0. |
nu |
Matern smoothness parameter. A positive number. Integer |
prior_range |
PC prior on the spatial range, |
prior_sigma |
PC prior on the marginal standard deviation, |
A tulpa_spatial object with type "spde".
set.seed(42)
coords <- cbind(runif(50), runif(50))
spec <- spatial_spde(coords)
print(spec)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.