I have the following vectors:
x = [0.0069 0.0052 0.0034 0.0024 0.0001 -0.0013 -0.0003 ...
-0.0026 -0.0040 -0.0031 -0.0034 -0.0017 -0.0013 -0.0017 ...
-0.0010 -0.0019 -0.0015 -0.0018 -0.0031 -0.0020 -0.0008 ...
0.0007 0.0031 0.0036 0.0060]
y = [0.0069 0.0061 0.0044 0.0031 0.0012 -0.0016 -0.0027 ...
-0.0032 -0.0033 -0.0042 -0.0031 -0.0019 -0.0021 -0.0013 ...
-0.0007 -0.0021 -0.0020 -0.0011 -0.0028 -0.0033 -0.0011 ...
0.0018 0.0027 0.0038 0.0051]
And I am using a robust fit in order to get a linear function y=f(x)=m*x+p
that best fits y vs x ignoring possible outliers:
[b,stats] = robustfit(x,y)
I get a slope m = b(2) = 1.0402 +/- 0.0559
and a y-intercept p = b(1) = 5.1496e-06 +/- 1.6907e-04
The uncertainties are the values I get from stats.se
, which are, according to the manual the "standard" errors of coefficient estimates. But as you can see the uncertainty in the y-intercept is too large, which doesn't seem to make any sense (what's the point in using robust fitting if the uncertainties that we get are not reliable?). Any help on improving this would be very appreciated!
Thank you very much in advance!