# Median-based Versus Average-based forecast? Which is better?

When generating forecasts (e.g., product-customer time series data), should we choose an average-based forecast or median-based forecast? I recently read a very nice article by Nicholas Vandeput on LinkedIn wherein he linked the forecast type to use of different best fit selection criteria.

Optimization on RMSE yields an average-based number... whereas on MAE yields a median-based forecast

Forecast KPI: RMSE, MAE, MAPE & Bias

Advantages of using median forecast: robust to outliers

Disadvantages of using median forecast: bad for intermittent time series data, medians can be biased for non-normal data, median forecasts are not additive

Q: If that is the case, should we ever use median-based forecasts?

Q: Alternatively, can we correct the data for outliers through outlier correction or "de-promotionalization" and then generate an average-based forecast?

## 2 Answers

I'm pretty sure I answered this question before. The answer depends on how you define a better forecast. If you define it as minimizing expected loss (forecast error) then the average will be better for minimizing the square of an error and the median minimizes the absolute value of an error both in expected sense.

Suppose your loss function is $$f(y-\hat y)$$ then you find the forecast $$\hat y$$ that minimizes the expected loss as $$\min E[f(y-\hat y) ]$$

It can be shown that for $$f(x)=x^2$$ your $$\hat y=E[y]$$ and for $$f(x)=|x|$$ the best forecast is $$\hat y=median(y)$$

Honestly your questions has only one good answer which is it depends :D.

However i will try to give you another idea.

You could use median of means, https://arxiv.org/pdf/1711.10306.pdf (don't know if it is the best article to speak about it, again it is just to give the idea).

The main idea behind median of means is what you say, media is robust, means is good when no outliers. So cutting the N variables into K groups where you do means and then take median of this K means should be a not bad idea.

After there is theoretical guarantee it's not stupid. however you need to do the work to adapt your favorite method to the MOM's methodology (medians of mean) since it may not exist.