Using fmincon for a very costly objective function
Ältere Kommentare anzeigen
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
Akzeptierte Antwort
Weitere Antworten (2)
Shashank Prasanna
am 8 Sep. 2013
Bearbeitet: Shashank Prasanna
am 8 Sep. 2013
1 Stimme
Hi Danny, since you are optimizing within the objective function, this maybe a be non-smooth problem.
Which means FMINCON may not be the best solver.
Do you have constraints in your optimization? If you don't try giving FMINSEARCH a try which is derivative free and may perform much faster.
4 Kommentare
Shashank Prasanna
am 8 Sep. 2013
If you do have constraints, then give the following a try:
Danny
am 8 Sep. 2013
Shashank Prasanna
am 9 Sep. 2013
Are you able to provide your objective function? You mentioned that you are minimizing something within the objective function which makes it a changing objective function. FMINCON is not particularly suited for such problems which tend to be non smooth. #1 its recommended to try a non derivative based solver. #2 All hacks are related to your convergence criterion, you may play around with the options but if your objective is dynamic this helps little. #3 The objective function is evaluated and tested for nonlinear constraint violation. This adds up to the total execution time.
Please share your objective function and non-linear constraint function so that more eyes and look at it to give you better suggestions. Some standard suggestion should including reducing the objective function evaluation time itself - try using the MATLAB profiler
I know that the objective function is theoretically smooth.
It sounds like you have an initial function f(x,y) and your are trying to use fmincon to minimize an objective g(y) of the form
g(y)=min_x f(x,y)
So, it is g(y) that you know for a fact is theoretically smooth? And you're basing that on more than just the smoothness of f(x,y)?
Note that smoothness of f(x,y) is not enough to ensure the smoothness of g(y), in general. For example,
f(x,y)=y^3*x^2 - 2*y*x
is smooth, but the corresponding g(y),
g(y) = 0, y=0
= -1/y, otherwise
is not smooth.
Sadjad Yazdani
am 30 Jul. 2017
0 Stimmen
Dear Denny the random search algorithm released for solve such a problem that you don`t have gradient of objective function specially when you want the global Optima or the objective has many computational cost. I suggest that you try GA or PSO.
Kategorien
Mehr zu Choose a Solver finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!