Are my optimset conditions functioning correctly?

5 visualizaciones (últimos 30 días)
Gary Newbolt
Gary Newbolt el 9 de Nov. de 2015
Respondida: Alan Weiss el 9 de Nov. de 2015
I'm currently using the fminsearch routine to parameterise a function I have developed. I have set the following code for my optimisation routine:
options = optimset('Display','iter','MaxIter',400,'MaxFunEvals',400,'TolFun',0.001,'TolX',0.001);
z_optimal = fminsearch(@(z) PBM_optimalRK4(m,SieveFrac,SelFunc,BrkFunc,z,f_0,t_max,ExpRes(:,b),ySrl,dt),z,options);
My understanding is that when my objective function change is less than 0.001 from one iteration to the next the optimisation routine should end. However as you can see from the attached picture this isn't happening and is instead ending when the maximum number of function evaluations (400) has been reached. This has the undesired effect of increasing execution time for program. Would anyone happen to know why this is? And what can be done about it if so?
Thanks, Gary

Respuestas (1)

Alan Weiss
Alan Weiss el 9 de Nov. de 2015
Unlike other optimization algorithms, fminsearch stops when it satisfies BOTH the TolX and TolFun tolerances, not when it satisfies just one tolerance. You can see this by examining the fminsearch function at around line 300.
edit fminsearch
I will have to make that clear in the documentation. Sorry for not doing so earlier.
Alan Weiss
MATLAB mathematical toolbox documentation

Categorías

Más información sobre Optimization en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by