Start studying
Module 12 · Time Series Module contents
Module 12  ·  Card 8 / 13intermediate

Differencing

Differencing turns a series into the changes between consecutive values.

It removes a steady trend, because a steady rise becomes a roughly constant change.

For example, monthly users of 100, 110, 121 and 133 become changes of 10, 11 and 12.

Seasonal differencing subtracts the value from one season earlier, such as the same month last year.

Differencing once or twice usually makes a series stationary, but too much differencing adds noise.

Learn in depth ↓
Module 12 · Time Series · 13 concepts
In depth  /  15 lines

Differencing, in more detail

Differencing is the most common way to make a series stationary.

It shifts attention from the level of a series to how it changes.

Many models work far better on changes than on levels.

First differencing subtracts each value from the next, losing 1 value at the start.

A straight-line trend becomes a constant after 1 difference, which removes it.

A curved trend may need 2 differences, which are the changes in the changes.

Seasonal differencing subtracts the value 1 season back, such as 12 months for monthly data.

Seasonal and ordinary differencing can be combined for series with both trend and seasonality.

In pandas, the diff method does ordinary differencing, and diff(12) does yearly differencing of monthly data.

Differencing the logarithm of a series gives approximate percentage changes, which suits growing series.

Forecasts made on differences must be added back up to give forecasts of the original series.

Differencing too many times creates artificial negative autocorrelation and makes forecasts noisier.

Tests for stationarity, applied after each step, help decide when to stop.

In practice, 1 ordinary difference, sometimes with 1 seasonal one, is enough for most business series.

The usual mistake is forgetting to undo the differencing, then reporting forecasts of changes as forecasts of levels.

Test yourself

One question on this card. Every option explains itself once you pick, right or wrong.

Question 1
Monthly sales are 200, 220, 240 and 260. What does differencing once give?
Time Series

13 concepts in this module, then a graded test with every answer explained.

Study this module →
↑↓ move↵ openesc close