RMSE

calculates root mean square error from data vector or matrix and the corresponding estimates.
15.2K Downloads
Updated 31 Mar 2016

View License

Short script that calculates root mean square error from data vector or matrix and the corresponding estimates.
Checks for NaNs in data and estimates and deletes them and then simply does:
r = sqrt( sum( (data(:)-estimate(:)).^2) / numel(data) );
That's it.

Cite As

Felix Hebeler (2024). RMSE (https://www.mathworks.com/matlabcentral/fileexchange/21383-rmse), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2006a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Polynomials in Help Center and MATLAB Answers
Acknowledgements

Inspired: rmse(true_values, prediction)

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.1.0.0

Updated description and code for better readability and
BSD update

1.0.0.0

By popular demand: using sum(data(:)) instead of sum(sum(data)). Thanks!