NestedKriging: Create an object with S3 class '"NestedKriging"' using the...

View source: R/NestedKrigingClass.R

NestedKrigingR Documentation

Create an object with S3 class "NestedKriging" using the libKriging library.

Description

Divide-and-conquer Kriging for large designs: the data are partitioned in nb_groups groups, one Kriging submodel is fitted per group (then all share a common prior), and predictions are aggregated.

Usage

NestedKriging(
  y = NULL,
  X = NULL,
  kernel = NULL,
  nb_groups = NULL,
  aggregation = "NK",
  partition = "kmeans",
  seed = 123,
  regmodel = "constant",
  optim = "BFGS",
  objective = "LL",
  parameters = NULL,
  warping = NULL
)

Arguments

y

Numeric vector of response values.

X

Numeric matrix of input design.

kernel

Character defining the covariance model: "exp", "gauss", "matern3_2", "matern5_2".

nb_groups

Number of submodels (each of size ~ nrow(X)/nb_groups).

aggregation

Character: "NK" (optimal nested-kriging aggregation of Rulliere et al. 2018, default), "PoE", "gPoE", "BCM" or "rBCM".

partition

Character: "kmeans" (default) or "random".

seed

Integer seed for the partition.

regmodel

Linear trend; "NK" aggregation requires "constant".

optim

Character, hyper-parameter optimization method of the submodels: "BFGS" or "none".

objective

Character: "LL" (default), "LOO", "LMP", or "VLL(m)" — the common prior is then estimated by one global Vecchia fit (O(n m^3), cross-group information).

parameters

Initial or fixed values for the hyper-parameters (named list with "sigma2", "theta", "beta").

warping

Optional character vector of per-dimension warp specs (see WarpKriging); submodels are then WarpKriging.

Value

An object with S3 class "NestedKriging", to be used with its predict method.

Author(s)

Yann Richet yann.richet@asnr.fr

Examples

f <- function(X) apply(X, 1, function(x) sin(3 * x[1]) + cos(5 * x[2]))
set.seed(123)
X <- matrix(runif(2 * 400), ncol = 2)
y <- f(X)
k <- NestedKriging(y, X, kernel = "matern5_2", nb_groups = 8)
x <- matrix(runif(2 * 100), ncol = 2)
p <- predict(k, x)

rlibkriging documentation built on July 12, 2026, 5:06 p.m.