What Is RMSE? (Definition)
The full name — Root Mean Square Error — describes the calculation literally: take each prediction error, square it (the "square" step), average those squared errors (the "mean" step), then undo the squaring with a square root (the "root" step). The result lands back in the original units of your outcome variable, which is why RMSE is so widely reported: a model predicting house prices with RMSE = $12,000 is immediately understandable in a way that MSE = 144,000,000 is not.
RMSE is also called the Root Mean Square Deviation (RMSD), particularly in fields like meteorology and geoscience. The two terms refer to the same calculation. In simple linear regression and multiple linear regression, RMSE is one of the primary metrics for assessing how well the fitted line explains the data.
RMSE (Root Mean Square Error) measures prediction accuracy in regression models. It is calculated as the square root of the average squared differences between predicted and actual values: RMSE = √[ (1/n) · Σ(yᵢ − ŷᵢ)² ]. Lower RMSE means more accurate predictions. RMSE is expressed in the same units as the target variable.
RMSE Formula
The RMSE formula has two common forms. The standard form divides by n (treating the dataset as the full population of predictions you care about). Some texts use n − 1 in the denominator for sample correction, though in practice the difference is negligible for any reasonably large dataset.
n = number of observations
yᵢ = actual (observed) value for observation i
ŷᵢ = predicted value for observation i
yᵢ − ŷᵢ = residual (prediction error)
Σ = sum over all n observations
Breaking Down the Formula
Each symbol in the formula plays a specific role. Understanding what each piece does helps you interpret the final number correctly.
| Symbol | Name | What it represents |
|---|---|---|
| yᵢ | Actual value | The true, observed outcome for the i-th data point |
| ŷᵢ | Predicted value | The value your model output for the i-th data point |
| yᵢ − ŷᵢ | Residual | The signed error for observation i; negative if overpredicted |
| (yᵢ − ŷᵢ)² | Squared residual | Makes all errors positive; heavily weights large errors |
| (1/n) Σ(...)² | MSE | The average of squared residuals — Mean Squared Error |
| √MSE | RMSE | The square root returns units to the original scale |
The squaring step is the defining feature of RMSE. Because squaring is a nonlinear operation, an error of 10 units contributes 100 to the sum, while an error of 1 unit contributes only 1. A single large error can dominate the RMSE. This is both the strength (RMSE catches outlier predictions that other metrics may miss) and the limitation (one bad prediction inflates RMSE disproportionately) of the metric.
How to Calculate RMSE (Step by Step)
The calculation follows five steps that can be done by hand for small datasets, in a spreadsheet, or with a single function call in Python. The steps below use a concrete numeric example so every operation is visible.
List actual and predicted values
Gather your actual observed values (yᵢ) and the corresponding predictions from your model (ŷᵢ). You need one actual-predicted pair for each observation in your evaluation set.
Compute the residual for each observation
Subtract the predicted value from the actual value: eᵢ = yᵢ − ŷᵢ. Positive residuals mean the model underpredicted; negative residuals mean it overpredicted. The sign does not matter yet because the next step squares everything.
Square each residual
Calculate eᵢ² = (yᵢ − ŷᵢ)² for each observation. Squaring eliminates negative signs and amplifies the contribution of larger errors relative to smaller ones.
Average the squared residuals (compute MSE)
Sum all squared residuals and divide by n: MSE = (1/n) · Σeᵢ². This intermediate value is the Mean Squared Error. RMSE and MSE measure the same thing — only the scale differs.
Take the square root
RMSE = √MSE. The square root brings the unit back from squared units (e.g., dollars²) to the original unit (dollars). This is the reported RMSE value.
Worked Example — RMSE Calculation
Problem: A regression model predicts weekly sales (in $1,000s) for 6 stores. The actual and predicted values are shown below. Calculate the RMSE.
| Store (i) | Actual yᵢ ($k) | Predicted ŷᵢ ($k) | Residual eᵢ = yᵢ − ŷᵢ | Squared eᵢ² |
|---|---|---|---|---|
| 1 | 42 | 40 | 2 | 4 |
| 2 | 55 | 58 | −3 | 9 |
| 3 | 67 | 63 | 4 | 16 |
| 4 | 71 | 75 | −4 | 16 |
| 5 | 83 | 80 | 3 | 9 |
| 6 | 90 | 98 | −8 | 64 |
| Sum of squared errors (SSE) | 118 | |||
| MSE = 118 / 6 | 19.67 | |||
| RMSE = √19.67 | ≈ 4.43 | |||
Residuals: (42−40)=2, (55−58)=−3, (67−63)=4, (71−75)=−4, (83−80)=3, (90−98)=−8
Squared residuals: 4, 9, 16, 16, 9, 64
Sum of squared errors: 4 + 9 + 16 + 16 + 9 + 64 = 118
MSE: 118 / 6 = 19.667
RMSE: √19.667 ≈ 4.43
✅ Interpretation: The model's weekly sales predictions are off by roughly $4,430 on average. Notice that Store 6 (actual = 90, predicted = 98, error = −8) contributed 64 out of 118 total squared error — more than half — illustrating RMSE's sensitivity to large individual errors.
RMSE Calculator
Enter your actual and predicted values below — one pair per line, separated by a comma. The calculator shows the full breakdown including each residual, MSE, and RMSE.
Interactive RMSE Calculator
Format: one pair per line as actual, predicted. Example: 42, 40
How to Interpret RMSE
RMSE does not have a universal scale. An RMSE of 5 could be excellent (predicting temperatures in Celsius to within 5°) or terrible (predicting house prices that vary by $5,000 but RMSE is $50,000). Interpretation always requires context.
What Is a Good RMSE Value?
Three benchmarks help judge whether a given RMSE is acceptable.
RMSE is noticeably lower than the standard deviation (SD) of the target variable. The ratio RMSE/SD < 0.5 is a common practical threshold for a model that adds real predictive value beyond just predicting the mean.
RMSE is close to the SD of the target. RMSE/SD between 0.5 and 1.0. The model captures some variance but there is room for improvement. May be acceptable for rough forecasting but not precise prediction.
RMSE ≥ SD of the target variable. RMSE/SD > 1.0. The model is no better — or worse — than simply predicting the mean every time. Revisit feature engineering, model selection, or data quality.
- Compare models, not absolute values. RMSE is most useful for comparing two or more models evaluated on the same dataset. The model with lower RMSE fits better.
- Context of the domain matters. In weather forecasting, a 1°C RMSE in temperature is excellent; in predicting stock returns, it might be poor. Know what error scale is acceptable in your field.
- Use RMSE/SD as a normalized benchmark. Dividing RMSE by the standard deviation of the target variable gives a unitless ratio that generalizes across different problems.
- Watch for outliers inflating RMSE. A single extreme prediction error can dominate RMSE. If RMSE and MAE diverge widely, investigate whether outliers are driving the difference.
- Train vs. test RMSE gap signals overfitting. If training RMSE is much lower than test RMSE, the model has overfit the training data and will not generalize well to new observations.
RMSE Relative to Standard Deviation — Example
Suppose you are predicting apartment rental prices. The mean monthly rent in your dataset is $1,850 and the standard deviation is $420. You train two models and evaluate them on a held-out test set.
| Model | RMSE ($) | RMSE / SD | Verdict |
|---|---|---|---|
| Baseline (predict mean always) | 420 | 1.00 | No predictive value |
| Linear Regression | 310 | 0.74 | Moderate — captures some variance |
| Gradient Boosting | 185 | 0.44 | Good — substantially better than baseline |
The gradient boosting model's RMSE ($185) is less than half the target's standard deviation ($420), placing it in the "good" range. The linear regression model improves over the baseline but leaves considerable unexplained variance.
RMSE vs MSE vs MAE vs R²
No single metric tells the full story. Using multiple evaluation metrics gives a more complete picture of model performance. The table below covers the four most common regression metrics.
| Property | RMSE | MSE | MAE | R² |
|---|---|---|---|---|
| Formula | √[ Σ(y−ŷ)² / n ] | Σ(y−ŷ)² / n | Σ|y−ŷ| / n | 1 − SSR/SST |
| Units | Same as y | Squared units of y | Same as y | Unitless (0–1) |
| Range | [0, ∞) | [0, ∞) | [0, ∞) | (−∞, 1] |
| Penalizes large errors? | Yes — heavily | Yes — heavily | No — equally | Yes (via SSR) |
| Sensitive to outliers? | Yes | Yes | Less so | Yes |
| Interpretable scale? | Yes | No (squared) | Yes | Yes (% variance) |
| Best for | General-purpose error reporting when large errors matter | Gradient optimization in ML training loops | Robust error reporting when outliers exist | Explaining variance explained by the model |
RMSE vs MAE — Which Should You Use?
This is the most common choice practitioners face. Both are in the same units as the target variable and both equal zero for a perfect model. The difference is how they treat large errors.
Use RMSE when large prediction errors are disproportionately costly (e.g., a forecast that is off by $10,000 is much more than 10× as bad as one off by $1,000). Use MAE when all errors should be weighted equally, or when the dataset contains outliers that should not dominate the metric.
When RMSE and MAE give similar numbers, the model's errors are consistent in magnitude — there are no extreme outlier predictions. When RMSE is noticeably higher than MAE (roughly RMSE/MAE > 1.5), it signals the presence of a few large errors pulling RMSE up. Investigating those specific predictions often reveals data quality issues or edge cases the model handles poorly.
RMSE vs MSE
RMSE is simply the square root of MSE. They are mathematically equivalent for comparing models: if Model A has lower MSE than Model B, it will also have lower RMSE. The only practical reason to prefer RMSE over MSE is interpretability — RMSE is in the same units as the target, making it easier to communicate. During model training, MSE is often preferred as the loss function because its gradient is smoother than that of RMSE (no division by RMSE in the gradient calculation).
RMSE vs R²
R² (the coefficient of determination) measures the proportion of variance in the target variable explained by the model, on a 0–1 scale (values below 0 indicate the model is worse than predicting the mean). RMSE and R² are related but measure different things. A high R² does not guarantee a low RMSE in absolute terms — it depends on the scale of the target variable. For comparing models across different datasets, R² is more meaningful. For communicating prediction accuracy in the real-world units of the problem, RMSE is more meaningful. In regression analysis, reporting both is standard practice. Learn more about regression metrics at Statistics Fundamentals.
How to Calculate RMSE in Python and Excel
RMSE in Python (scikit-learn)
scikit-learn's mean_squared_error function accepts an optional squared=False parameter that returns RMSE directly, or you can take the square root of MSE manually.
from sklearn.metrics import mean_squared_error import numpy as np y_actual = [42, 55, 67, 71, 83, 90] y_predicted = [40, 58, 63, 75, 80, 98] # Method 1: squared=False (scikit-learn ≥ 0.24) rmse = mean_squared_error(y_actual, y_predicted, squared=False) # Method 2: manual square root mse = mean_squared_error(y_actual, y_predicted) rmse = np.sqrt(mse) print(f"RMSE: {rmse:.4f}") # Output: RMSE: 4.4347
In scikit-learn ≥ 1.4, the squared parameter was deprecated in favour of a dedicated root_mean_squared_error function. Both approaches above work across all common versions.
How to Calculate RMSE in Excel
There is no built-in RMSE function in Excel, but the calculation takes a single formula. Place actual values in column A (A2:A7) and predicted values in column B (B2:B7), then enter this in any empty cell:
=SQRT(SUMXMY2(A2:A7, B2:B7) / COUNT(A2:A7))
Real-World Applications of RMSE
RMSE appears across industries wherever quantitative predictions are made and accuracy must be measured objectively.
Real Estate Pricing
Automated valuation models report RMSE in dollars to quantify how far off typical price estimates are from actual sale prices.
Weather Forecasting
Numerical weather prediction models are evaluated with RMSD for temperature, wind speed, and precipitation forecasts against observed values.
Sales Forecasting
Demand planning teams use RMSE to compare forecast models for inventory optimization, where large errors cause stockouts or excess inventory.
Machine Learning (Kaggle)
Many regression competitions on Kaggle use RMSE or its log-transformed variant (RMSLE) as the official competition metric.
Pharmacokinetics
Drug concentration models are assessed with RMSE to validate that predicted plasma concentration curves match observed patient data.
Recommendation Systems
The Netflix Prize used RMSE to evaluate collaborative filtering models predicting user ratings. Reducing RMSE by 10% was the contest benchmark.
Normalized RMSE (NRMSE)
Because RMSE is in the units of the target variable, it cannot be directly compared across datasets with different scales. Normalized RMSE (NRMSE) divides RMSE by a range or dispersion measure to produce a dimensionless score.
| Normalization Method | Formula | When to use |
|---|---|---|
| Range normalization | RMSE / (y_max − y_min) | Quick comparison; sensitive to outliers in range |
| SD normalization | RMSE / SD(y) | Most recommended; robust and interpretable |
| Mean normalization (CV(RMSE)) | RMSE / mean(y) × 100% | Common in engineering and climate science |
| IQR normalization | RMSE / IQR(y) | When data has heavy tails or outliers |
SD normalization is the most statistically grounded approach. An NRMSE of 0.40 (RMSE = 40% of SD) means the model's average error is 40% of the natural spread in the target variable — a number that transfers across different regression problems. Learn more about standard deviation and variance on Statistics Fundamentals.
Frequently Asked Questions
RMSE stands for Root Mean Square Error. Each word describes a step in the calculation: you take each prediction error (Error), square it (Square), average the squared errors (Mean), then take the square root of that average (Root). The result is in the same units as the target variable you are predicting.
Yes. RMSE = 0 means the model predicts every observation exactly. Any positive RMSE represents average prediction error. When comparing two models on the same dataset, the model with lower RMSE is more accurate. There is no good RMSE value in isolation — the number only becomes meaningful when benchmarked against the scale of the target variable or compared to competing models.
Both measure average prediction error in the same units as the target variable. The key difference is how errors are aggregated. MAE averages the absolute errors equally: MAE = (1/n) Σ|yᵢ − ŷᵢ|. RMSE squares the errors first, which means large errors contribute disproportionately. If your RMSE is much larger than your MAE, it indicates the model has a few large errors. If they are close, errors are consistent in magnitude. Use RMSE when large errors are especially harmful; use MAE for a robust, outlier-resistant measure.
There is no universal threshold because RMSE is in the units of the target variable. The most useful benchmark is the ratio RMSE / SD(y). A ratio below 0.5 generally indicates a model that adds meaningful predictive value. For Kaggle competitions, the leaderboard defines what "good" means in context — a top 10% solution on a housing price competition might have RMSE around $12,000–$18,000 depending on the price range of the dataset. Always compare RMSE across models on the same evaluation set using consistent train/test splits.
Yes, but only if the model predicts every single observation exactly (all residuals are zero). In practice this only occurs when a model is evaluated on its exact training data with no regularization — a severe case of overfitting. On a proper held-out test set, RMSE will always be greater than zero due to noise in real data.
In regression analysis, RMSE measures the average deviation of the fitted line (or surface) from the actual data points. For example, in simple linear regression predicting salary from years of experience, an RMSE of $4,500 means the regression line is, on average, $4,500 away from each actual salary in the evaluation set. A lower RMSE means the line fits the data more closely. In multiple linear regression, RMSE is used the same way but the model has more predictors.
The formula is identical: RMSE = √[ (1/n) · Σ(yᵢ − ŷᵢ)² ]. The difference is in how the evaluation set is constructed. In statistics, RMSE is often computed on in-sample residuals from a fitted model. In machine learning, best practice requires evaluating RMSE on a held-out test set (or via cross-validation) that was not used during training. In-sample RMSE can be misleadingly low for complex models that overfit; test-set RMSE gives a more honest measure of real-world accuracy.
RMSE Quick Reference
| Item | Detail |
|---|---|
| Full name | Root Mean Square Error (also Root Mean Square Deviation, RMSD) |
| Formula | RMSE = √[ (1/n) · Σ(yᵢ − ŷᵢ)² ] |
| Equivalent to | √MSE |
| Units | Same as the dependent variable y |
| Range | [0, ∞) — zero is perfect; higher is worse |
| Error weighting | Squares errors — large errors weighted more heavily |
| Outlier sensitivity | High — one large error can dominate RMSE |
| Best comparison metric | MAE (for outlier-robustness) and R² (for variance explained) |
| Python (sklearn) | mean_squared_error(y_true, y_pred, squared=False) |
| Excel | =SQRT(SUMXMY2(actual, predicted) / COUNT(actual)) |
| Good RMSE benchmark | RMSE / SD(y) < 0.5 |
| Common in | Regression, ML model evaluation, forecasting, Kaggle competitions |