MultistartOptimization
Introduction
Multistart methods perform optimization from multiple starting points. This package implements multistart methods, relying on other packages for local methods. Wrappers are loaded on demand, or you can define them simply with a closure.
Example
using MultistartOptimization, NLopt
f(x) = sum(x -> abs2(x - 1), x) # objecive ∑(xᵢ-1)²
P = MinimizationProblem(f, fill(-2, 4), fill(2, 4)) # search in [-2, 2]⁴
local_method = NLopt_local_method(NLopt.LN_BOBYQA) # loaded on demand with `using NLopt`
multistart_method = TikTak(100)
p = multistart_minimization(multistart_method, local_method, P)
(value = 0.0, location = [1.0, 1.0, 1.0, 1.0], ret = :XTOL_REACHED)
Generic API
MultistartOptimization.MinimizationProblem
— TypeMinimizationProblem(objective, lower_bounds, upper_bounds)
Define a minimization problem.
objective
is a function that mapsℝᴺ
vectors to real numbers. It should accept allAbstractVector
s of lengthN
.lower_bounds
andupper_bounds
define the bounds, and their lengths implicitly define the dimensionN
.
The fields of the result should be accessible with the names above.
MultistartOptimization.local_minimization
— Functionlocal_minimization(minimization_problem, local_method, x)
Perform a local minimization using local_method
, starting from x
.
The objective and the bounds are provided in minimization_problem
, see MinimizationProblem
. x
should be an AbstractVector
of conforming dimension.
local_method
can be a type for which a method is defined (recommended). However, it can also be a closure, in which case it will be called as local_method(minimization_problem, x)
.
In both cases, it should return nothing
, or a value which has the following properties:
location
, anAbstractVector
for the minimizer.value
, for the value of the objective atlocation
.Inf
(or equivalent) should be used for infeasible regions.
The returned value may have other properties too, these are useful for convergence diagnostics, debugging information, etc, these depend on the local_method
.
Returning nothing
is equivalent to value == Inf
, but in some cases can work better for type inference as the method won't have to construct a counterfactual type.
MultistartOptimization.multistart_minimization
— Functionmultistart_minimization(multistart_method, local_method, minimization_problem)
Multistart minimization using the given multistart and local methods.
Multistart methods
MultistartOptimization.TikTak
— TypeTikTak(quasirandom_N; keep_ratio, θ_min, θ_max, θ_pow)
The “TikTak” multistart method, as described in Arnoud, Guvenen, and Kleineberg (2019).
This implements the multistart part, can be called with arbitrary local methods, see multistart_minimization
.
Arguments
quasirandom_N
: the number of quasirandom points for the first pass (using a Sobol sequence).
Keyword arguments
keep_ratio
: the fraction of best quasirandom points which are keptθ_min
andθ_max
clamp the weight parameter,θ_pow
determines the power it is raised to.
The defaults are from the paper cited above.
Local methods
Local methods are based on other optimization packages, and loaded on demand.
NLopt
After NLopt
is loaded, the following is made available.
MultistartOptimization.NLopt_local_method
— FunctionA placeholder for integrating into the NLopt
interface.
Methods are added when NLopt
is loaded (via weak dependencies).