If you have read some of my posts, you have seen me mentioning that MSE “prefers” the mean, MAE the median, and pinball loss a specific quantile. But what does that actually mean? Let me show you.
Take some data and a model that you want to fit. In the example I use here, it’s weekly sales of a product, explained by two promotional campaigns via a linear regression. The model omits some important variables, but this is not important for the demonstration. We can estimate the same model using three different losses: MSE, MAE, and pinball loss for the 0.75 quantile. This gives three different fitted lines and different residuals (actuals minus fitted values).
The main image in the post shows the histograms of the residuals for each of the three cases. The vertical lines show the mean (red), the median (blue) and the 0.75 quantile (orange) of the residuals, while the dashed line shows zero. And here is the thing: in each case, a different line ends up at zero.
- With MSE, the mean of the residuals is zero. The model is drawn so that over- and under-forecasts cancel out on average.
- With MAE, the median of the residuals is zero. The model is drawn so that half of the actual values are above the line and half below it.
- With pinball loss for the 0.75 quantile, the 0.75 quantile of the residuals is zero. The model is drawn so that the actual values are below the line roughly 75% of the time.
So, this is what “prefers” means: each loss places the fitted line so that its own statistic of the residuals is at zero.
Why should you care? Because these lines are not the same. In my example, the residuals are skewed: there are a few weeks with much higher sales than the model expects, and many weeks with slightly lower ones. As a result, their median is lower than their mean, and their 0.75 quantile is much higher than both. So, the MAE model produces lower forecasts than the MSE one, and the pinball model produces the highest forecasts of the three.
Here is also the table with different losses and statistics that minimise them:

This image shows the same information but from a different angle. If we take the fitted line and move it up and down, we get different values of MSE, MAE, and pinball. And MSE is the lowest when the line passes through the mean of the residuals, MAE when it passes through their median, and pinball loss when it passes through their 0.75 quantile.
And exactly the same principle applies to forecast evaluation! As Gneiting (2011) showed, the error measure should match what your forecast aims for. So, if your model produces (conditional) mean but is evaluated with MAE, which favours the median, you will end up selecting the wrong forecast (more on this here).
So, next time you need to decide how to estimate a model or evaluate forecasts, ask yourself: what do we aim for?
Also, here is the Python code for the example I used:
#forecasting #datascience #demandplanning #supplychain #machinelearning