to_vec: Converts non-Vecchia object to its Vecchia version

View source: R/vecchia.R

to_vecR Documentation

Converts non-Vecchia object to its Vecchia version

Description

Converts an object of class "gp", "dgp2", or "dgp3" to its Vecchia equivalent ("gpvec", "dgp2vec", or "dgp3vec").

Usage

to_vec(object, m = NULL, ord = NULL, cores = NULL)

Arguments

object

object from fit_one_layer, fit_two_layer, or fit_three_layer with vecchia = FALSE

m

size of Vecchia conditioning sets, defaults to the lower of 25 or maximum available

ord

optional ordering for Vecchia approximation, defaults to random

cores

number of cores to use for OpenMP parallelization. Defaults to min(4, maxcores - 1) where maxcores is the number of detectable available cores.

Details

Creates and appends Vecchia-approximation objects to the provided fit. Defaults to random ordering and nearest neighbors conditioning. Useful for speeding up predictions when the testing size is large but the training size is small.

Value

The same object, with x_approx, w_approx, and z_approx appended (depending on the number of layers).

Examples

# See ?fit_one_layer for an example


deepgp documentation built on July 30, 2026, 5:12 p.m.