Simple exponential smoothing

Today let's understand simple exponential smoothing, a way to forecast a series that has no steady climb, fall, or repeating season, using nothing more than the series' own past values.

Take Algeria's exports of goods and services, recorded by the World Bank as a percent of the country's GDP, one value a year from 1960 to 2017. Here are all 58 years of it, plotted in order.

Look at that shape. It swings between about 13 and 49 percent of GDP again and again across almost six decades, but it never settles into a steady rise or fall, and it never repeats a fixed calendar pattern. That is exactly the kind of series simple exponential smoothing forecasts.

The best guess when a series has no trend to follow

Suppose you had to guess next year's export percentage using nothing but these 58 years. Two answers come to mind immediately, and both are worth checking.

The first is to just repeat the last value, 22.64 from 2017. But that throws away every year before it, even though those 57 years still hold real information about how this series tends to move.

The second is to average all 58 years and use that number every time. That is wrong in a different way: it treats 1960 and 2017 as equally relevant to a forecast for 2018, when the recent years are clearly the better guide to what happens next.

Build Algeria's 58 years of exports as a tsibble, a tidyverse table indexed by time, then compute the two candidates side by side.

RInteractive R
# Build Algeria's 58 years of exports as a tsibble, then compare the last value against the plain average library(tsibble) library(tsibbledata) library(dplyr) library(fable) library(fabletools) alg <- tsibbledata::global_economy |> filter(Country == "Algeria") |> select(Country, Year, Exports) last_value <- alg$Exports[alg$Year == 2017] plain_average <- mean(alg$Exports) round(c(last_value = last_value, plain_average = plain_average), 2) #> last_value plain_average #> 22.64 29.56

  

The two candidates sit far apart, and neither one uses the data well. Simple exponential smoothing sits between them: it uses every one of the 58 years, but it does not weigh them all the same. Recent years count for more, and older years count for less.