validate_gp: Validate a GP spatial specification against data

View source: R/spatial_gp.R

validate_gpR Documentation

Validate a GP spatial specification against data

Description

Fills in the neighbor structure (spatial_gp()) or structures (spatial_multiscale()) that tulpa_gibbs() and tulpa_laplace() need from a ⁠spatial =⁠ spec, since those design-matrix doors take no data argument to validate one themselves. tulpa() calls this internally, so it only needs to be called directly when fitting through a design-matrix door.

Usage

validate_gp(gp, data)

Arguments

gp

A spatial_gp() or spatial_multiscale() object.

data

Data frame containing the coordinate columns named in gp.

Value

Updated spatial object with computed neighbor structure.

See Also

validate_temporal_multiscale(), spatial_gp(), spatial_multiscale()

Examples

set.seed(1)
d <- data.frame(lon = runif(30), lat = runif(30))
gp <- validate_gp(spatial_gp(~ lon + lat, nn = 5), d)
gp$n_spatial

tulpa documentation built on Oct. 19, 2026, 5:09 p.m.