Mathwords logoMathwords

Mean Absolute Error — Definition, Formula & Example

Mean absolute error (MAE) is the average distance between predicted values and actual values. It tells you how far off your predictions typically are, in the same units as the data.

For nn paired observations with actual values yiy_i and predicted values y^i\hat{y}_i, the mean absolute error is the arithmetic mean of the absolute residuals ∣yi−y^i∣|y_i - \hat{y}_i|. It is always nonnegative. It equals 0 only when every prediction is exact.

Key Formula

MAE=1n∑i=1n∣yi−y^i∣\text{MAE} = \frac{1}{n}\sum_{i=1}^{n} \left| y_i - \hat{y}_i \right|
Where:
  • nn = number of predictions
  • yiy_i = actual (observed) value for case i
  • y^i\hat{y}_i = predicted value for case i
  • yi−y^iy_i - \hat{y}_i = residual (error) for case i

Worked Example

Problem: A food delivery app predicts delivery times for 5 orders. The predicted times were 30, 25, 40, 20, and 35 minutes. The actual times were 34, 22, 40, 26, and 28 minutes. Find the MAE.
Step 1: Find each error as actual minus predicted. Some are positive (late) and some are negative (early).
4, −3, 0, 6, −74,\ -3,\ 0,\ 6,\ -7
Step 2: Take the absolute value of each error and add them.
4+3+0+6+7=204 + 3 + 0 + 6 + 7 = 20
Step 3: Divide by the number of orders.
MAE=205=4 minutes\text{MAE} = \frac{20}{5} = 4 \text{ minutes}
Answer: The MAE is 4 minutes. A typical prediction missed the actual delivery time by about 4 minutes. If you averaged the signed errors instead, you would get (4 − 3 + 0 + 6 − 7)/5 = 0, which falsely suggests the app is perfect.

Why It Matters

In AP Statistics, you judge a regression line by its residuals, and the course summarizes their typical size with ss, the standard deviation of the residuals. MAE is a simpler summary of the same residuals, also in the original units. Data scientists and forecasters report MAE alongside root mean squared error. MAE weights every miss equally, so one large error does not dominate it the way squaring would.

Common Mistakes

Mistake: Treating MAE as the same thing as mean absolute deviation (MAD).
Correction: MAD measures spread within one data set: the average distance of each value from that set's mean. MAE compares two lists, predicted and actual, and averages the distances between matched pairs. Use MAD to describe variability. Use MAE to judge how accurate predictions are.

Related Terms