What does the exitflag "Change in X too small" imply for the optimum?

4 views (last 30 days)
Dear all,
I am using fmincon to optimize a highly non-linear objective function (with constraints that are not twice differentiable). I use the interior-point algorithm. When I check my exitflags almost all of them are "2", meaning that "the change in X is too small". What does this imply for my optimum and what can I do to reach the optimum?
Given that my X are portfolio weights, it seems unreasonable/unrealistic to me to further reduce 'options.TolX', which is already very low at the default value (1e-6)...
Many thanks in advance for helping me out!

Accepted Answer

JFCI
JFCI on 28 Jun 2012
Dear Alan,
Thank you for your reply. I posted my question a bit too fast since both my constraints and my objective function are smooth functions... And I am able to obtain an exit flag of 1 for some of the constraint values (say: for some of the values I give to beq).
However, my objective function is non-convex so I realize I may have to be happy with a local optimum, which I assume is what an exitflag of 2 indicates.
What are your thoughts?
  2 Comments
Alan Weiss
Alan Weiss on 28 Jun 2012
An exit flag of 2 does not have anything to do with convexity or global solution. All Optimization Toolbox solvers give local solutions only.
An exit flag of 2 means that the first-order optimality conditions are not satisfied to within the TolFun tolerance, but the solver cannot proceed. Often, it means that the reported solution is a local optimum, but not always.
If you are interested in a global optimum and have a Global Optimization Toolbox license, take a look at GlobalSearch or MultiStart.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

Sign in to comment.

More Answers (1)

Alan Weiss
Alan Weiss on 28 Jun 2012
With nonsmooth constraint functions you will not be able to get an exit flag of 1. So in what way are you dissatisfied with your current result?
If you want to check that your result is good, take a look at the suggestions in Local Minimum Possible or even When the Solver Succeeds.
Alan Weiss
MATLAB mathematical toolbox documentation

Community Treasure Hunt

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

Start Hunting!