View source: R/WarpKrigingClass.R
| predict.WarpKriging | R Documentation |
Predict with a WarpKriging model
## S3 method for class 'WarpKriging'
predict(
object,
x,
return_stdev = TRUE,
return_cov = FALSE,
return_deriv = FALSE,
...
)
object |
WarpKriging object |
x |
prediction matrix (m x d) |
return_stdev |
return standard deviations? |
return_cov |
return full covariance? |
return_deriv |
return derivatives of mean and stdev wrt x? |
... |
ignored |
list with mean, optionally stdev, cov,
mean_deriv, stdev_deriv
f <- function(x) 1 - 1 / 2 * (sin(12 * x) / (1 + x) + 2 * cos(7 * x) * x^5 + 0.7)
X <- as.matrix(seq(0.05, 0.95, length.out = 10))
y <- f(X)
wk <- WarpKriging(y, X, warping = "kumaraswamy", kernel = "gauss", optim = "BFGS")
x <- as.matrix(seq(0, 1, length.out = 101))
p <- wk$predict(x, return_stdev = TRUE)
plot(f)
points(X, y, col = "blue", pch = 16)
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.