The Art and Science of Forecasting

Chapter 3

The Weather That Could Be Computed

Even exact equations forecast only as far as their starting point allows, and every series has structure to understand before forecasting it.

Four demonstrations follow the chapter: how tiny starting errors grow in Lorenz's equations, how a monthly value splits into trend, season and remainder, why a decomposition is redrawn when new data arrive, and how a spectrum finds a seasonal period.

Most examples are constructed teaching data, generated with a fixed seed so that every number matches the chapter notebook. Where a demonstration uses a real historical series, such as the annual flow of the Nile, it says so and names the source. Nothing here is a forecast of any real market, product or person.

Demonstration 1 of 4

Small initial differences become different futures

If two runs of the same deterministic equations start almost identically, how long do they agree?

The left panel overlays the reference run and the perturbed run; the right panel shows their difference on a logarithmic scale. The difference grows by multiplication, irregularly, until it is as large as the swings of x themselves, and from then on the two runs are unrelated.

Equation: the rate of change of x equals 10 times y minus x

Equation: the rate of change of y equals x times 28 minus z, minus y

Equation: the rate of change of z equals x times y minus 8 z over 3

Scroll sideways for the whole equation

x, y and z are the three variables of Lorenz's simplified convection model; t is dimensionless model time, not days. Only the starting x is changed, by 0.0001, 0.001 or 0.01.

Predict first. If the starting error shrinks from 0.01 to 0.001, ten times smaller, will the runs stay within 1 of each other ten times longer?

Your prediction

Choose an example

Scroll sideways for the whole figure

Figure: Small initial differences become different futures. Left: reference and perturbed Lorenz x, overlapping early and separating later. Right: their difference on a log scale, 0.452873 at time 20, crossing 1 at time 18.43.
Change in the starting x: 0.001, Lead time inspected: 20
Constructed data: the chapter notebook's Lorenz trajectories from start (1, 1, 1) with x perturbed, model time 0 to 30.

Calculated values

Initial change in x
0.001
Difference at time 20
0.452873
Factor of change
452.9
First time difference exceeds 1
18.43

Starting x was changed by 0.001. At model time 20 the two runs differ by 0.452873, so the error has changed by a factor of 0.452873 / 0.001 = 452.9. The runs first differ by more than 1 at time 18.43. Making the start ten times more accurate does not make the forecast ten times longer: from a change of 0.01 to 0.001 the useful lead grows only 18.43 - 16.77 = 1.66 model time units.

Worked steps

  1. Initial difference: 0.001.
  2. Difference at time 20: 0.452873.
  3. Factor: 0.452873 / 0.001 = 452.9.
  4. Difference first exceeds 1 at time 18.43.

Use the idea

Before promising a long horizon, ask how fast errors in today's starting point grow, and run several slightly different starting points, as ensemble forecasts do, instead of trusting one run.

Where the conclusion applies

A three-variable toy system solved numerically with tight tolerances, not an operational weather model. The growth is bounded by the system and irregular, not indefinite exponential growth.

Check your understanding: An error grows from 0.001 to 0.4529 by time 20. By what factor has it grown?
0.4529 / 0.001 = 452.9 times.

Chapter 3 source: section "II. The ENIAC Run and the Modern Era".

Demonstration 2 of 4

Trend, season and what is left

What is a single monthly number made of?

The left panel shows the observed series and its trend; the right panel the seasonal wave and the remainder. At the marked month the three estimates add to the observed value.

Equation: Y equals trend plus seasonal plus irregular

Scroll sideways for the whole equation

Y is the observed value, T the trend, S the seasonal component and I the irregular remainder, all in the series' own units. The components are estimated by robust STL with a 12 month period.

Predict first. Month 26 and month 38 are twelve months apart. Will their seasonal terms be nearly equal?

Your prediction

Choose an example

Scroll sideways for the whole figure

Figure: Trend, season and what is left. Two panels: the observed series with its rising trend, and the seasonal wave with the small remainder; month 26 is marked, trend 43.57, seasonal 4.84, remainder 0.92.
Month inspected: 26
Constructed data: the chapter notebook's seeded monthly series, 40 + 0.12 t plus a 12 month wave of amplitude 8 plus noise.

Calculated values

Observed Y
49.33
Trend T
43.57
Seasonal S
4.84
Remainder I
0.92

Month 26: 43.57 + 4.84 + 0.92 = 49.33. The trend says where the series stands, the seasonal term what the calendar adds this month, and the remainder what neither explains. The three estimates add back to the observation exactly, because the remainder is defined as what is left.

Worked steps

  1. Trend at month 26: 43.57.
  2. Seasonal term: 4.84.
  3. Remainder: 0.92.
  4. Sum: 43.57 + 4.84 + 0.92 = 49.33, the observed value.

Use the idea

Before forecasting a monthly series, decompose it: check whether the seasonal swing is constant (additive) or grows with the level (multiplicative), and how large the remainder is compared with the season.

Where the conclusion applies

An additive decomposition with a 12 month period; the seasonal swing here does not grow with the level, so additive is right. Trend and seasonality are estimates, not independently observed causes.

Check your understanding: A month has trend 58.20, seasonal term minus 6.40 and remainder 1.10. What was observed?
58.20 + (-6.40) + 1.10 = 52.90.

Chapter 3 source: section "IV. Time Series Structure as Methodology".

Demonstration 3 of 4

A decomposition redraws the past when new data arrive

Is last year's trend a fixed fact, or does it change when this year's data arrive?

Both trend lines are fitted to the same example series, one without its last months. They agree in the middle and part near the end of the shorter fit, where the estimate had only one side of the data.

Equation: the largest absolute difference between the trend fitted to all data and the trend fitted to the earlier data

Scroll sideways for the whole equation

T full is the STL trend fitted to all 144 months; T past is the trend fitted to the series without its last months; the maximum runs over the months both fits share.

Predict first. When the last 12 months are added, will the earlier trend move by less than 0.1 everywhere?

Your prediction

Choose an example

Scroll sideways for the whole figure

Figure: A decomposition redraws the past when new data arrive. The example series with two trend lines that agree in the middle and part near month 132; the largest gap, 0.8875, is marked at month 132.
Months withheld from the earlier fit: 12
Constructed data: the companion's seeded example series for this chapter; the 12 month comparison is the companion's own decomposition tool.

Calculated values

Months withheld
12
Largest trend revision
0.8875
At month
132
Trend then
51.564716
Trend now
52.452264

Fitting STL without the last 12 months and again with them changes the earlier trend by up to 0.8875, at month 132: 52.452264 - 51.564716 = 0.887548. A decomposition describes the past as seen from today; when new months arrive the past is redrawn, so full-series components must never be used as if they had been known at an earlier forecast origin.

Worked steps

  1. Fit with months 1 to 132 only.
  2. Fit again with all 144 months.
  3. Largest change in the earlier trend: 52.452264 - 51.564716 = 0.887548 at month 132.

Use the idea

When backtesting, refit any decomposition at every forecast origin using only data available then; the full-series components leak the future into the test.

Where the conclusion applies

Robust STL with a 12 month period on the companion's seeded example series. Real series with structural change can be revised far more; that is the chapter's point that components must be stable enough to measure.

What this does not settle

The chapter notes that decomposition assumes the components are stable enough to be detected and measured; trends that reverse without warning or seasons that shift discontinuously break that assumption, and this comparison only measures the ordinary revision of a stable series.

Chapter 3 source: "the components being separated are stable enough to be detected and measured".

Check your understanding: A trend estimated last year read 52.31 for a given month; refitted with this year's data it reads 52.93. What was the revision?
52.93 - 52.31 = 0.62.

Chapter 3 source: section "IV. Time Series Structure as Methodology".

Demonstration 4 of 4

The spectrum finds the season

Can you find a series' seasonal period without looking at a calendar?

The curve is the spectrum of the series after its trend is removed. A seasonal wave puts a sharp spike at its frequency; noise spreads low, uneven power across all frequencies.

Equation: the power at frequency f is the squared size of the Fourier sum of the detrended series

Scroll sideways for the whole equation

P(f) is the power at frequency f, in cycles per month; Y minus T is the series with its trend removed. A peak at frequency f means a repeating pattern of period 1 / f months.

Predict first. With the seasonal wave switched off (amplitude 0), will the spectrum still peak at 12 months?

Your prediction

Choose an example

Scroll sideways for the whole figure

Figure: The spectrum finds the season. Power spectrum of the detrended series with seasonal amplitude 8 and noise scale 1; the highest peak is at frequency 0.0833.
Seasonal wave amplitude: 8, Noise scale: 1
Constructed data: the chapter notebook's seeded monthly series (amplitude 8, noise scale 1 reproduce its printed dominant frequency 0.0833), with amplitude and noise varied.

Calculated values

Seasonal amplitude
8
Noise scale
1
Dominant frequency
0.0833
Period
12.0 months
Share of power at 12 months
0.878

The strongest frequency is 0.0833 cycles per month, a period of 1 / 0.0833 = 12.0 months, so the spectrum finds the 12 month season. The 12 month frequency holds 0.878 of the power left after the trend is removed.

Worked steps

  1. Remove the STL trend, take the spectrum.
  2. Highest peak at frequency 0.0833.
  3. Period: 1 / 0.0833 = 12.0 months.

Use the idea

Use a spectrum to confirm or discover seasonal periods, especially when several seasons overlap, before choosing a seasonal model.

Where the conclusion applies

The series and noise are the notebook's seeded example (seed 20260921), with the wave amplitude and noise scaled. A spectrum describes regular cycles; it says nothing about irregular business cycles or regime changes.

Check your understanding: A spectrum of weekly data peaks at 0.0192 cycles per week. What period does that suggest?
1 / 0.0192 = 52.1 weeks, about one year.

Chapter 3 source: section "IV. Time Series Structure as Methodology".