Description Usage Arguments Value Author(s) References See Also Examples
Samples n
points from a distribution proportional to the expected
improvement (EI) computed from a km
object.
1 2 3 4 5 6 7 8 9 |
model |
an object of class |
minimization |
logical specifying if EI is used in minimiziation or in maximization, |
n |
number of points to be sampled, |
initdistrib |
matrix of candidate points. |
lower |
vector of lower bounds, |
upper |
vector of upper bounds, |
T |
optional scalar : if provided, it replaces the current minimum (or maximum) of observations. |
A n*d
matrix containing the sampled points. If NULL
, 1000*d
points
are obtained by latin hypercube sampling,
Sebastien Marmin
Clement Chevalier
David Ginsbourger
D.R. Jones, M. Schonlau, and W.J. Welch (1998), Efficient global optimization of expensive black-box functions, Journal of Global Optimization, 13, 455-492.
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 | set.seed(004)
# a 9-points factorial design, and the corresponding responses
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)
lower <- c(0,0)
upper <- c(1,1)
names(response.branin) <- "y"
# model identification
fitted.model <- km(~1, design=design.fact, response=response.branin,
covtype="gauss", control=list(pop.size=50,trace=FALSE), parinit=c(0.5, 0.5))
# sample a 30 point batch
batchSize <- 30
x <- sampleFromEI(model = fitted.model, n = batchSize, lower = lower, upper = upper)
# graphics
# displays the EI criterion, the design points in black and the EI-sampled points in red.
nGrid <- 15
gridAxe1 <- seq(lower[1],upper[1],length=nGrid)
gridAxe2 <- seq(lower[2],upper[2],length=nGrid)
grid <- expand.grid(gridAxe1,gridAxe2)
aa <- apply(grid,1,EI,model=fitted.model)
myMat <- matrix(aa,nrow=nGrid)
image(x = gridAxe1, y = gridAxe2, z = myMat,
col = colorRampPalette(c("darkgray","white"))(5*10),
ylab = names(design.fact)[1], xlab=names(design.fact)[2],
main = "Sampling from the expected improvement criterion",
axes = TRUE, zlim = c(min(myMat), max(myMat)))
contour(x = gridAxe1, y = gridAxe2, z = myMat,
add = TRUE, nlevels = 10)
points(x[,1],x[,2],pch=19,col='red')
points(fitted.model@X[,1],fitted.model@X[,2],pch=19)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.