Using fmincon for a very costly objective function
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (2)
Shashank Prasanna
el 8 de Sept. de 2013
Editada: Shashank Prasanna
el 8 de Sept. de 2013
1 voto
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 comentarios
Shashank Prasanna
el 8 de Sept. de 2013
If you do have constraints, then give the following a try:
Danny
el 8 de Sept. de 2013
Shashank Prasanna
el 9 de Sept. de 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
el 30 de Jul. de 2017
0 votos
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.
Categorías
Más información sobre Choose a Solver en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!