What causes robust fit iterations to exceed the limit

19 views (last 30 days)
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.
  2 Comments
Satyajeet Sasmal
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.
Aleksander Lidtke
Aleksander Lidtke on 25 Aug 2015
Edited: Aleksander Lidtke on 25 Aug 2015
Hi,
Thanks a lot for your response. Do you mean scaling the X values? Because the Y values are already normalised, so I don't see how that could change anything. Also I can't change the distribution of the X values, they are what they are and I have to cope with that. But scaling could work.
As far as the type of the fit goes I agree that the sample would probably be best represented by a line. However, I do not a priori know what the data will look like (this is part of an automated algorithm). Any idea how to programatically adjust the order of the fit to avoid the iterations limit being exceeded? Still, that isn't ideal because some of the data will be regressed with polynomial of one degree, others with a different one, so everything won't be consistent. So any other ideas are more than welcome.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!