Description Usage Arguments Value Author(s) References See Also Examples
Computes the gradient of the Expected Improvement at the current location. The current minimum of the observations can be replaced by an arbitrary value (plugin), which is usefull in particular in noisy frameworks.
1 2 3 4 5 6 7 8 9 |
x |
a vector representing the input for which one wishes to calculate
|
model |
an object of class |
plugin |
optional scalar: if provided, it replaces the minimum of the current observations, |
type |
Kriging type: "SK" or "UK" |
minimization |
logical specifying if EI is used in minimiziation or in maximization, |
envir |
an optional environment specifying where to get intermediate
values calculated in |
proxy |
an optional Boolean, if TRUE EI is replaced by the kriging mean (to minimize) |
The gradient of the expected improvement criterion with respect to x. Returns 0 at design points (where the gradient does not exist).
David Ginsbourger
Olivier Roustant
Victor Picheny
D. Ginsbourger (2009), Multiples metamodeles pour l'approximation et l'optimisation de fonctions numeriques multivariables, Ph.D. thesis, Ecole Nationale Superieure des Mines de Saint-Etienne, 2009.
J. Mockus (1988), Bayesian Approach to Global Optimization. Kluwer academic publishers.
T.J. Santner, B.J. Williams, and W.J. Notz (2003), The design and analysis of computer experiments, Springer.
M. Schonlau (1997), Computer experiments and global optimization, Ph.D. thesis, University of Waterloo.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | set.seed(123)
# a 9-points factorial design, and the corresponding response
d <- 2; n <- 9
design.fact <- expand.grid(seq(0,1,length=3), seq(0,1,length=3))
names(design.fact)<-c("x1", "x2")
design.fact <- data.frame(design.fact)
names(design.fact)<-c("x1", "x2")
response.branin <- apply(design.fact, 1, branin)
response.branin <- data.frame(response.branin)
names(response.branin) <- "y"
# model identification
fitted.model1 <- km(~1, design=design.fact, response=response.branin,
covtype="gauss", control=list(pop.size=50,trace=FALSE), parinit=c(0.5, 0.5))
# graphics
n.grid <- 9 # Increase to 50 for a nicer picture
x.grid <- y.grid <- seq(0,1,length=n.grid)
design.grid <- expand.grid(x.grid, y.grid)
#response.grid <- apply(design.grid, 1, branin)
EI.grid <- apply(design.grid, 1, EI,fitted.model1)
#EI.grid <- apply(design.grid, 1, EI.plot,fitted.model1, gr=TRUE)
z.grid <- matrix(EI.grid, n.grid, n.grid)
contour(x.grid,y.grid,z.grid,20)
title("Expected Improvement for the Branin function known at 9 points")
points(design.fact[,1], design.fact[,2], pch=17, col="blue")
# graphics
n.gridx <- 5 # increase to 15 for nicer picture
n.gridy <- 5 # increase to 15 for nicer picture
x.grid2 <- seq(0,1,length=n.gridx)
y.grid2 <- seq(0,1,length=n.gridy)
design.grid2 <- expand.grid(x.grid2, y.grid2)
EI.envir <- new.env()
environment(EI) <- environment(EI.grad) <- EI.envir
for(i in seq(1, nrow(design.grid2)) )
{
x <- design.grid2[i,]
ei <- EI(x, model=fitted.model1, envir=EI.envir)
eigrad <- EI.grad(x , model=fitted.model1, envir=EI.envir)
if(!(is.null(ei)))
{
suppressWarnings(arrows(x$Var1,x$Var2,
x$Var1 + eigrad[1]*2.2*10e-5, x$Var2 + eigrad[2]*2.2*10e-5,
length = 0.04, code=2, col="orange", lwd=2))
}
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.