libprima / prima

PRIMA is a package for solving general nonlinear optimization problems without using derivatives. It provides the reference implementation for Powell's derivative-free optimization methods, i.e., COBYLA, UOBYQA, NEWUOA, BOBYQA, and LINCOA. PRIMA means Reference Implementation for Powell's methods with Modernization and Amelioration, P for Powell.
http://libprima.net
BSD 3-Clause "New" or "Revised" License
290 stars 35 forks source link

Improve the scaling #182

Open zaikunzhang opened 3 months ago

zaikunzhang commented 3 months ago

This has been requested a few times. See

https://github.com/libprima/PRIMA.jl/issues/4 https://github.com/libprima/prima/issues/95 https://github.com/libprima/prima/issues/181

Currently, the MATLAB and Julia interfaces do scale the problem if requested and if possible:

https://github.com/libprima/prima/blob/67b60842bf647f21f42380b763a0266992ca059f/matlab/interfaces/private/preprima.m#L297 https://github.com/libprima/PRIMA.jl/blob/2714339cfecf6b895e7b1ef5f278f1c105c4be1a/src/PRIMA.jl#L120

Maybe we can add two optional arguments scaling_factor and shift, to perform the scaling

x_before_scaling = scaling_factor*x_after_scaling + shift

or, equivalently,

x_after_scaling = (x_before_scaling - shift) / scaling_factor

In the high-level interfaces, there should be an option scale taking three possible values

where "auto" means that the scaling factor will be decided automatically according to the given problem. Not that it is nontrivial to decide a suitable scaling factor.

Similarly, there should be an option shift taking three possible values

where "auto" means that the shift will be decided automatically according to the given problem (e.g., shift = x0).