RMSE

calculates root mean square error from data vector or matrix and the corresponding estimates.

You are now following this Submission

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 (2026). RMSE (https://www.mathworks.com/matlabcentral/fileexchange/21383-rmse), MATLAB Central File Exchange. Retrieved .

Acknowledgements

Inspired: rmse(true_values, prediction)

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
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!