WarpKriging: Create a WarpKriging model

View source: R/WarpKrigingClass.R

WarpKrigingR Documentation

Create a WarpKriging model

Description

Kriging with per-variable input warping. Each input dimension is independently transformed before the GP kernel is evaluated. Supports continuous, categorical, ordinal variables and joint deep kernel learning.

Usage

WarpKriging(
  y,
  X,
  warping,
  kernel = "gauss",
  regmodel = "constant",
  normalize = FALSE,
  optim = "BFGS+Adam",
  objective = "LL",
  parameters = NULL,
  noise = NULL
)

Arguments

y

numeric vector of observations (n)

X

numeric matrix of inputs (n x d)

warping

character vector of warp specifications, one per column of X. Use warp_*() helpers or plain strings: "none", "affine", "boxcox", "kumaraswamy", "neural_mono(8)", "mlp(16:8,2,selu)", "knots(3)", "knots(0.25:0.5:0.75)", "categorical(5,2)", "ordinal(4)".

kernel

covariance kernel: "gauss", "matern3_2", "matern5_2", "exp"

regmodel

trend: "constant", "linear", "quadratic"

normalize

logical; normalise continuous inputs?

optim

optimiser (currently only one bi-level strategy)

objective

"LL" (log-likelihood)

parameters

optional named list of tuning parameters, e.g. list(max_iter_adam = "300", adam_lr = "0.001", max_iter_bfgs = "50")

noise

Either a numeric vector of per-observation noise variances, or "nugget" to estimate a homogeneous nugget, or NULL (default) for noise-free interpolation.

Value

An S3 object of class "WarpKriging".

Examples

# Continuous with Kumaraswamy warping
X <- as.matrix(c(0.0, 0.25, 0.5, 0.75, 1.0))
f <- function(x) 1 - 1/2 * (sin(12*x)/(1+x) + 2*cos(7*x)*x^5 + 0.7)
y <- f(X)
k <- WarpKriging(y, X, warping = "kumaraswamy", kernel = "gauss")
print(k)

# Mixed: 1 continuous + 1 categorical (3 levels)
n <- 15
X_mix <- cbind(runif(n), rep(0:2, length.out = n))
y_mix <- sin(2 * pi * X_mix[, 1]) * c(1, 2, 0.5)[X_mix[, 2] + 1]
k2 <- WarpKriging(y_mix, X_mix,
         warping = c("mlp(16:8,2,selu)", "categorical(3,2)"),
         kernel = "matern5_2")


rlibkriging documentation built on May 14, 2026, 1:06 a.m.