The derivative free solvers of Powell as modernized by PRIMA
(OptimizationPRIMA.jl), for solve() on an OptimizationProblem().
Value
An algorithm object for solve().
Details
UOBYQA(): unconstrained, quadratic models by interpolation.NEWUOA(): unconstrained, quadratic models with minimum Frobenius norm updates.BOBYQA(): bound constraints.LINCOA(): bounds and linear constraints.COBYLA(): bounds, linear and nonlinear constraints, with linear models on a simplex. The constraintslcons <= cons(u) <= uconsof the problem are split, as in the Julia wrapper, into linear equalities, linear inequalities and nonlinear ones by their Hessians at a vector of ones (numerically when the problem has no constraint Hessian).
maxiters sets the largest number of function evaluations (maxfun);
further arguments of solve() such as rhobeg, rhoend, ftarget,
npt (not for UOBYQA(), whose npt is (n + 1)(n + 2)/2), scale or
iprint go to the solver. iprint is a level of PRIMA.jl's Message:
0 ("MSG_NONE"), 1 ("MSG_EXIT", the exit message), 2 ("MSG_RHO",
also each reduction of the trust region bound) or 3 ("MSG_FEVL", also
each function evaluation); the messages of UOBYQA(), NEWUOA(),
BOBYQA() and LINCOA() are those of libprima, printed to the console. Invalid maxfun, npt,
ftarget or rhoend values are revised with a warning, as in libprima.
abstol, reltol and maxtime are not supported, as in the Julia
wrapper.
The constraints of LINCOA() must be linear (the problem's cons is
split into linear equalities and inequalities as for COBYLA()); a
nonlinear constraint raises an error. The Julia wrapper passes no
constraints to LINCOA and so ignores them; here they are honored. BOBYQA() moves u0 to the bounds
or at least rhobeg inside them, with a warning, as libprima does when
rhobeg is given.
Examples
prob <- OptimizationProblem(function(u, p) (u[1] - 1) * (u[1] - 1) + (u[2] + 2) * (u[2] + 2),
c(0, 0), numeric(), cons = function(u, p) u[1] + u[2],
lcons = -2, ucons = 0)
solve(prob, COBYLA())$u
#> [1] 1 -2
rosen <- function(u, p) (1 - u[1]) * (1 - u[1]) + 100 * (u[2] - u[1] * u[1]) * (u[2] - u[1] * u[1])
solve(OptimizationProblem(rosen, c(-1.2, 1), numeric()), UOBYQA())$u
#> [1] 1 1
solve(OptimizationProblem(rosen, c(-1.2, 1), numeric()), NEWUOA(), npt = 4)$u
#> [1] 0.9999982 0.9999964
solve(OptimizationProblem(rosen, c(-0.5, 1.5), numeric(), lb = c(-2, -2), ub = c(0.8, 4)),
BOBYQA())$u
#> [1] 0.80 0.64
solve(OptimizationProblem(rosen, c(0, 0), numeric(), cons = function(u, p) u[1] + u[2],
lcons = -Inf, ucons = 1), LINCOA())$u
#> [1] 0.6187956 0.3812044