Learn R Programming

rlibkriging (version 1.2-3)

WarpKriging: 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
)

Value

An S3 object of class "WarpKriging".

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). Use "none" to skip optimisation and keep the values passed in parameters (e.g. to rebuild a model with frozen hyper-parameters).

objective

"LL" (log-likelihood)

parameters

optional named list of initial hyper-parameter values and/or optimiser knobs. Recognised entries:

  • theta: numeric vector of GP range parameters (length feature_dim), used as the L-BFGS start point (or kept as-is when optim = "none").

  • warp_params: numeric vector of packed warping parameters (see warp_params()), same convention as theta.

  • noise: numeric vector of per-observation noise variances (length n); equivalent to passing noise=.

  • adam_lr, max_iter_adam, max_iter_bfgs: optimiser knobs, numeric or string.

noise

numeric vector of per-observation noise variances (length n), or NULL (default) for noise-free interpolation. When set, the GP uses the NoiseKriging likelihood \(diag(C) = \sigma^2 + noise_i\). (Homogeneous-nugget estimation is not available for WarpKriging.)

Examples

Run this code
# 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")

Run the code above in your browser using DataLab