The quantile regression a type of regression (i.e. forecast) that introduces

The notion of quantile regression is a relatively advance statistical topic, the goal of this article is not to go into a rigorous treatment of this subject, but rather to give a (relatively) intuitive introduction to the subject for practitioners in retail or manufacturing.

The graph above illustrates 3 distinct forecasts:

- in red, a 75% quantile forecasts.
- in black, a mean forecast.
- in green, a 25% quantile forecasts.

Visually, quantiles behaves pretty much like confidence intervals. However, in practice, the quantile is only needed for a single target percentage.

Although having a *unbiased* forecast is a desirable property, it does not tell anything about the *accuracy* of the forecast. In particular, a forecast can both unbiased yet widely inaccurate. The bias only refers to the propensity of the forecasting model to over or under estimate the future.

A first refinement of this vision is the

At this point, we have already shifted the notion of

According to the US Census Bureau, in 2004, the median household income was $44,389 while the same year the mean (average) income was $60,528, nearly 40% higher than the median.

This discrepancy is explained by the high incomes (comparatively) of the richest US household compared to the rest of the population. Such discrepancy between mean and median will be found in all distributions that are not symmetric, typically all distributions that do not follow a normal distribution.

Quantiles represents a

- the
**period**, such as day, week or month. - the
**horizon**, an integer representing the number of periods to be forecast.

Implicitly, the time-series is aggregated according to the

However,

Let's illustrate why quantile can't be summed. Let's a assume that we have a gambler playing one $1 coin into a slot machine each week. Let's assume that the odds of winning are of 1% for a prize of $50 and zero otherwise. If we look at the 99% quantile of the expected reward, we have a weekly reward of $50 *every week*. However, if we look at the 99% quantile over two weeks, the expected reward is still equal to $50. Indeed, the probability of winning twice is only 0,01% (1% multiplied by 1%), hence the 99% quantile is left unchanged. Summing the two 99% weekly quantile would give $100, but in reality it takes 16 weeks to accumulate $100 of gain for the 99% quantile (the proof for this numerical result is not given as it would go beyond the scope of this article).

Since quantile forecasts cannot be summed, quantile time-series forecasts need to

Thus, the

- τ the targeted
**quantile**, a percentage. - λ the
**horizon**expressing a duration (typically in days).

For example, if the time-series represent the sales of a product A, and we have the settings τ=0.90 and λ=14 days, then the quantile forecast (τ, λ) will return the demand value that has exactly 90% chance of being larger than the total demand observed over 14 days (respectively 10% chance of being lower than the demand over the same 14 days).

Contrary to classic forecasts, quantile forecasts are producing

- Reorder point, how quantiles apply to inventory optimization.
- Pinball loss function, how to measure the accuracy of a quantile forecast.
- Roger Koenker, Kevin F. Hallock, (2001) Quantile Regression, Journal of Economic Perspectives, 15 (4), 143–156
- Ichiro Takeuchi, Quoc V. Le, Timothy D. Sears, Alexander J. Smola, (2006), Nonparametric Quantile Estimation, Journal of Machine Learning Research 7 1231–1264