Time-Series Forecasting
Time-series forecasting predicts future values from past observations. The input is ordered by time, and evaluation must respect temporal causality.
For a sequence , a forecasting model predicts a future horizon:
where is the forecast horizon and represents optional covariates such as calendar features, conditions, interventions, or external signals.
The supervised loss for a horizon can be:
Forecasting Contract
Forecasting is defined by when the prediction is made and what information is available at that time.
| Field | Meaning |
|---|---|
| lookback window | how much past context the model sees |
| forecast origin | time at which prediction is issued |
| horizon | how far ahead the model predicts |
| target frequency | hourly, daily, event-based, irregular |
| known future covariates | calendar, planned intervention, schedule |
| unknown future covariates | measurements unavailable at prediction time |
If a covariate is only observed after the forecast origin, using it as input is temporal leakage.
Evaluation by Horizon
An average score can hide horizon-specific behavior.
| Report | Why |
|---|---|
| per-horizon metric | short and long horizon errors differ |
| aggregate metric | gives one summary number |
| baseline comparison | persistence/seasonal baseline can be strong |
| rolling-origin evaluation | tests repeated deployment-like forecasts |
Leakage Patterns
| Leakage | Example |
|---|---|
| random split | future points from same series appear in train |
| global normalization | scaler fit on full time range |
| future covariate | using measurement not known at forecast time |
| target-derived feature | rolling statistic computed with future values |
| backfilled labels | correction from future data enters training input |
Key Ideas
- Forecasting differs from generic regression because training and evaluation must preserve time order.
- Short-horizon and long-horizon forecasts can require different models and metrics.
- Covariates may be known in advance, observed only in the past, or unavailable at deployment.
- Autoregressive rollouts can accumulate error when predictions feed future inputs.
- Temporal leakage is common when preprocessing or split construction uses future information.
Practical Checks
- What is the forecast horizon?
- Are splits chronological rather than randomly shuffled?
- Are all covariates available at prediction time?
- Is performance reported per horizon or only averaged?
- Does the baseline include persistence, seasonal, or simple statistical forecasts?
- Are normalization and feature computation fit only on past/train data?
- Does the evaluation simulate the actual forecast origin?