max_EI_cmaes | R Documentation |
Given an object in
km-class
and a set of tuning
parameters (lower
, upper
, parinit
, and
cmaes_args
), max_EI_cmaes
performs the
maximization of the Expected Improvement criterion and
delivers the next point to be visited in an EGO-like
procedure.
max_EI_cmaes( model, plugin = NULL, type = c("UK", "SK"), lower, upper, parinit = NULL, minimization = TRUE, cmaes_args = NULL )
model |
An object inheriting from the class |
plugin |
Optional scalar: if provided, it replaces the minimum of the current observations. |
type |
Character |
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. |
cmaes_args |
Optional named list of arguments for the
|
The latter maximization relies on the
cma_es
function for global
optimization. As opposed to max_EI_genoud
, the
optimization does not use the gradient of the objective.
The current minimum of the observations can be replaced by an
arbitrary value given in plugin
, which is useful in
particular in noisy frameworks.
A list with several elements among which:
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.
library(cmaes) 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 fitting ## ============= mykm <- 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) EGOkm <- max_EI_cmaes(mykm, lower = lower, upper = upper, cmaes_args = list(control = list(maxit = 1e6))) EGOkm$par EGOkm$value ## The same with a KM object ## ========================= if (require(rlibkriging)) { myKM <- KM(~1, design = design.fact, response = y.branin, covtype="gauss", parinit = c(0.5, 0.5)) lower <- rep(0.0, d); upper <- rep(1.0, d) EGOKM <- max_EI_cmaes(myKM, lower = lower, upper = upper, cmaes_args = list(control = list(maxit = 1e6))) EGOKM$par EGOKM$value }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.