Kriging
Description
Create a Kriging Object representing a Trend \(+\) GP Model.
Use noise = NULL for noise-free interpolation, noise = "nugget"
to estimate a homogeneous nugget, or a numeric vector of
per-observation noise variances.
Usage
Just build the model:
Python
k = Kriging(kernel="matern3_2") # later: k.fit(y, X, ..., noise=None)
R
k <- Kriging(kernel = "matern3_2") # later: k$fit(y, X, ..., noise = NULL)
Matlab/Octave
k = Kriging(kernel = "matern3_2"); % later: k.fit(y, X, ..., noise = [])
Julia
k = Kriging("matern3_2") # later: fit(k, y, X; noise=nothing)
or build and fit at the same time:
Python
k = Kriging(y, X, kernel="matern3_2", regmodel="constant", normalize=False, optim="BFGS", objective="LL", parameters=None, noise=None)
R
k <- Kriging(y, X, kernel = "matern3_2", regmodel = "constant", normalize = FALSE, optim = "BFGS", objective = "LL", parameters = NULL, noise = NULL)
Matlab/Octave
k = Kriging(y, X, kernel = "matern3_2", regmodel = "constant", ... normalize = false, optim = "BFGS", objective = "LL", ... parameters = [], noise = [])
Julia
k = Kriging(y, X, "matern3_2"; regmodel="constant", normalize=false, optim="BFGS", objective="LL", parameters=nothing, noise=nothing)
Arguments
Argument |
Description |
|---|---|
|
Numeric vector of response values. |
|
Numeric matrix of input design. |
|
Character defining the covariance model: |
|
Universal Kriging linear trend: |
|
Logical. If |
|
Character giving the Optimization method used to fit hyper-parameters. Possible values are: |
|
Character giving the objective function to optimize. Possible values are: |
|
Initial values for the hyper-parameters. When provided this must be named list with elements |
|
Either a numeric vector of per-observation noise variances, |
See also
Noise Strategies — overview of the three noise modes, with links to the dedicated examples.
Details
The hyper-parameters (variance and vector of correlation ranges)
are estimated thanks to the optimization of a criterion given by
objective , using the method given in optim .
Value
An object "Kriging" . Should be used
with its predict , simulate , update
methods.
Examples
f <- function(x) 1 - 1 / 2 * (sin(12 * x) / (1 + x) + 2 * cos(7 * x) * x^5 + 0.7)
set.seed(123)
X <- as.matrix(runif(10))
y <- f(X)
## fit and print
k <- Kriging(y, X, kernel = "matern3_2")
k
x <- as.matrix(seq(from = 0, to = 1, length.out = 101))
p <- k$predict(x = x, return_stdev = TRUE, return_cov = FALSE)
plot(f)
points(X, y)
lines(x, p$mean, col = "blue")
polygon(c(x, rev(x)), c(p$mean - 2 * p$stdev, rev(p$mean + 2 * p$stdev)),
border = NA, col = rgb(0, 0, 1, 0.2))
s <- k$simulate(nsim = 10, seed = 123, x = x)
matlines(x, s, col = rgb(0, 0, 1, 0.2), type = "l", lty = 1)
Results
* data: 10x[0.0455565,0.940467] -> 10x[0.194057,1.00912]
* trend constant (est.): 0.433954
* variance (est.): 0.0873685
* covariance:
* kernel: matern3_2
* range (est.): 0.240585
* fit:
* objective: LL
* optim: BFGS
