Is fit() not supposed to be used? It seems intentionally terrible.

3 ビュー (過去 30 日間)
Michael Van de Graaff
Michael Van de Graaff 2022 年 6 月 9 日
コメント済み: Walter Roberson 2022 年 6 月 10 日
I have been trying to use fit() to fit my data, but it seems like the documentation and functionality of it are terrible.
for example, I cannot find the exitflag meanings for fit() because I donbt know what solver it's using.
I have to give column vectors, if i give row vectors it just doesn't work. (this is by far the least of my concerns)
if i just rescale everything, the fit breaks by saying my initial point is a solution, it's clearly not!
Are the options like Tolfun and Tolx relative or absolute WHO KNOWS! I assume so, because that seems like the obvious default choice, but idk
perhaps most importantly, are DiffMaxChange and DiffMinChange relative?! WHO KNOWS! (apparently not!)
if these things were documented then they wouldn't be so problematic, but they aren't, not where i could find them (well the error messsage helped me fix the column input thing, so thats just a casual gripe, but the other stuff is way more important)
The upshot is the fit() seems so poorly explained that it boggles my mind that people would use it.

回答 (1 件)

Walter Roberson
Walter Roberson 2022 年 6 月 9 日
Data to fit, specified as a matrix with either one (curve fitting) or two (surface fitting) columns
  4 件のコメント
Walter Roberson
Walter Roberson 2022 年 6 月 9 日
DiffMinChange and DiffMaxchange are absolute. https://www.mathworks.com/matlabcentral/answers/86643-what-do-diffminchange-and-diffmaxchange-actually-do#answer_96169
Walter Roberson
Walter Roberson 2022 年 6 月 10 日
for example, I cannot find the exitflag meanings for fit() because I donbt know what solver it's using.
nonlinear custom and "library" call cflsqcurvefit() and then cfrobnlinfit() if robust was requested.
linear custom and linear library call cflsqlin() for bounded version or \ (mldivide) for no bounds, and always assign exit flag of 1. However, if robust linear fit was requested, then exit flag 1 means convergence, exit flag 0 means no convergence, and exit flag -1 means interruption.
cubicspline and smoothing spline call spline routines and always assign exit flag of 1
'interpolant' call internal routines that always return exit flag 1
lowess uses curvefit.LowessFit and always assigns exit flag of 1
The functions cflsqcurvefit(), cfrobnlinfit(), cflsqlin() are all undocumented internal functions

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by