| spatial_gp | R Documentation |
Specify a Gaussian-process spatial random effect, approximated with a nearest-neighbour GP (NNGP) for scalability. Captures smooth spatial variation from point-referenced coordinates.
spatial_gp(
coords,
approx = c("nngp", "hsgp"),
cov = c("exponential", "matern"),
nu = 1.5,
nn = 15,
m = 6,
c = 1.5,
sigma_prior_U = 1,
sigma_prior_alpha = 0.01,
shared = NULL,
scale_coords = TRUE,
parameterization = c("noncentered", "centered", "collapsed")
)
## S3 method for class 'tulpa_gp'
print(x, ...)
## S3 method for class 'tulpa_hsgp'
print(x, ...)
coords |
A formula ( |
approx |
GP approximation: |
cov |
Covariance function (NNGP only). One of |
nu |
Matern smoothness parameter, one of |
nn |
Number of nearest neighbours used in the NNGP approximation. |
m |
Number of HSGP basis functions per dimension ( |
c |
HSGP boundary factor, |
sigma_prior_U, sigma_prior_alpha |
Penalized-complexity prior on the
field's marginal standard deviation ( |
shared |
Whether the spatial effect is shared across processes in a
multi-process model. |
scale_coords |
Logical. Standardize coordinates before fitting
(default |
parameterization |
Latent parameterization for the exact-NUTS field.
One of |
x |
A |
... |
Ignored. |
A tulpa_gp object (also of class tulpa_spatial).
spatial_car(), spatial_bym2() for areal spatial effects.
# GP spatial specification from coordinate columns
spatial_gp(~ lon + lat)
spatial_gp(~ lon + lat, cov = "matern", nu = 1.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.