Forecast the Next H Steps for Time Series
Context
You are given one or more time series with timestamps and numeric targets (e.g., demand, returns, sensor values). Your task is to forecast the next H time steps. Some covariates may be available, including both observed-past features and known-future features (e.g., holidays, schedules, prices).
Requirements
-
Preprocessing
-
Resampling and alignment across all series and covariates
-
Timezone and DST handling
-
Missing-data imputation strategy (short vs. long gaps)
-
Outlier detection and treatment strategy
-
Detrending and seasonality decomposition
-
Scaling/normalization
-
Modeling (propose at least two approaches)
-
One classical (e.g., ARIMA/SARIMAX/ETS)
-
One deep learning (e.g., LSTM/TCN/Transformer)
-
Justify: loss choice (MAE/RMSE/Huber/Quantile), multi-step strategy (recursive/direct/multi-output), and how to incorporate covariates (holidays, known-future features)
-
Evaluation (non-leaky)
-
Walk-forward validation/backtesting protocol
-
Metrics: MAE, RMSE, sMAPE/MAPE, and quantile loss for P50/P90
-
Monitoring and maintenance
-
How to detect concept drift
-
How to recalibrate or retrain
-
Implementation
-
Provide concise pseudocode for training and inference