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.
Arguments
- coords
A formula
~ x + yor a two-column matrix of coordinates.- data
Optional data.frame for formula evaluation.
- mesh
A pre-built
tulpa_meshobject. If NULL (default), a mesh is built automatically fromcoords.- 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
c(inner, outer).- cutoff
Minimum distance between mesh vertices. Default 0.
- nu
Matern smoothness parameter. A positive number. Integer
nu(1, 2, 3, ...) gives an exact FEM construction (operator orderalpha = nu + 1). Fractionalnu(e.g. 0.5, 1.5) uses the operator-based rational SPDE approximation with BRASIL best-rational coefficients (Bolin & Kirchner 2020; Hofreither 2021); supported by the Laplace fitterfit_spde()(single-point and nested over range/sigma). NUTS and analytic marginal SEs remain integer-only. Default 1.- prior_range
Prior for the spatial range. A numeric vector
c(U, alpha)where P(range < U) = alpha. Defaultc(0.5, 0.5).- prior_sigma
Prior for the marginal standard deviation. A numeric vector
c(U, alpha)where P(sigma > U) = alpha. Defaultc(1, 0.5).