sgvSetup {BayesNSGP}R Documentation

One-time setup wrapper function for the SGV approximation

Description

sgvSetup is a wrapper function that sets up the SGV approximation. Three objects are required: (1) ordering the locations, (2) identify nearest neighbors, and (3) determine the conditioning set. This function only needs to be run once per SGV analysis.

Usage

sgvSetup(
  coords,
  coords_pred = NULL,
  k = 15,
  seed = NULL,
  pred.seed = NULL,
  order_coords = TRUE
)

Arguments

coords

Matrix of observed locations.

coords_pred

Optional matrix of prediction locations.

k

Number of neighbors.

seed

Setting the seed for reproducibility of the observed location ordering

pred.seed

Setting the seed for reproducibility of the prediction ordering.

order_coords

Logical; should the coordinates be ordered.

Value

A list with the following components:

ord

A vector of ordering position for the observed locations.

ord_pred

A vector of ordering position for the prediction locations (if coords_pred is provided).

ord_all

A concatenated vector of ord and ord_pred.

coords_ord

A matrix of ordered locations (observed and prediction), included for convenience.

nID_ord

A matrix of (ordered) neighbor indices.

condition_on_y_ord

A matrix indicating whether the conditioning set for each (ordered) location is on the latent process (y, 1) or the observed values (z, 0).


[Package BayesNSGP version 0.1.2 Index]