MATLAB: Using fmincon for a very costly objective function

fminconoptimizationOptimization Toolbox

I would like to find the minimum of an objective function which has 43 variables and takes around 20 seconds to evaluate (another minimization problem needs to be solved for this objective function, explaining why it takes so long). It is not immensely important to me that I get the best, most accurate answer – only that I can find some sort of minimum reasonably quickly. So, I am looking for help in doing this.
So far, I have attempted to increase the DiffMinChange value, but fmincon seems to be ignoring this. I am also using the "active-set algorithm", because I read somewhere this was the most efficient of the four options. I do have a nonlinear constraint function, and upper and lower bounds.
Any help with this would be greatly appreciated – thanks! Danny

Best Answer

Danny, while I do not understand everything you are doing, here are my thoughts based on what you said in this forum.
1. The sqp algorithm is usually superior to the active-set algorithm, in that it is more robust and it respects bounds.
2. The interior-point algorithm is probably the most robust algorithm, and usually you should try it first, resorting to the others only if it proves unsatisfactory.
3. It is often crucial that you take a good starting point for the minimization. Especially, if you have an inner loop containing other minimizations, you might want to take the answer from one minimization as the starting value for the next.
4. Unlike Shashank, I would never attempt to use fminsearch or any of its relatives on a problem with more than 4 or 5 dimensions. It is almost always better to try to tune fmincon than to use a much poorer algorithm. You could try patternsearch, but it would likely be slower than fmincon (when properly tuned).
5. The best thing you might be able to do for fmincon would be to figure out somehow analytic gradients for the objective and nonlinear constraints, or some good approximation to them, and use them instead of letting fmincon take finite difference steps.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation