How can I use TolFun to stop iteration when resnorm less than it?
이전 댓글 표시
Hi,
I am using lsqcurvefit to do parameter estimation. I do not need to have a very small resnorm at the end. So if the resnorm is already less than my tolerance, it is more than enough for me.
So, e.g., I set TolFun to 1e-2:
optionsLSQ = optimset('Display','Iter','TolFun',1e-2);
[ki,resnorm] = lsqcurvefit(@funObj,ki,tdata,xdata,lb,[],optionsLSQ);
And this is what I get:
Norm of First-order
Iteration Func-count f(x) step optimality CG-iterations
0 3 0.113218 0.311
1 6 0.00709841 0.237501 0.0365 0
2 9 0.00463864 0.0462264 0.00193 0
Optimization terminated: first-order optimality less than OPTIONS.TolFun,
and no negative/zero curvature detected in trust region model.
As you can see, at iteration 1, f(x)<0.01, and yet the iteration does not stop. What should I do to make it stop right after f(x)<TolFun?
Thank you in advance.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Nonlinear Least Squares (Curve Fitting)에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!