Result Discussion of Curve Fitting MATLAB Program
OBTAINED PLOTS:
(A) Linear Polynomial Fits:
Comparison for Best Fit between the above 2 Curve Fits:
(B) Cubic Polynomial Fits:
Comparison for Best Fit between the above 2 Curve Fits:
RESULT DISCUSSION:
Warning: "Iteration limit reached for robust fitting"
The above Warning appears after running the program due to poorly conditioned values in the original Data set. As the values are relatively very close to each other , the floating point iteration is unable to robustly fit the data. So,in order to get a proper fit we should fix the spacing between the values.
Comparison between Linear and Cubic Fit:
If we look at the plots between the Linear and Cubic Fit, we will find that Cubic Fit is better than the other one. Hence one can say, greater the polynomial degree better the curve fit. But it's wrong because increasing the polynomial degree doesnot always result a better fit. High order polynomials may oscillate between the data points which will lead to a poorer fit. In those cases we have to use low order polynomial fit.
Comparison between Robust Bisquare and Robust LAR Method:
Again from the above Residual Graphs, we found Bisquare Method gives better fit than LAR in Linear Polynomial. But in case of Cubic Polynomial, this Method provides slightly poorer fit. Therefore LAR Method should be used here.
NB: As LAR method results a curve which minimizes the Absolute Difference of the Residuals rather than the Squared Differences. So, extreme values have a lesser influence on the fit and that's why extreme positions of LAR graphs deviate more than that of the Bisquare graphs.
Residual / Error / Deviation Finding Method:
Residual = abs(original y data - predicted y data)
There is another way to find out the residuals. We can extract them from 'output' obtained in the fit function.
i.e. [fitobject, gof, output] = fit(x, y, fitType)
gof tells us the following Goodness of Fit statistics for current Curve Fit:
- The Sum of Squares due to Error (SSE)
- R-Square
- Adjusted R-Square
- Root Mean Squared Error (RMSE)
CONCLUSION:
From the Result Discussion, we came to know that the Curve Fit purely depends on the given Data set. So we have to smartly choose the different available Methods, Techniques and other parameters according to the original Data.