Mean Squared Error Calculator

Model Evaluation

MSE & Model Error Calculator

Evaluate prediction accuracy. Compare actual vs predicted values.

Input Data

Results

Mean Squared Error
0.166000
MSE
0.166000
RMSE
0.407431
MAE
0.380000
0.9517
Pairs analyzed: 5

What is Mean Squared Error (MSE)?

MSE is a fundamental metric for evaluating prediction model performance by measuring average squared differences between observed and predicted values.

MSE = (1/n) × Σ(yᵢ − ŷᵢ)²

Related Metrics:

  • RMSE = √MSE. Returns error to original data units; preferred for interpretation.
  • MAE = (1/n) × Σ|yᵢ − ŷᵢ|. Absolute errors less sensitive to outliers.
  • R² = Proportion of variance explained (0-1 scale). 1 = perfect, 0 = baseline only.

Key Properties:

  • Always ≥ 0; lower is better (perfect = 0).
  • Quadratic penalty: large errors weighted heavily (squared).
  • Influenced by data scale and outliers.
  • Used in optimization: gradient descent minimizes MSE.
  • Assumes residuals approximately normal distributed.

How to Calculate MSE

1

Collect pairs

Gather n pairs of (actual value yᵢ, predicted value ŷᵢ). Ensure same count for both.

2

Calculate errors

For each pair: eᵢ = yᵢ − ŷᵢ (actual minus predicted, can be positive or negative).

3

Square errors

Compute eᵢ² for each error. Removes negative signs and amplifies large errors.

4

Average

MSE = (Σ eᵢ²) / n. Divide sum of squared errors by total pairs to get average.

Example Calculation

Actual: [3, 5, 2, 7, 6] Predicted: [2.5, 5.5, 1.8, 7.2, 5.5] Step 1: Calculate errors (yᵢ − ŷᵢ) e₁ = 3 − 2.5 = 0.5 e₂ = 5 − 5.5 = −0.5 e₃ = 2 − 1.8 = 0.2 e₄ = 7 − 7.2 = −0.2 e₅ = 6 − 5.5 = 0.5 Step 2: Square the errors e₁² = 0.25 e₂² = 0.25 e₃² = 0.04 e₄² = 0.04 e₅² = 0.25 Step 3: Sum squared errors Σ e² = 0.25 + 0.25 + 0.04 + 0.04 + 0.25 = 0.83 Step 4: Calculate MSE MSE = 0.83 / 5 = 0.166 RMSE = √0.166 = 0.4074

Frequently Asked Questions

Related Tools