predict | R Documentation |
Predicted probability of class 1. Optionally, conditional covariance based on a gpcm
model and 95% quantiles of the probability of class 1 are returned.
## S3 method for class 'gpcm'
predict(object, newdata, nsimu = NULL,
light.return = FALSE, checkNames=FALSE, seed = NULL, ...)
object |
an object of class |
newdata |
a vector, matrix of points to be predicted. |
nsimu |
an optional integer indicating whether to resample latent GP at observation points and how many samples are required. If |
light.return |
an optional boolean. If |
checkNames |
an optional boolean. If |
seed |
to fix the seed (used if |
... |
no other argument for this method |
prob |
the (averaged) probability of class 1 at |
lower95 , upper95 |
95% confidence bounds for the probability at |
probs |
a matrix of sample predicted probabilities. |
Zsimu_var , Zsimu_mean |
conditional variance vector and mean matrix of the latent GP at |
cov |
conditional covariance matrix at |
c |
an auxiliary matrix, containing all the covariances between |
lambda |
an auxiliary vector, product of the inverse covariance matrix |
kz |
an auxiliary matrix, corresponding to the unconditional covariance matrix at |
Morgane MENZ, Céline HELBERT, Victor PICHENY, François BACHOC. Contributors: Naoual SERRAJI.
Bachoc, F., Helbert, C. & Picheny, V. Gaussian process optimization with failures: classification and convergence proof. J Glob Optim 78, 483–506 (2020). \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s10898-020-00920-0")}.
Roustant, O., Ginsbourger, D. & Deville, Y. Contributors: Chevalier, C. , Richet, Y. DiceKriging: Kriging Methods for Computer Experiments. R package version 1.6.0. https://CRAN.R-project.org/package=DiceKriging.
# ----------------------------------
# A 2D example - Branin-Hoo function
# ----------------------------------
# 30-points DoE, and the corresponding response
d <- 2
nb_PX <- 30
require(DiceDesign)
X <- lhsDesign(nb_PX, d, seed = 123)$design
Xopt <- maximinSA_LHS(X, T0 = 10, c = 0.99, it = 1000)
x <- Xopt$design
require(DiceKriging)
fx <- apply(x, 1, branin)
s <- ifelse(fx < 14, -1, 1)
f <- s
Xf <- as.matrix(x)
# Bulding GPC model
GPCmodel <- gpcm(f = f, Xf = Xf, coef.m = -0.1, coef.cov=c(0.8,0.5))
# Graphics - Predict probabilities
ngrid <- 50
x.grid <- seq(0, 1., length.out = ngrid)
grid <- as.matrix(expand.grid(x.grid, x.grid))
probabilities <- predict(object = GPCmodel, newdata = grid)$prob
filled.contour(x.grid, x.grid, matrix(probabilities, ngrid, ngrid),
color.palette = function(n) hcl.colors(n, "RdYlBu", rev = FALSE),
main = "probabilities map",
plot.axes = {
axis(1)
axis(2)
points(Xf[f == 1, 1], Xf[f == 1, 2], col = "blue", pch = 21, bg = "blue")
points(Xf[f == -1, 1], Xf[f == -1, 2], col = "red", pch = 21, bg = "red")
}
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.