Skip to contents

QuadDirect() minimizes with QuadDIRECT.jl, ported to R: a deterministic global method that splits the search box into a tree of boxes, each holding one function value. Every sweep splits, along each coordinate, the boxes on the lower edge of the width versus value plane (the minimum edge of DIRECT, with values extrapolated by one dimensional quadratic fits); then, in the boxes that look convex, a quadratic model of the function is fitted by regression on the points of the tree and a quasi Newton step with a bounded least squares solve and a backtracking line search is tried. No derivatives are used.

Usage

QuadDirect()

Value

An algorithm object.

Details

The problem needs bounds (lb and ub; infinite bounds are allowed) and solve needs splits, a list with one increasing triple per unknown: the initial values along that coordinate, inside the bounds. The first evaluation point is made of the middle values. The solve arguments map as in OptimizationQuadDIRECT: maxiters to the maximal number of evaluations (default 2500; the count may run a little over), abstol to atol (0) and reltol to rtol (0.001), the changes of the minimum below which a sweep counts as converged; the run stops after more such sweeps in a row than there are unknowns. maxtime is not used. The return code is Default and the solution's original is the root of the box tree (an environment with the fields splitdim, xvalues, fvalues and children).

Examples

rosenbrock <- function(x, p) (p[1] - x[1])^2 + p[2] * (x[2] - x[1]^2)^2
prob <- OptimizationProblem(rosenbrock, c(0, 0), c(1, 100), lb = c(-1, -1), ub = c(0.8, 0.8))
sol <- solve(prob, QuadDirect(), splits = list(c(-0.5, 0, 0.5), c(-0.5, 0, 0.5)),
             maxiters = 200)
round(sol$u, 3); sol$objective
#> [1] 0.671 0.450
#> [1] 0.1084343