Are robust weights accounted in the calculation of the Goodness-of-fit statistics, returned as the gof structure of fit function?

7 次查看(过去 30 天)
When using fit function with robust option activated (Robust:'Bisquare'), are robust weights actually accounted in the calculation of the Goodness-of-fit statistics, which is returned as the gof structure?

回答(1 个)

Govind KM
Govind KM 2024-11-12,9:48
The Robust parameter is indeed taken into account in the calculation of the Goodness-of-fit statistics when using the fit function. This can be seen by comparing the gof outputs from a robust fit to those from a non-robust fit:
load census
[f,gof1] = fit(cdate,pop,'poly3','Normalize','on');
[f,gof2] = fit(cdate,pop,'poly3','Normalize','on','Robust','Bisquare');
disp(gof1)
sse: 149.7687 rsquare: 0.9988 dfe: 17 adjrsquare: 0.9986 rmse: 2.9682
disp(gof2)
sse: 85.5715 rsquare: 0.9993 dfe: 17 adjrsquare: 0.9992 rmse: 2.2436
This can also been seen by stepping through the code of the fit function, which can be accessed by:
edit fit
At line 413, when the Robust parameter is set, the iRobustLinearFit function is called instead of iLinearFit. The residuals are adjusted through some calculations based on the robust weights. These weighted residuals subsequently influence the calculation of the Goodness-of-fit metrics in the iGoodnessStructure function.
Hope this clarifies the issue!

类别

Help CenterFile Exchange 中查找有关 Least Squares 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by