Dear users,
I have been struggling with a fitting problem in quite a while. I have small set of 8 points on which I would like to do a least square fit. I tried both 1st and 2nd order fit using "Reg = fitlm(X,Y);" with the arguments "linear", "quadratic" and "purequadratic". The linear fit gives me an R^2 of 0.975 and the quadratic fit 0.982, which makes sense.
If I plot the two fits however, optically the fit becomes worse when using a quadratic function:
1st Order:
2nd Order:
I plotted the fitted lines by plot(xRange,polyval(flip(Reg.Coefficients.Estimate)));
Is there anything I did wrong or could consider?
Thanks for your support,
Frank
Best Answer