Can I obtain the coefficient of determination from the ROBUSTFIT function in the Statistics Toolbox?

1 view (last 30 days)

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
The ability to automatically return the coefficient of determination for the fit when using the ROBUSTFIT function is not available in the Statistics Toolbox.
If you have the Curve Fitting Toolbox, you can turn the "Robust" option to "on" with a linear polynomial fit to perform the same fit and obtain the coefficient of determination. Consider the following example:
x = (1:10)';
y = 10 - 2*x + randn(10,1);
fit_opts = fitoptions('Method', 'LinearLeastSquares', 'Robust', 'on');
[fit_result, goodness, output] = fit(x, y, 'poly1', fit_opts)

More Answers (0)

Community Treasure Hunt

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

Start Hunting!