Error Metrics in Predictive Models

When evaluating predictive models, it’s essential to quantify how far off the predictions are from actual values. Common metrics include MSE, RMSE, MAE, and MAPE.


1. Mean Squared Error (MSE)

MSE measures the average of the squared differences between predicted and actual values.

MSE=1nβˆ‘i=1n(yiβˆ’y^i)2\text{MSE} = \frac{1}{n} \sum_{i=1}^{n} (y_i - \hat{y}_i)^2
  • yiy_i = actual value
  • y^i\hat{y}_i = predicted value
  • nn = number of observations

Key Characteristics:

  • Penalises larger errors more than smaller ones (due to squaring).
  • Useful when large deviations are particularly undesirable.

Example:

Actual (yiy_i)Predicted (y^i\hat{y}_i)
1012
1514
2017
MSE=(10βˆ’12)2+(15βˆ’14)2+(20βˆ’17)23=4+1+93=4.67\text{MSE} = \frac{(10-12)^2 + (15-14)^2 + (20-17)^2}{3} = \frac{4 + 1 + 9}{3} = 4.67

2. Root Mean Squared Error (RMSE)

RMSE is simply the square root of MSE, bringing the error back to the original unit of measurement.

RMSE=MSE\text{RMSE} = \sqrt{\text{MSE}}

Key Characteristics:

  • Easier to interpret than MSE because it’s in the same units as the original data.
  • Still penalises large deviations strongly.

Example:

Using the MSE above:

RMSE=4.67β‰ˆ2.16\text{RMSE} = \sqrt{4.67} \approx 2.16

3. Mean Absolute Error (MAE)

MAE measures the average of the absolute differences between predicted and actual values.

MAE=1nβˆ‘i=1n∣yiβˆ’y^i∣\text{MAE} = \frac{1}{n} \sum_{i=1}^{n} \left|y_i - \hat{y}_i\right|

Key Characteristics:

  • Treats all errors equally (no squaring).
  • More robust to outliers compared to MSE/RMSE.

Example:

MAE=∣10βˆ’12∣+∣15βˆ’14∣+∣20βˆ’17∣3=2+1+33=2.0\text{MAE} = \frac{|10-12| + |15-14| + |20-17|}{3} = \frac{2 + 1 + 3}{3} = 2.0

4. Mean Absolute Percentage Error (MAPE)

MAPE expresses the error as a percentage of the actual value.

MAPE=100%nβˆ‘i=1n∣yiβˆ’y^iyi∣\text{MAPE} = \frac{100\%}{n} \sum_{i=1}^{n} \left| \frac{y_i - \hat{y}_i}{y_i} \right|

Key Characteristics:

  • Provides an intuitive β€œpercentage error”.
  • Not suitable when actual values (yiy_i) can be zero (division by zero problem).

Example:

MAPE=1003(∣10βˆ’1210∣+∣15βˆ’1415∣+∣20βˆ’1720∣)\text{MAPE} = \frac{100}{3} \left( \left|\frac{10-12}{10}\right| + \left|\frac{15-14}{15}\right| + \left|\frac{20-17}{20}\right| \right) =1003(0.20+0.0667+0.15)β‰ˆ13.9%= \frac{100}{3} (0.20 + 0.0667 + 0.15) \approx 13.9\%

Summary Table

MetricFormulaPenalises Outliers?Units
MSE1nβˆ‘(yβˆ’y^)2\frac{1}{n}\sum (y-\hat{y})^2StronglySquared units
RMSEMSE\sqrt{\text{MSE}}StronglyOriginal units
MAE1nβˆ‘βˆ£yβˆ’y^∣\frac{1}{n}\sum \vert y-\hat{y}\vertMildlyOriginal units
MAPE100nβˆ‘βˆ£yβˆ’y^y∣\frac{100}{n}\sum \left\vert\frac{y-\hat{y}}{y}\right\vertMildlyPercentage
Created: June 2, 2026Last modified: June 2, 2026