Are my optimset conditions functioning correctly?

6 次查看(过去 30 天)
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

回答(1 个)

Alan Weiss
Alan Weiss 2015-11-9
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

类别

Help CenterFile Exchange 中查找有关 Optimization 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by