0

I'm trying to optimize a set of equations with the L-BFGS-B optimizer in SciPy where I know the lower bound is zero (not inclusive) but do not know the upper bound.

I'm wondering if there is a way to tell SciPy to set an upper bound for the lowest input that creates an error. In other words, can SciPy automatically "feel its way" through what the upper bound should be in constrained optimization? If not, are there any standard ways to do this? The naive way I am considering would be to start calling values within a try/except loop to find an acceptably accurate upper bound by brute force.

From a relatively dramatic discussion on SciPy's issues page I know that SciPy's current implementation of L-BFGS-B is written in Fortran (see the original paper here), so I'm not incredibly hopeful for an automated way of doing this. If no ways have been thought of before me and brute forcing the upper bound proves unfeasible, I suppose I may have to begin trying to find approximations for it :)

Will
  • 170
  • 10
  • Can you be more formal? It's hard to unerstand what you want to achieve? It sounds like you have a multi-objective optimization problem, where objective 1 is the cost/deviation of the equation-target (equations should be fulfilled with negligible deviations -> floating-point!) and objective 2 is a cost about the variable-bounds (model-complexity; i prefer small values -> induce cost related to size). If yes, this has nothing to do with scipy, the optimizer in scipy or whatever... It's just about developing a sane use-case related notion of *goodness* in this multi-objective *environment* – sascha Apr 12 '20 at 11:47
  • Yes, sorry about that! I don't quite understand the second part of your statement but I will try to clarify: I have an error function f([x1, x2, x3 ... xn]) I wish to minimize, where I know lower bound of each xi is 0, but I do not know their (unique) upper bounds. I was hoping that the BFGS (or any other bounded minimization technique) has ways to automatically find upper bounds or ignore xi inputs that cause errors, as any input above the upper bound will result in a domain error. Currently I have no method to calculate the upper bound beforehand. – Will Apr 12 '20 at 23:23
  • That's not in the scope of any of those solvers. You will need to do this yourself (binary-search, exponential-search; not trying all those values). Of course i'm assuming, that an found upper-bound implies that the full interval `(ub,inf)` is marked forbidden now (and can only lowered in subsequent its). If that's too simple, e.g. *you have holes in the domain* `[[0.0, 30.), [40.0, inf)]`, you can't use any of those scipy-supported solvers as you won't be able to produce a twice-differentiable optimization problem with those discontinuous bounds. Then branch-and-bound is needed (e.g.MINLP). – sascha Apr 13 '20 at 07:57
  • @sascha thankfully any values above the upper bound are not valid! This was the information I was looking for, and answers my original question. If you quote your comment as an answer, I will mark it appropriately. – Will Apr 13 '20 at 08:45

0 Answers0