MATLAB Answers

Misleading "relative change" wording for stopping criterion in particleswarm global optimization

2 views (last 30 days)
Marc Lalancette
Marc Lalancette on 18 Oct 2019
In the documentation and output, a stopping criterion for the particle swarm method is: "relative change in the objective value over the last OPTIONS.MaxStallIterations iterations is less than OPTIONS.FunctionTolerance." However, this clearly was not a relative change in my case. Looking at the code, it is actually sometimes relative, sometimes absolute:
funChange = abs(maxBestFvalsWindow-bestFval)/max(1,abs(bestFval));
Why the max(1, ...) ?? This makes it the absolute change if the function value is under 1 (which it always is in my case).
Is this a bug or intentional? If it's the latter, the documentation and output should be clarified when it's actually stopping because of the absolute change.
Do other (all?) optimisation methods behave this way?

Answers (0)

Community Treasure Hunt

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

Start Hunting!