Time Series Part 5 - Practical Forecasting

Category: Time Series

Time Series Part 5 - Practical Forecasting

So far, we have looked at time series patterns, simple models, and ARIMA-style models. In real projects, you also need to know how to test your model honestly, how far ahead to predict, and what to do when you need more power than classical statistics. This part covers those practical pieces in plain English.


1. White noise — what is left when nothing is left to explain

A white noise series is one where the values are completely unpredictable. There is no trend, no seasonality, no pattern. Each value is just a random shock that is unrelated to the past.

White noise:    .  .    .      .   .     . .      .      .
                .   .      . .      .   .    .  .      . .

The TV-static analogy

Think of an old television tuned to a dead channel. The black-and-white speckles on the screen are white noise. They are random, they flicker, and knowing what the screen looked like one second ago does not help you predict the next pattern of speckles.

A good forecast model should leave only white noise in its residuals. If the residuals still show a pattern, your model has missed something.

Why it matters

  • If the residuals are white noise, you have captured everything predictable.
  • If the residuals still have a trend or seasonality, you need a better model.
  • Many statistical tests assume the errors are white noise.

Quick check

A simple check is to look at the ACF of the residuals. In white noise, all ACF values are close to zero.


2. Forecast horizon — how far ahead are you looking?

The forecast horizon is the number of future steps you want to predict.

  • h = 1 means one-step-ahead forecast.
  • h = 12 means twelve-steps-ahead forecast.

The headlights analogy

Driving at night, your headlights only light up the road a certain distance ahead. The road beyond is dark. Forecasting is the same: the further ahead you look, the more uncertain your forecast becomes.

Horizon Easy or hard When to use
h = 1 Easiest Inventory for tomorrow, stock trading signals
h = 5 Moderate Weekly planning, short-term staffing
h = 12 Harder Quarterly budgeting, monthly demand planning
h = 24 Very hard Long-term strategy, annual forecasting

A model can be excellent at h = 1 and terrible at h = 24. Always report the horizon when you compare models.


3. Rolling window and walk-forward validation

In normal machine learning, you can shuffle the data, split it, and test it. In time series, you cannot shuffle, because the order of time matters.

The diary analogy

Imagine you are writing a diary. You cannot use page 50 to predict page 30, because page 50 has not happened yet. A fair test for a time series model must always train on the past and test on the future.

Walk-forward validation

Walk-forward validation is the time-series version of cross-validation.

  1. Start with a small training window in the past.
  2. Predict the next step.
  3. Add that step to the training window.
  4. Predict the next step after that.
  5. Repeat until you reach the end of the data.
Step 1: [train]████████[test]------------------------------
Step 2: --[train]████████[test]----------------------------
Step 3: ----[train]████████[test]--------------------------

The model always trains on older data and is tested on the newest available data. This is the safest way to measure real forecast performance.

The walk-forward testing strategy

For each test point, you can also test different horizons:

  • Walk forward one step, forecast h = 1.
  • Walk forward one step, forecast h = 12.
  • Compare the errors for each horizon separately.

4. Forecast interval — giving a range, not just a number

A point forecast gives you one number: “Next month’s sales will be 1,000 units.”

A forecast interval gives you a range: “Next month’s sales will be between 900 and 1,100 units, with 95% confidence.”

The weather app analogy

A weather app does not usually say, “It will be exactly 23 degrees tomorrow.” It says, “23 degrees, feels like 21, with a possible low of 19 and a high of 25.” That range is a forecast interval.

Why intervals matter

Point forecasts are easy to show, but business decisions need risk. If you are planning inventory, you care more about the worst-case number than the average number.

How they are built

Most forecast intervals come from the model’s errors. If the model’s past errors are usually plus or minus 50 units, the 95% interval for a point forecast of 1,000 might be roughly 1000 ± 2 × 50 = [900, 1100].

More advanced models, like SARIMAX and neural networks, can compute intervals directly from the model structure.


5. Deep learning for time series

When the series is very complex, classical models may not capture all the patterns. Deep learning models can remember long sequences and learn complicated interactions.

LSTM — the diary with two notebooks

An LSTM is like keeping two notebooks while you read a time series:

  • One notebook is your working memory. It only holds what you are thinking about right now.
  • One notebook is your long-term memory. It holds important patterns you noticed a long time ago.

When a new value arrives, the LSTM decides:

  1. Forget something from long-term memory if it is no longer useful.
  2. Write something new into long-term memory if it is important.
  3. Read from long-term memory to make a prediction.

Use LSTM when the series has long dependencies, like remembering a pattern from many months ago.

GRU — the lighter version of LSTM

A GRU does the same job as an LSTM but with only one notebook instead of two. It is faster to train and needs less data.

  • Use LSTM if you have a lot of data and very long sequences.
  • Use GRU if you want a similar model but with fewer parameters.

Transformer — the all-to-all meeting

A Transformer does not read the series one step at a time. Instead, it looks at all time steps at once and uses attention to decide which past values matter most for the next prediction.

Imagine a meeting where every team member can instantly ask any other member for information. The Transformer does the same thing for time steps.

  • Use Transformers when you have a lot of data and want to capture complex relationships across the whole series.

Temporal Fusion Transformer (TFT) — the project manager

The Temporal Fusion Transformer is like a project manager who listens to different experts:

  • Recent events: what happened in the last few time steps?
  • Long-term patterns: what are the seasonal and trend patterns?
  • Known future inputs: are there holidays or promotions coming?

The TFT then decides which expert to listen to for each prediction. It also explains which inputs are important, which is useful for business decisions.

Use TFT when you have many types of inputs: past values, known future events, and other variables that might affect the target.

When to use classical vs deep learning

Situation Start with Try if that fails
Small dataset, clear seasonality ARIMA / SARIMA LSTM / GRU
Long history, complex patterns ARIMA with care Transformer / TFT
Many related variables SARIMAX, VAR TFT
Need interpretability ARIMA, exponential smoothing TFT (has attention weights)
Very long sequences Classical or feature engineering Transformer

6. One-sentence takeaways

  • White noise means there is nothing left to predict.
  • Forecast horizon is how far into the future you are looking.
  • Walk-forward validation tests a model the way it will actually be used: train on the past, predict the future.
  • Forecast intervals give a useful range, not just one number.
  • LSTM, GRU, Transformer and TFT are the deep-learning toolkit for complex, long, or multi-source time series.