Display all function evaluations in fminsearch iterative display

I am using the banana function optimization example (https://www.mathworks.com/examples/optimization/mw/optim-ex93593175-banana-function-minimization) to understand how to use output functions for iterative optimization display. If I am understanding the output function operation for fminsearch correctly, the function is plotting the optimal value of x attained at each iteration. Is it possible to plot function evaluations undertaken by the simplex algorithm that were rejected (did not end up being a new optimal value), and, perhaps, plot them at a different point on the graph? I would eventually like to do this comparatively with other algorithms like patternsearch.
Thanks,
Nathanael Kazmierczak

 Réponse acceptée

Alan Weiss
Alan Weiss le 30 Mai 2017
There is another example that shows patternsearch points: Pattern Search Climbs Mount Washington.
But I believe that there is no way to get at all the points that fminsearch evaluates. See the Fields in optimValues, which describes the information available to output using an Output Function.
Alan Weiss
MATLAB mathematical toolbox documentation

2 commentaires

Great; thanks for clarifying this!
-Nathanael
You COULD write them all out from the objective function itself. Or you could save them all as they are passed in. Or store them in a variable. Assuming this is a one time thing for your own edification, even a global variable would suffice, as much as I despise globals. A bit of a kludge, but any of the above would work.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by