NoiseKriging {rlibkriging} | R Documentation |
Create an object with S3 class "NoiseKriging"
using
the libKriging library.
Description
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
.
Usage
NoiseKriging(
y = NULL,
noise = NULL,
X = NULL,
kernel = NULL,
regmodel = c("constant", "linear", "interactive"),
normalize = FALSE,
optim = c("BFGS", "none"),
objective = c("LL"),
parameters = NULL
)
Arguments
y |
Numeric vector of response values. |
noise |
Numeric vector of response variances. |
X |
Numeric matrix of input design. |
kernel |
Character defining the covariance model:
|
regmodel |
Universal NoiseKriging linear trend. |
normalize |
Logical. If |
optim |
Character giving the Optimization method used to fit
hyper-parameters. Possible values are: |
objective |
Character giving the objective function to
optimize. Possible values are: |
parameters |
Initial values for the hyper-parameters. When
provided this must be named list with elements |
Value
An object with S3 class "NoiseKriging"
. Should be used
with its predict
, simulate
, update
methods.
Author(s)
Yann Richet yann.richet@irsn.fr
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) + X/10 * rnorm(nrow(X)) # add noise dep. on X
## fit and print
k <- NoiseKriging(y, noise=(X/10)^2, X, kernel = "matern3_2")
print(k)
x <- as.matrix(seq(from = 0, to = 1, length.out = 101))
p <- predict(k,x = x, stdev = TRUE, 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 <- simulate(k, nsim = 10, seed = 123, x = x)
matlines(x, s, col = rgb(0, 0, 1, 0.2), type = "l", lty = 1)