Various types of RMSE in Regression Learner. Is it a bug?

조회 수: 3 (최근 30일)
Serhiy Shtovba
Serhiy Shtovba 2019년 11월 24일
답변: Javier Valdes 2023년 5월 31일
I use the Regression Learner to produce a simple regression model. There are the following information related to the model in the Regression Learner window:
RMSE=3.5007
MSE=12.255
Observations=196.
But, when I exported the model to the workspace I see other value for RMSE: RMSE=3.53.
So, the same model has 2 different RMSEs. The first one is RMSE=3.5007. It is calculated as
RSME=sqrt( sum_of_squared_error / number_of_observations).
The second one (RMSE=3.53) is calculated as
RSME=sqrt( sum_of_squared_error / (number_of_observations - number_of_coefficients) ).
Why is necessary to use 2 various kinds of RMSE in the Regression Learner? May be it is a bug?
--
I checked also Curve Fitting Tool. It use the second variant of RMSE.

채택된 답변

Hiro Yoshino
Hiro Yoshino 2019년 11월 29일
They should be matched together however it is not necessarily a bug because ...
RMSE is an estimator of standard error, or standard deviation.
Then, there are two types for it: biased and unbiased estimators.
Your first RMSE is a biased estimator and the second one is an unbiased counterpart.
The First one is derived from maximum likelihood method and the other one is from statistical approach.
Good point of the unbiased estimator is that its expectation matches the true value of the standard deviation.
(Obviously it is not the case with the biased one)
That being said, the point you're making is absolutely reasonable. They should not be confusing at least.
Thanks very much for raising a flag.

추가 답변 (1개)

Javier Valdes
Javier Valdes 2023년 5월 31일
Hi all,
Definitively it is a little confussing situation.
When I get the RMSE from a fitted linear regresion model, the value is different that when I compute it using the built-in rmse function in matlab with the exact same input data.
I would like to suggest to MATLAB developers to include a discrimination between the two alternatives to compute rmse, in a simmilar way as it is discrimante between mdl.Rsquared.Ordinary an mdl.Rsquared.Adjusted
>> mdl.RMSE
ans =
0.081319469137617
>> rmse(mdl.Variables.y(:),mdl.Fitted(:))
ans =
0.079281062990489

카테고리

Help CenterFile Exchange에서 Support Vector Machine Regression에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by