Various types of RMSE in Regression Learner. Is it a bug?
Afficher commentaires plus anciens
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.
Réponse acceptée
Plus de réponses (1)
Javier Valdes
le 31 Mai 2023
0 votes
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
Catégories
En savoir plus sur Discriminant Analysis dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!