# How do quantile time series forecasts work?

My office leadership is interested adopting “quantile time series forecasting”, the idea is query the model to predict the 5th, 25th, 50th, 75th and 95th percentiles of an RV given features such as previous observations, covariates, etc.

My questions are about feasibility: Are there x independent models, one for each quantile? Where does the training data come from? (Ex: only x units were sold on day, t, so there is not an observed distribution…)

First off, quantile time series forecasting is of course closely related to quantile regression, so you may want to read up on this. One key ingredient is an error measure that elicits the conditional quantiles required, specifically the pinball loss, which is also known under other names. Note that this loss is a bit less intuitive than the MSE or the MAPE (boo! hiss!), so you may need to explain your results to your management with a little more care.

Are there x independent models, one for each quantile?

Yes indeed, at least in "standard" quantile forecasting. This may lead to "quantile crossing", i.e., that the quantile predictions $$\hat{y}_q$$ and $$\hat{y}_p$$ exhibit $$\hat{y}_q<\hat{y}_p$$ although $$q>p$$, since the models do not know about each other. You don't want that, so you may want to post-process the predictions across all quantiles of interest.

An alternative is to forecast full predictive densities (evaluated using proper scoring rules - note that Gneiting's papers pop up here as well as for the pinball loss), from which you can of course extract quantiles that do not exhibit crossing.

Where does the training data come from?

You just use the training data you have, using smart models and using the pinball loss. The idea is that with enough data, you have seen enough about the conditional variability to "have an idea" about the conditional distribution. Again, this is completely analogous to "non-time series" quantile regression.

And yes, this requires a lot of data to do usefully, especially for very high or low quantiles, so some kind of cross-learning or global model is likely helpful.

You may want to take a look at issue 38(4) of the International Journal of Forecasting, which was devoted to the M5 forecasting competition. Specifically, take a look at the uncertainty track, in which contestants had to predict multiple quantiles.

Alternatively, searching for "quantile" or "prediction interval" in standard forecasting textbooks should turn up some relevant hits.