max_EI_genoud: Maximization of the Expected Improvement Criterion using...

View source: R/max_EI.R

max_EI_genoudR Documentation

Maximization of the Expected Improvement Criterion using genoud

Description

Given an object in km-class and a set of tuning parameters (lower, upper, parinit, and genoud_args), max_EI performs the maximization of the Expected Improvement criterion and delivers the next point to be visited in an EGO-like procedure.

Usage

max_EI_genoud(
  model,
  plugin = NULL,
  type = c("UK", "SK"),
  lower,
  upper,
  parinit = NULL,
  minimization = TRUE,
  genoud_args = NULL
)

Arguments

model

An object of class "km" as created by using km.

plugin

Optional scalar: if provided, it replaces the minimum of the current observations.

type

Character "UK" (default) or "SK" giving the kriging type.

lower, upper

Numeric vectors of length d giving the lower and upper bounds for the variables to be optimized over.

parinit

Optional numeric vector of initial values for the variables to be optimized over.

minimization

Logical specifying if EI is used in minimization or in maximization. Of course, this concerns the objective function to be optimized, not the EI which is always maximized.

genoud_args

Optional named list of arguments for the genoud optimization. Some arguments can not be used (such as fn or gr) and an error will occur if they are given. Also note that for some arguments the default values of genoud have been changed:

  • pop.size default ifelse(d < 6, 3 * 2^d, 32 * d) where d is the number of inputs,

  • max.generations default: 12,

  • wait.generations default: 2,

  • BFGSburnin default: 2.

The values given in genoud_args are passed to the corresponding arguments of the function genoud.

Details

The latter maximization relies on a genetic algorithm using derivatives, genoud. This function plays a central role in the package since it is in constant use in the proposed algorithms. It is important to remark that the information needed about the objective function reduces here to the vector of response values embedded in model (no call to the objective function or simulator).

The current minimum of the observations can be replaced by an arbitrary value given in plugin, which is useful in particular in noisy frameworks.

Value

A list with components:

  • par A numeric matrix with 1 row and d columns the best set of parameters found.

  • value A numeric vector with length one, giving the value of expected improvement at par.

The matrix par will often have to be coerced into a data frame (see Examples or into a numeric vector.

Author(s)

David Ginsbourger, Olivier Roustant and Victor Picheny.

References

D. Ginsbourger (2009), Multiples métamodèles pour l'approximation et l'optimisation de fonctions numériques multivariables, Ph.D. thesis, Ècole Nationale Supérieure des Mines de Saint-Étienne, 2009.

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.

W.R. Mebane, Jr. and J.S. Sekhon (2011). "Genetic Optimization Using Derivatives: The rgenoud Package for R". Journal of Statistical Software, 42(11), 1-26. URL http://www.jstatsoft.org/v42/i11/.

Examples

library(rgenoud)
set.seed(123)

## =========================================================================
##  "ONE-SHOT" EI-MAXIMIZATION OF THE BRANIN FUNCTION 
## 	KNOWN AT A 9-POINTS FACTORIAL DESIGN         
## =========================================================================

## a 9-points factorial design, and the corresponding response
## ===========================================================
d <- 2; n <- 9
design.fact <- expand.grid(x1 = seq(0, 1, length = 3),
                           x2 = seq(0, 1, length = 3)) 
y.branin <- apply(design.fact, 1, branin)

## model identification
## ====================
fit.branin <- km(~1, design = design.fact, response = y.branin, 
                 covtype="gauss", control = list(pop.size = 50, trace = FALSE),
                 parinit = c(0.5, 0.5))

## EGO one step
## ============
lower <- rep(0.0, d); upper <- rep(1.0, d)    
oEGO <- max_EI_genoud(fit.branin, lower = lower, upper = upper, 
               genoud_args = list(pop.size = 20, BFGSburnin = 2))
print(oEGO)

## graphics
## =========
g <- contours(fit.branin, which = "", other = "branin") +
         ggtitle("Branin Function. EI maximized at the point shown with a lozenge.") +
              geom_point(data = data.frame(oEGO$par),
                         mapping = aes(x = x1, y = x2), shape = 23,
                         col = "purple", fill = "lavender", size = 4)
g

## =========================================================================
## "ONE-SHOT" EI-MAXIMIZATION OF THE CAMELBACK FUNCTION
##	KNOWN AT A 16-POINTS FACTORIAL DESIGN            
## =========================================================================
## Not run: 
## a 16-points factorial design, and the corresponding response
d <- 2; n <- 16
design.fact <- expand.grid(x1 = seq(0, 1, length = 4),
                           x2 = seq(0, 1, length = 4)) 
yCB <- apply(design.fact, 1, camelback)

## model fit
## =========
fitCB <- km(~1, design = design.fact, response = yCB,
            covtype = "gauss",
            control = list(pop.size = 50, trace = FALSE),
            parinit = c(0.5, 0.5))

## EI maximization
## ================
lower <- rep(0.0, d); upper <- rep(1.0, d)   
oCB <- max_EI_genoud(fitCB, lower = lower, upper = upper, 
                     genoud_args = list(pop.size = 20, BFGSburnin = 2))
print(oCB)

## graphics
## ========
g <- contours(fitCB, which = "", other = "camelback") +
         ggtitle("Camel back Function. EI maximized at the lozenge.") +
              geom_point(data = data.frame(oCB$par),
                         mapping = aes(x = x1, y = x2), shape = 23,
                         col = "purple", fill = "lavender", size = 4)
g

## End(Not run)

## =========================================================================
##  "ONE-SHOT" EI-MAXIMIZATION OF THE GOLDSTEIN-PRICE FUNCTION 
## 	     KNOWN AT A 9-POINTS FACTORIAL DESIGN              
## =========================================================================

## Not run: 
## a 9-points factorial design, and the corresponding response
d <- 2; n <- 9
design.fact <- expand.grid(x1 = seq(0, 1, length = 3),
                           x2 = seq(0, 1, length = 3))

y.gP <- apply(design.fact, 1, goldsteinPrice)

## model identification
fit.gP <- km(~1, design = design.fact, response = y.gP, 
              covtype="gauss",
              control = list(pop.size = 50, max.generations = 50, 
                             wait.generations = 5, BFGSburnin = 10,
                             trace = FALSE),
              parinit = c(0.5, 0.5), optim.method = "gen")

## EI maximization
## ===============
lower <- rep(0.0, d); upper <- rep(1.0, d);    
oEGO.gP <- max_EI_genoud(model = fit.gP, lower = lower, upper = upper,
                         genoud_args = list(pop.size = 50,
                                            max.generations = 50,
                                            wait.generations = 5,
                                            BFGSburnin = 10))
print(oEGO.gP)

## graphics
## ========
g <- contours(fit.gP, which = "", other = "goldsteinPrice") +
         ggtitle("GoldsteinPrice Function. EI maximized at the lozenge") +
              geom_point(data = data.frame(oEGO.gP$par),
                         mapping = aes(x = x1, y = x2), shape = 23,
                         col = "purple", fill = "lavender", size = 4)
g


## End(Not run)


libKriging/dolka documentation built on April 14, 2022, 7:17 a.m.