Root mean squared error (RMSE) is a measure of the discrepancy between predicted or estimated values and corresponding reference values. It is the square root of the mean squared error, or equivalently the root mean square of the errors. Widely used in statistics, machine learning, and numerical modeling, RMSE expresses error in the same units as the quantity being evaluated. Squaring the errors prevents positive and negative discrepancies from canceling and gives greater influence to large errors.
Definition
For observations, let be the reference value and the corresponding prediction. Define the error as . The empirical RMSE is
Reversing the sign convention for the errors does not change the result.
For example, errors of , , and give
If the errors are measured in meters, the RMSE is approximately meters.
A population version uses an expected value rather than an empirical average. For a random prediction and outcome ,
This quantity is finite when the squared error has finite expectation. Empirical RMSE estimates population performance only to the extent that the evaluated observations represent the intended prediction setting.
Interpretation and mathematical properties
RMSE is nonnegative and is zero exactly when every evaluated prediction equals its reference value. Smaller values indicate smaller squared discrepancies, but there is no universal threshold for a “good” RMSE: its meaning depends on the units, variability of the target, measurement quality, and intended application.
For fixed evaluation observations, RMSE is a scaled Euclidean distance between the prediction and reference vectors:
Consequently, it satisfies the triangle inequality and defines a distance on vectors of a fixed length.
If both predictions and reference values are transformed by the same affine rule, , then
Thus, changing the measurement origin does not affect RMSE, while changing the unit rescales it.
Sensitivity to large errors
An error twice as large contributes four times as much to the sum of squared errors. RMSE therefore emphasizes large discrepancies more strongly than mean absolute error (MAE), defined by
For the same errors,
Equality between MAE and RMSE occurs when all error magnitudes are identical. A substantial gap between them indicates variation in error magnitudes, though it does not by itself identify the shape or cause of that variation.
RMSE is not a mean absolute distance, a percentage error, or a bound on individual errors. Nor does it generally equal an error-distribution quantile.
Relationship to bias and variance
Let be the error viewed as a random variable. Its mean squared value decomposes as
Hence,
RMSE therefore combines systematic displacement and error dispersion. It equals the population standard deviation of the errors only when their mean is zero.
For a statistical estimator of a fixed parameter , this becomes
where bias is . An estimator with lower variance need not have lower RMSE if its bias is sufficiently larger.
A related bias–variance decomposition applies to prediction. If
and a fitted predictor is constructed from training data independent of the new observation, its expected squared prediction error can be decomposed, at each input, into squared prediction bias, variance across training samples, and the conditional variance of the observation noise. RMSE is the square root of their sum, not the sum of their square roots.
Role in model fitting
On a fixed dataset, RMSE and mean squared error rank models identically because the square root is strictly increasing. Minimizing RMSE therefore gives the same unpenalized solutions as minimizing mean squared error or the sum of squared errors. This connects RMSE to least-squares methods.
At the population level, the predictor minimizing expected squared error is the conditional mean:
assuming the required second moments exist. It also minimizes population RMSE. By contrast, minimizing expected absolute error targets a conditional median.
In linear regression with independent errors following a normal distribution of common variance, least-squares fitting of the regression coefficients agrees with maximum likelihood estimation. Normality is not required to calculate RMSE; it matters for this particular probabilistic interpretation.
Although RMSE and mean squared error have the same minimizers, their derivatives differ. Moreover, adding the same regularization penalty to each does not generally preserve equivalence: minimizing need not give the same solution as minimizing .
Prediction RMSE versus residual standard error
For fitted residuals , empirical training RMSE uses the denominator :
In an ordinary linear model, the residual standard error commonly uses
where is the rank of the design matrix, including the intercept when present. The denominator accounts for the residual degrees of freedom.
Under the usual correctly specified linear-model assumptions with independent errors of common variance, is an unbiased estimator of that variance. Its square root is not generally unbiased for the error standard deviation.
These quantities serve different purposes: training RMSE describes the observed fit, whereas residual standard error estimates an underlying noise scale under model assumptions. Neither automatically measures prediction error on new observations.
Evaluation and sampling uncertainty
Training RMSE is often optimistic because the fitted model has already used those observations. Predictive evaluation instead uses a held-out test set or cross-validation, with evaluation data excluded from fitting and model-selection steps that would leak information.
For time series, evaluation commonly preserves temporal ordering. Randomly mixing past and future observations can produce an evaluation setting unlike actual forecasting.
Cross-validation also introduces an aggregation distinction. If fold has observations and RMSE , the RMSE pooled across all held-out predictions is
This is generally different from the arithmetic mean of fold RMSEs, even when folds have equal sizes.
Empirical RMSE is subject to sampling uncertainty. Under independent, identically distributed evaluation errors with finite second moment, it converges to population RMSE as sample size increases. Nevertheless, an unbiased empirical mean squared error does not yield an unbiased RMSE after taking the square root. By Jensen’s inequality,
Methods such as bootstrap sampling can be used to assess uncertainty, provided the resampling scheme reflects relevant dependence in the data.
Weighted, normalized, and multivariate forms
Weighted RMSE
For nonnegative weights with positive total weight,
Weights may represent observation importance, sampling structure, or differences in precision. Different weighting schemes define different evaluation objectives, so the weights are part of the metric’s specification.
Normalized RMSE
Normalized RMSE divides RMSE by a chosen reference scale :
Common scales include the reference values’ standard deviation, range, or mean. There is no universally accepted normalization. Range normalization is sensitive to extreme values; mean normalization is problematic when the mean is near zero or when its value depends on an arbitrary measurement origin. A reported normalized RMSE therefore requires an explicit denominator.
Multiple outputs
For output variables, one convention averages all squared component errors before taking the square root:
Another reports an RMSE for each output, possibly followed by a weighted average. These procedures are not generally equivalent. Combining outputs measured in different units also requires explicit scaling or a defined weighting rule.
Applications and limitations
RMSE is used to evaluate numerical predictions, forecasts, reconstructed signals, and approximations to reference solutions. Its original-unit scale and close connection to squared-error optimization make it useful when large errors deserve disproportionate weight.
Its limitations follow from the same properties:
- Sensitivity to extreme errors: a small number of large discrepancies can dominate the result.
- Dependence on scale and task difficulty: RMSE values from different units, populations, or forecast horizons are not directly comparable.
- Loss of diagnostic information: one aggregate value conceals error direction, subgroup differences, and patterns across inputs or time.
- Dependence on reference quality: discrepancies may reflect uncertainty or error in the reference values as well as prediction error.
- Symmetric treatment of errors: equally large overpredictions and underpredictions receive the same penalty, even when their consequences differ.
- Limited assessment of probabilistic forecasts: RMSE evaluates point predictions rather than the quality of an entire predictive distribution.
A low RMSE consequently describes performance under a particular squared-error criterion; it does not by itself establish reliable uncertainty estimates, causal validity, or satisfactory performance for every subgroup.