fmincon finds solutions close to the middle of the range

2 views (last 30 days)
I use fmincon with "interior point" method and the majority of the solutions are very close to the middle of the range of one variable. I changed the range (lower and upper bounds) and the solutions has changed to the middle of the new range (still inside the original range). I find that the initial point of the optimization is less important than the range. My questions are: 1. Is it normal or it is mistake in my code? 2. What other function or optimization method should I use? I want the solution will be close to the initial point (the solution of the former day) but not affected from the range (just inside it..)
  2 Comments
Matt J
Matt J on 29 Sep 2014
We have to see your code, but there's no clear indication that anything's wrong. Changing the bounds can definitely change the location of the minimum, in general.
Neill Mackay
Neill Mackay on 22 Jan 2018
Edited: Neill Mackay on 22 Jan 2018
I have noticed the same thing, and I agree with the original poster that the solution should only be constrained to be within the bounds, not otherwise affected by them.

Sign in to comment.

Answers (2)

John D'Errico
John D'Errico on 22 Jan 2018
Edited: John D'Errico on 22 Jan 2018
When you change the bounds, a DIFFERENT solution can easily be arrived at. Having the bounds there will impact the path that is taken.
For example, suppose fmincon heads in the direction of a minimum. It wants to go in that direction. But then it hits a bound, so it is forced to change direction? The presence of bounds and their location WILL impact the result that is found, as long as there are multiple solutions.
Different algorithms will work with the bounds differently of course. For example, in my own fminsearchbnd, I actually transform the domain based on the bounds provided. That can easily impact the solution found.
Remember though, that ANY solution found is no better than any other in the eyes of an optimization tool. Fmincon (and all optimizers) can have no more a goal than finding SOME solution that is a local minimizer. Even in the case of global optimizer, it cannot assure you with 100% certainty they will find the global min. At best, it can only increase the odds of success, often at some cost in final accuracy.
  2 Comments
Neill Mackay
Neill Mackay on 22 Jan 2018
Thanks, that does make sense that the bounds will affect the path taken. What is strange is that even when the bounds are quite wide compared with the difference between the initial condition and the solution, they are still having a stronger effect on the solution than the initial condition is having (as observed in the original post).
John D'Errico
John D'Errico on 22 Jan 2018
Again, the optimization method in some cases implicitly transforms the domain, based on the bounds.

Sign in to comment.


Alan Weiss
Alan Weiss on 22 Jan 2018
I wonder whether your objective function is insensitive to those variables. Perhaps examine your objective function evaluated at several points whose values differ only in those coordinates that seem to depend on the range.
Another thing to try: the 'sqp' algorithm of fmincon, which works differently than the default 'interior-point' method.
Alan Weiss
MATLAB mathematical toolbox documentation

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!