Forecasting Strategies for Time Series in ETNA

Dmitry Bunin14 Feb 2023

Problem

Forecasting models that take the series' own past values (lags) as features are simple to apply one step ahead. Real decisions need a longer horizon: supplies can often be raised only some days after the decision, so the forecast must cover a span of days. Then the lags closest to the forecast day are not yet known, and the one-step algorithm no longer works. The team must pick a strategy, and each trades accuracy, consistency of the forecast and compute time differently.

Example from the article: forecasting apple demand when supplies can be increased only after three days, so sales are needed for days 11 to 13 and the lags lag_1 and lag_2 are unavailable.

Solution in brief

The article classifies multi-step strategies (recursive, direct, simplified direct, hybrid, vector, combined) by three properties: error accumulation, consistency between steps and number of models. It then runs the three strategies available in ETNA on one dataset of 366 monthly series and measures SMAPE and run time while varying the step and horizon_step parameters. More models and more iterations give lower SMAPE and a much longer run time.

Questions this case answers
  • How to produce multi-step forecasts from a model that takes the series' own past values as features, without accumulating error or paying for one model per step
  • How to choose between forecast accuracy and run time when the horizon is long and many series must be covered
  • How to forecast a time series several steps ahead when the model uses lags as features
  • How to choose between recursive, direct and hybrid multi-step forecasting strategies

Tools and methods

  • ETNA — forecasting library with Pipeline, AutoRegressivePipeline and DirectEnsemble for the three strategies
  • scikit-learn models — scalar-output regressors used inside the pipelines
  • Lag features — past values of the target as model inputs
  • Backtesting — rolling folds with symmetric mean absolute percentage error (SMAPE) as the metric
Continue reading — it's free

Google or a one-time email code. No password.