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.

FieldMeaning
lookback windowhow much past context the model sees
forecast origin time at which prediction is issued
horizon how far ahead the model predicts
target frequencyhourly, daily, event-based, irregular
known future covariatescalendar, planned intervention, schedule
unknown future covariatesmeasurements 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.

ReportWhy
per-horizon metricshort and long horizon errors differ
aggregate metricgives one summary number
baseline comparisonpersistence/seasonal baseline can be strong
rolling-origin evaluationtests repeated deployment-like forecasts

Leakage Patterns

LeakageExample
random splitfuture points from same series appear in train
global normalizationscaler fit on full time range
future covariateusing measurement not known at forecast time
target-derived featurerolling statistic computed with future values
backfilled labelscorrection 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?