Skip to contents

spatial() marks structured spatial dependence. The first fitted path is the univariate Gaussian location random intercept spatial(1 | site, coords = coords), where coords is a matrix or data frame with one row per site or one row per observation. The univariate Gaussian location path also supports one numeric slope, spatial(1 + x | site, coords = coords), as independent intercept and slope fields with separate SDs and no intercept-slope correlation. Mesh inputs, scale formulas, multiple structured slopes, slope correlations, and bivariate spatial blocks remain planned.

Usage

spatial(term, coords = NULL, mesh = NULL)

Arguments

term

Structured random-effect term, such as 1 | site.

coords

Coordinate object, such as a data frame or matrix of spatial coordinates.

mesh

Planned precomputed mesh object.

Value

A formula marker; never evaluated by users.

Examples

# Fitted for univariate Gaussian mu with coords:
bf(y ~ x + spatial(1 | site, coords = coords), sigma ~ z)
#> <drm_formula>
#> y ~ x + spatial(1 | site, coords = coords)
#> sigma ~ z
# Planned:
bf(y ~ x + spatial(1 | site, mesh = mesh), sigma ~ z)
#> <drm_formula>
#> y ~ x + spatial(1 | site, mesh = mesh)
#> sigma ~ z