## 3.2 Time series components

If we assume an additive decomposition, then we can write \[ y_{t} = S_{t} + T_{t} + R_t, \] where \(y_{t}\) is the data, \(S_{t}\) is the seasonal component, \(T_{t}\) is the trend-cycle component, and \(R_t\) is the remainder component, all at period \(t\). Alternatively, a multiplicative decomposition would be written as \[ y_{t} = S_{t} \times T_{t} \times R_t. \]

The additive decomposition is the most appropriate if the magnitude of the seasonal fluctuations, or the variation around the trend-cycle, does not vary with the level of the time series. When the variation in the seasonal pattern, or the variation around the trend-cycle, appears to be proportional to the level of the time series, then a multiplicative decomposition is more appropriate. Multiplicative decompositions are common with economic time series.

An alternative to using a multiplicative decomposition is to first transform the data until the variation in the series appears to be stable over time, then use an additive decomposition. When a log transformation has been used, this is equivalent to using a multiplicative decomposition because \[ y_{t} = S_{t} \times T_{t} \times R_t \quad\text{is equivalent to}\quad \log y_{t} = \log S_{t} + \log T_{t} + \log R_t. \]

### Employment in the US retail sector

We will look at several methods for obtaining the components \(S_{t}\), \(T_{t}\) and \(R_{t}\) later in this chapter, but first it is helpful to see an example. We will decompose the number of persons employed in retail as shown in Figure 3.2. The data shows the total monthly number of persons in thousands employed in the retail sector across the US since 1990.

```
<- us_employment %>%
us_retail_employment filter(year(Month) >= 1990, Title == "Retail Trade") %>%
select(-Series_ID)
%>%
us_retail_employment autoplot(Employed) +
xlab("Year") + ylab("Persons (thousands)") +
ggtitle("Total employment in US retail")
```

To illustrate the ideas, we will use the STL decomposition method, which is discussed in Section 3.7.

```
<- us_retail_employment %>%
dcmp model(STL(Employed))
components(dcmp)
#> # A dable: 357 x 7 [1M]
#> # Key: .model [1]
#> # STL Decomposition: Employed = trend + season_year + remainder
#> .model Month Employed trend season_year remainder season_adjust
#> <chr> <mth> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 STL(Employed) 1990 Jan 13256. 13291. -38.1 3.08 13294.
#> 2 STL(Employed) 1990 Feb 12966. 13272. -261. -44.2 13227.
#> 3 STL(Employed) 1990 Mar 12938. 13252. -291. -23.0 13229.
#> 4 STL(Employed) 1990 Apr 13012. 13233. -221. 0.0892 13233.
#> 5 STL(Employed) 1990 May 13108. 13213. -115. 9.98 13223.
#> 6 STL(Employed) 1990 Jun 13183. 13193. -25.6 15.7 13208.
#> 7 STL(Employed) 1990 Jul 13170. 13173. -24.4 22.0 13194.
#> 8 STL(Employed) 1990 Aug 13160. 13152. -11.8 19.5 13171.
#> 9 STL(Employed) 1990 Sep 13113. 13131. -43.4 25.7 13157.
#> 10 STL(Employed) 1990 Oct 13185. 13110. 62.5 12.3 13123.
#> # … with 347 more rows
```

The output above shows the components of an STL decomposition. The original data is shown (as `Employed`

), followed by the estimated components. This output forms a “dable” or decomposition table. The header to the table shows that the `Employed`

series has been decomposed additively.

The `trend`

column (containing the trend-cycle \(T_t\)) follows the overall movement of the series, ignoring any seasonality and random fluctuations, as shown in Figure 3.3.

```
%>%
us_retail_employment autoplot(Employed, color='gray') +
autolayer(components(dcmp), trend, color='red') +
xlab("Year") + ylab("Persons (thousands)") +
ggtitle("Total employment in US retail")
```

We can plot all of the components in a single figure using `autoplot()`

, as shown in Figure 3.4.

`components(dcmp) %>% autoplot() + xlab("Year")`

The three components are shown separately in the bottom three panels of Figure 3.4. These components can be added together to reconstruct the data shown in the top panel. Notice that the seasonal component changes over time, so that any two consecutive years have similar patterns, but years far apart may have different seasonal patterns. The remainder component shown in the bottom panel is what is left over when the seasonal and trend-cycle components have been subtracted from the data.

The grey bars to the left of each panel show the relative scales of the components. Each grey bar represents the same length but because the plots are on different scales, the bars vary in size. The large grey bar in the bottom panel shows that the variation in the remainder component is smallest compared to the variation in the data, which has a bar about one quarter the size. If we shrunk the bottom three panels until their bars became the same size as that in the data panel, then all the panels would be on the same scale.

### Seasonally adjusted data

If the seasonal component is removed from the original data, the resulting values are the “seasonally adjusted” data. For an additive decomposition, the seasonally adjusted data are given by \(y_{t}-S_{t}\), and for multiplicative data, the seasonally adjusted values are obtained using \(y_{t}/S_{t}\).

Figure 3.5 shows the seasonally adjusted number of persons employed.

```
%>%
us_retail_employment autoplot(Employed, color='gray') +
autolayer(components(dcmp), season_adjust, color='blue') +
xlab("Year") + ylab("Persons (thousands)") +
ggtitle("Total employment in US retail")
```

If the variation due to seasonality is not of primary interest, the seasonally adjusted series can be useful. For example, monthly unemployment data are usually seasonally adjusted in order to highlight variation due to the underlying state of the economy rather than the seasonal variation. An increase in unemployment due to school leavers seeking work is seasonal variation, while an increase in unemployment due to an economic recession is non-seasonal. Most economic analysts who study unemployment data are more interested in the non-seasonal variation. Consequently, employment data (and many other economic series) are usually seasonally adjusted.

Seasonally adjusted series contain the remainder component as well as the trend-cycle. Therefore, they are not “smooth,” and “downturns” or “upturns” can be misleading. If the purpose is to look for turning points in a series, and interpret any changes in direction, then it is better to use the trend-cycle component rather than the seasonally adjusted data.