Description Usage Arguments Value See Also Examples
View source: R/buildKrigingForrester.R
Predict with Kriging model produced by buildKriging
.
1 2 |
object |
Kriging model (settings and parameters) of class |
newdata |
design matrix to be predicted |
... |
not used |
list with predicted mean y
, uncertainty / standard deviation s
(optional) and expected improvement ei
(optional).
Whether s
and ei
are returned is specified by the vector of strings object$target
, which then contains "s"
and "ei"
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Test-function:
braninFunction <- function (x) {
(x[2] - 5.1/(4 * pi^2) * (x[1] ^2) + 5/pi * x[1] - 6)^2 +
10 * (1 - 1/(8 * pi)) * cos(x[1] ) + 10
}
## Create design points
x <- cbind(runif(20)*15-5,runif(20)*15)
## Compute observations at design points (for Branin function)
y <- as.matrix(apply(x,1,braninFunction))
## Create model
fit <- buildKriging(x,y)
fit$target <- c("y","s","ei")
## first estimate error with regressive predictor
predict(fit,x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.