Problem with the posted example using lsqcurvefit?

17 ビュー (過去 30 日間)
Ana Cadavid
Ana Cadavid 2015 年 5 月 29 日
コメント済み: Star Strider 2015 年 5 月 29 日
I have tried exactly the example given in http://www.mathworks.com/help/optim/ug/lsqcurvefit.html
I get the following error
Trial>> [x,resnorm] = lsqcurvefit(@myfun,x0,xdata,ydata);
Local minimum possible.
lsqcurvefit stopped because the final change in the sum of squares relative to its initial value is less than the default value of the function tolerance.
Optimization stopped because the relative sum of squares (r) is changing by less than options.TolFun = 1.000000e-06.
Optimization Metric Options relative change r = 9.32e-08 TolFun = 1e-06 (default)
If I try to change the TolFun in the options I start a chain requesting more iterations and more evaluations that do not stop..
Any idea what is failing? In the web it states that it converges in 27 iterations.
Thank you

回答 (1 件)

Star Strider
Star Strider 2015 年 5 月 29 日
That’s a Warning, not an Error. I suspect it throws that Warning if the residual norm is higher than some predetermined threshold when the function converges. In other circumstances, it would mean that experimenting with different initial parameter estimates would be appropriate.
  2 件のコメント
Ana Cadavid
Ana Cadavid 2015 年 5 月 29 日
Thank you
Star Strider
Star Strider 2015 年 5 月 29 日
My pleasure.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDownloads についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by