What causes robust fit iterations to exceed the limit
23 views (last 30 days)
Show older comments
I'm using the fit function with 'Normalize','on','Robust','Bisquare' options to fit a third order polynomial to some data. A minimum working example follows:
x = [2.444436182410000 2.444437817380130 2.444444762805120 2.444445170589760 2.444445987210460 2.444446803724840 2.444447211978680 2.444450069075760 2.444450884840320 2.444452108761440]'*1e6;
y = [0.177830605552787 0.177864704872501 0.178025689381442 0.178032846297480 0.178051120268956 0.178069239089872 0.178078538492653 0.178169641991248 0.178174003218787 0.178212193642797]'*1e-3;
fit(x,y,'poly3','Normalize','on','Robust','Bisquare')
This throws a warning: Warning: Iteration limit reached for robust fitting.
I've found this post from 2006 and this one from 2013, but there isn't anything useful there. First of all it isn't great that the iterlim in the fit function isn't a free parameter, but that's beside the point. Blindly increasing the number of iteration isn't the smartest thing to do anyway.
What could be causing this problem? How to precondition the data to avoid this? What checks on the data to implement to be able to predict that the iterations limit will be exceeded? Here's what the data look like and I can't see anything bad about them. Maybe except for the small outlier close to the end, but that's why I have to use robust fitting for my application.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/148086/image.jpeg)
2 Comments
Satyajeet Sasmal
on 18 Aug 2015
Hi Aleksander,
With the given data set that you provided, the reason for the warning seems to be because of poorly conditioned values in the data set. The values are relatively very close to each other and because of that, the floating point iteration is unable to robustly fit the data.
You can try scaling it out, normalizing it and fixing the spacing between the values in order to get a proper fit.
Also, for the data-set that you provided to us, I would say that a "linear" fit will suffice instead of a "poly3" fit.
Answers (0)
See Also
Categories
Find more on Get Started with Curve Fitting Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!