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.

 채택된 답변

Arnaud Miege
Arnaud Miege 2011년 4월 27일

0 개 추천

Have a look at Tolerances and Stopping Criteria in the documentation.
HTH,
Arnaud

댓글 수: 2

Thank you Arnaud,
It's clear now why it is like that. My further question is that, is there some other way to stop iteration based on the value of f(x)?
Best Regards,
Apri
Not that I know of, sorry.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Nonlinear Least Squares (Curve Fitting)에 대해 자세히 알아보기

질문:

2011년 4월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by