Specify a spatially varying coefficient (SVC): one or more fixed-effect coefficients are allowed to vary smoothly over space, with the variation governed by a Gaussian process (NNGP or HSGP approximation).
Arguments
- coords
A formula (
~ lon + lat) or character vector of length 2 naming the two coordinate variables in the data.- terms
Which coefficients vary over space. A formula, an integer vector of design-matrix column indices, or a character vector of term names. Default
1(the intercept).- cov
Covariance function. One of
"exponential"or"matern".- nn
Number of nearest neighbours used in the NNGP approximation (
approx = "nngp").Whether the effect is shared across processes in a multi-process model.
NULL(default) shares it;FALSEfits process-specific effects and emits a warning.- scale_coords
Logical. Standardize coordinates before fitting (default
TRUE).- approx
Spatial approximation.
"nngp"(nearest-neighbour GP) or"hsgp"(Hilbert-space GP).- m
Number of basis functions per dimension for the HSGP approximation (
approx = "hsgp").- c_boundary
Boundary-extension factor for the HSGP domain (
approx = "hsgp").- parameterization
Latent parameterization for the exact-NUTS field (
approx = "nngp"only; HSGP is already non-centered by construction)."noncentered"(default) samplesz_j ~ N(0, I)per term and reconstructs each field asw_j = f(z_j, sigma2_j, phi_j), removing the field/hyperparameter funnel that otherwise attenuates the field's amplitude when it is weakly identified."centered"places the NNGP density on each term's field directly; it is marginally cheaper on a well-identified response, but on a weakly identified one it recovers only about a third of the field's spread.
See also
spatial_gp() for a spatial random effect (rather than a varying
coefficient).