Optimization terminated: first-order optimality less than OPTIONS.TolFun, and no negative/zero curvature detected in trust region model.
4 views (last 30 days)
Show older comments
When TolFun is 1e-6, I got the above message in 0th iteration. So no further iteration is not going on. How i will solve that problem.
0 Comments
Answers (1)
Matt J
on 15 Apr 2014
Edited: Matt J
on 15 Apr 2014
It might be good news. The optimization might have succeeded. Call whatever function it is you're using with more output arguments, so you can check the value of the gradient and other diagnostic information, like the EXITFLAG, output.firstorderopt, and output.stepsize
4 Comments
Matt J
on 17 Apr 2014
Edited: Matt J
on 19 Apr 2014
LSQCURVEFIT is trying to minimize your objective function
f=@(x,xdata)C0+C1*xdata.^1+C2*xdata.^2+C3*xdata.^3+C4*xdata.^4
as a function of 'x'. However, the function you've provided has no actual dependence on x, only on xdata. So, since all points have zero gradient, lsqcurvefit stops with any initial point x0 that you choose.
If your goal is to fit xdata,ydata to a one-dimensional 4th order polynomial, you should just use POLYFIT,
constants=polyfit(xdata,ydata,4);
See Also
Categories
Find more on Least Squares in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!