crit_AL {DiceOptim}R Documentation

Expected Augmented Lagrangian Improvement

Description

Computes the Expected Augmented Lagrangian Improvement at current location, with our without slack variables. Depending on the cases, the computation is either analytical (very fast), based on MC integration (slow) or on the CDF of a weighted sum of non-central chi-square (WNCS) variates (intermediate)

Usage

crit_AL(
  x,
  model.fun,
  model.constraint,
  equality = FALSE,
  critcontrol = NULL,
  type = "UK"
)

Arguments

x

either a vector representing the design or the design AND slack variables (see details)

model.fun

object of class km correspostnding to the objective function, or, if the objective function is fast-to-evaluate, a fastfun object,

model.constraint

either one or a list of objects of class km, one for each constraint function,

equality

either FALSE if all constraints are for inequalities, or a vector of Booleans indicating which are equalities

critcontrol

optional list with the following arguments:

  • slack: logical. If TRUE, slack variables are used for inequality constraints (see Details)

  • rho: penalty term (scalar),

  • lambda: Lagrange multipliers (vector of size the number of constraints),

  • elit: logical. If TRUE, sets the criterion to zero for all x's not improving the objective function

  • n.mc: number of Monte-Carlo drawings used to evaluate the criterion (see Details)

  • nt: number of discretization points for the WNCS distribution (see Details)

  • tolConstraints, an optional vector giving a tolerance (> 0) for each of the constraints (equality or inequality). It is highly recommended to use it when there are equality constraints since the default tolerance of 0.05 in such case might not be suited.

Options for the checkPredict function: threshold (1e-4) and distance (covdist) are used to avoid numerical issues occuring when adding points too close to the existing ones.

type

"SK" or "UK" (by default), depending whether uncertainty related to trend estimation has to be taken into account.

Details

The AL can be used with or without the help of slack variables for the inequality constraints. If critcontrol$slack=FALSE: With a single constraint (inequality or equality) and a fast objective, a very fast formula is used to compute the criterion (recommended setting). Otherwise, an MC estimator of the criterion is used, which is much more costly. The argument critcontrol$n.mc tunes the precision of the estimator. On both cases x must be of size d.

If critcontrol$slack=TRUE: Slack variables are used to handle the inequality constraints. They can be provided directly through x, which should be of size d+ the number of inequality constraints. The last values of x are slack variables scaled to [0,1].

If x is of size d, estimates of optimal slack variable are used.

Value

The Expected Augmented Lagrangian Improvement at x.

Author(s)

Victor Picheny

Mickael Binois

References

R.B. Gramacy, G.A. Gray, S. Le Digabel, H.K.H Lee, P. Ranjan, G. Wells, Garth, and S.M. Wild (2014+), Modeling an augmented Lagrangian for improved blackbox constrained optimization, arXiv preprint arXiv:1403.4890.

See Also

EI from package DiceOptim, crit_EFI, crit_SUR_cst.

Examples

#---------------------------------------------------------------------------
# Expected Augmented Lagrangian Improvement surface with one inequality constraint,
# fast objective
#---------------------------------------------------------------------------

set.seed(25468)
library(DiceDesign)

n_var <- 2 
fun.obj <- goldsteinprice
fun.cst <- function(x){return(-branin(x) + 25)}
n.grid <- 31
test.grid <- expand.grid(X1 = seq(0, 1, length.out = n.grid), X2 = seq(0, 1, length.out = n.grid))
obj.grid <- apply(test.grid, 1, fun.obj)
cst.grid <- apply(test.grid, 1, fun.cst)
n.init <- 15 
design.grid <- round(maximinESE_LHS(lhsDesign(n.init, n_var, seed = 42)$design)$design, 1)
obj.init <- apply(design.grid, 1, fun.obj)
cst.init <- apply(design.grid, 1, fun.cst)
model.constraint <- km(~., design = design.grid, response = cst.init)
model.fun <- fastfun(fun.obj, design.grid)
AL_grid <- apply(test.grid, 1, crit_AL, model.fun = model.fun,
                  model.constraint = model.constraint)

filled.contour(seq(0, 1, length.out = n.grid), seq(0, 1, length.out = n.grid), nlevels = 50,
               matrix(AL_grid, n.grid), main = "Expected AL Improvement",
               xlab = expression(x[1]), ylab = expression(x[2]), color = terrain.colors, 
               plot.axes = {axis(1); axis(2);
                            points(design.grid[,1], design.grid[,2], pch = 21, bg = "white")
                            contour(seq(0, 1, length.out = n.grid), seq(0, 1, length.out = n.grid), 
                            matrix(obj.grid, n.grid), nlevels = 10,
                                   add=TRUE,drawlabels=TRUE, col = "black")
                            contour(seq(0, 1, length.out = n.grid), seq(0, 1, length.out = n.grid), 
                            matrix(cst.grid, n.grid), level = 0, add=TRUE,
                                   drawlabels=FALSE,lwd=1.5, col = "red")
                            }
              )

#---------------------------------------------------------------------------
# Expected AL Improvement surface with one inequality and one equality constraint,
# using slack variables
#---------------------------------------------------------------------------

set.seed(25468)
library(DiceDesign)

n_var <- 2 
fun.obj <- goldsteinprice
fun.cstineq <- function(x){return(3/2 - x[1] - 2*x[2] - .5*sin(2*pi*(x[1]^2 - 2*x[2])))}
fun.csteq <- function(x){return(branin(x) - 25)}
n.grid <- 51
test.grid <- expand.grid(X1 = seq(0, 1, length.out = n.grid), X2 = seq(0, 1, length.out = n.grid))
obj.grid <- apply(test.grid, 1, fun.obj)
cstineq.grid <- apply(test.grid, 1, fun.cstineq)
csteq.grid <- apply(test.grid, 1, fun.csteq)
n.init <- 25 
design.grid <- round(maximinESE_LHS(lhsDesign(n.init, n_var, seed = 42)$design)$design, 1)
obj.init <- apply(design.grid, 1, fun.obj)
cstineq.init <- apply(design.grid, 1, fun.cstineq)
csteq.init <- apply(design.grid, 1, fun.csteq)
model.fun <- km(~., design = design.grid, response = obj.init)
model.constraintineq <- km(~., design = design.grid, response = cstineq.init)
model.constrainteq <- km(~., design = design.grid, response = csteq.init)

models.cst <- list(model.constraintineq, model.constrainteq)
 
AL_grid <- apply(test.grid, 1, crit_AL, model.fun = model.fun, model.constraint = models.cst,
                  equality = c(FALSE, TRUE), critcontrol = list(tolConstraints = c(0.05, 3),
                  slack=TRUE))

filled.contour(seq(0, 1, length.out = n.grid), seq(0, 1, length.out = n.grid), nlevels = 50,
               matrix(AL_grid, n.grid), main = "Expected AL Improvement",
               xlab = expression(x[1]), ylab = expression(x[2]), color = terrain.colors, 
               plot.axes = {axis(1); axis(2);
                            points(design.grid[,1], design.grid[,2], pch = 21, bg = "white")
                            contour(seq(0, 1, length.out = n.grid), seq(0, 1, length.out = n.grid), 
                            matrix(obj.grid, n.grid), nlevels = 10,
                                   add=TRUE,drawlabels=TRUE, col = "black")
                            contour(seq(0, 1, length.out = n.grid), seq(0, 1, length.out = n.grid), 
                            matrix(cstineq.grid, n.grid), level = 0, add=TRUE,
                                   drawlabels=FALSE,lwd=1.5, col = "red")
                            contour(seq(0, 1, length.out = n.grid), seq(0, 1, length.out = n.grid),
                            matrix(csteq.grid, n.grid), level = 0, add=TRUE,
                                   drawlabels=FALSE,lwd=1.5, col = "orange")
                            }
              )


[Package DiceOptim version 2.1.1 Index]