Is fit() not supposed to be used? It seems intentionally terrible.
4 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
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
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
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 Exchange 中查找有关 Get Started with Curve Fitting Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!