
Last chance! 50% off unlimited learning
Sale ends in
Kriging
object.Given "new" input points, the method compute the expectation, variance and (optionnally) the covariance of the corresponding stochastic process, conditional on the values at the input points used when fitting the model.
# S3 method for Kriging
predict(
object,
x,
return_stdev = TRUE,
return_cov = FALSE,
return_deriv = FALSE,
...
)
A list containing the element mean
and possibly
stdev
and cov
.
S3 Kriging object.
Input points where the prediction must be computed.
Logical
. If TRUE
the standard deviation
is returned.
Logical
. If TRUE
the covariance matrix of
the predictions is returned.
Logical
. If TRUE
the derivatives of mean and sd
of the predictions are returned.
Ignored.
Yann Richet yann.richet@irsn.fr
f <- function(x) 1 - 1 / 2 * (sin(12 * x) / (1 + x) + 2 * cos(7 * x) * x^5 + 0.7)
plot(f)
set.seed(123)
X <- as.matrix(runif(10))
y <- f(X)
points(X, y, col = "blue", pch = 16)
k <- Kriging(y, X, "matern3_2")
x <-seq(from = 0, to = 1, length.out = 101)
p <- predict(k, x)
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))
Run the code above in your browser using DataLab