MSE Calculator — Mean Squared Error & RMSE
Evaluate how well a model or forecast fits the data by entering the actual and predicted values. Instantly get MSE, RMSE, MAE, and the coefficient of determination R² to compare model performance.
Average of squared differences between actual and predicted values
- 1
Number of pairs (n)
5 - 2
Sum of squared errors
Σ(yᵢ − ŷᵢ)² = 30 - 3
MSE
30 ÷ 5 = 6
Hvordan fungerer denne lommeregner?
MSE = (1/n) × Σ(actual − predicted)². Squaring amplifies large errors; RMSE = √MSE restores the original units. MAE = (1/n) × Σ|actual − predicted| is more robust to outliers. R² = 1 − MSE/Var(y) measures goodness-of-fit on a 0–1 scale. Lower MSE/RMSE/MAE and higher R² indicate a better-fitting model.
Formel
How this is calculated
The Mean Squared Error (MSE) is the most widely used loss metric in regression: for each observation it squares the difference between the actual value (yᵢ) and the model's prediction (ŷᵢ), then averages those squared residuals over all n pairs. Squaring has two effects — it makes all errors positive and it penalises large errors disproportionately relative to small ones, so an outlier prediction carries far more weight in MSE than in MAE.
The Root Mean Squared Error (RMSE = √MSE) is expressed in the same units as the original data, making it more interpretable than MSE. Both MSE and RMSE are differentiable everywhere and are therefore the standard training objectives for linear regression and neural networks. The Mean Absolute Error (MAE) uses |yᵢ − ŷᵢ| instead of squares, so it treats all errors proportionally and is more robust to outliers — it is preferred when large individual errors should not be penalised extra heavily.
R² (the coefficient of determination) compares the model's total squared error to the variance of the target variable: R² = 1 − MSE / Var(y). An R² of 1.0 means a perfect fit; 0.0 means the model does no better than always predicting the mean; negative values indicate the model performs worse than the mean. These metrics assume a paired 1-to-1 correspondence between actual and predicted lists; if the lists have different lengths, only the first n pairs (where n is the shorter list) are used.
Ofte stillede spørgsmål
Use RMSE when large errors are especially undesirable and you want the metric to emphasise outliers — for example in financial forecasting where a rare but large miss has outsized consequences. Use MAE when you want a metric that treats all errors proportionally and is less sensitive to a few extreme values, such as in demand forecasting across many SKUs.
There is no universal threshold — MSE is scale-dependent, so a value of 4 is excellent if the target ranges from 0–100 but terrible if the target ranges from 0–1. Always compare RMSE to the range or standard deviation of the actual values. Alternatively, normalise it: NRMSE = RMSE ÷ (max − min) or RMSE ÷ mean. R² provides a scale-free comparison: values above 0.9 are generally strong for most regression tasks.
Squared errors are differentiable everywhere (the absolute-value function has a kink at zero), which makes them compatible with gradient-based optimisation. Squaring also corresponds to the maximum-likelihood estimate under a Gaussian noise assumption — the standard model in ordinary least-squares regression. MAE corresponds to maximum-likelihood under a Laplacian noise assumption, which is heavier-tailed and more robust to outliers.
Også kendt som
TG we-Calculate Editorial Team. (2026). MSE Calculator — Mean Squared Error & RMSE [Online calculator]. TG we-Calculate. https://we-calculate.com/da/calculator/mse-calculator
TG we-Calculate Editorial Team. "MSE Calculator — Mean Squared Error & RMSE." TG we-Calculate. 2026. https://we-calculate.com/da/calculator/mse-calculator.
TG we-Calculate Editorial Team, "MSE Calculator — Mean Squared Error & RMSE," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/da/calculator/mse-calculator
@misc{wecalculate_mse_calculator, title = {MSE Calculator — Mean Squared Error & RMSE}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/da/calculator/mse-calculator}}, year = {2026}, note = {TG we-Calculate} }
Hjalp denne lommeregner dig?
