Time Series Decomposition

The previous post introduced the variety of structures a time series can carry. This one gets more concrete: how do we formally break a series into its components, and what does linear regression have to do with any of it? If you’re interested in learning about time seies decomposition, we’ll explore the basics and how it relates to these statistical methods.


The Decomposition Idea

A time series yโ‚œ can be thought of as the sum of three parts:

  • Tโ‚œ: the trend-cycle: the long-term direction of the series
  • Sโ‚œ: the seasonal component: the repeating calendar-driven pattern
  • Rโ‚œ: the remainder: what’s left after removing trend and seasonality

In the additive model, these combine as:

yt=Tt+St+Rty_t = T_t + S_t + R_t

In the multiplicative model:

yt=Ttร—Stร—Rty_t = T_t \times S_t \times R_t

The idea is simple: if you can separate these components, you can understand and model each one individually, and ideally, the remainder should be small and structureless.


Additive or Multiplicative?

The choice between the two models comes down to one question: do the seasonal swings stay the same size as the series grows, or do they scale with the level?

If the amplitude of the seasonal pattern is roughly constant over time, the additive model is appropriate. If it grows proportionally with the level, the multiplicative model fits better.

The J&J earnings series from the previous post is a clear example of a multiplicative case. The log transformation offers a practical bridge: if yโ‚œ = Tโ‚œ ร— Sโ‚œ ร— Rโ‚œ, then taking logs gives:

logโก(yt)=logโก(Tt)+logโก(St)+logโก(Rt)\log(y_t) = \log(T_t) + \log(S_t) + \log(R_t)

This converts a multiplicative structure into an additive one, so standard additive methods can apply.


How Do We Estimate the Components?

There are several approaches, and they get progressively more flexible:

Moving averages smooth out short-term fluctuations to extract the trend-cycle. The idea is to average a window of observations around each point, which suppresses the seasonal noise and leaves the underlying direction.

Classical decomposition extends this: estimate the trend via a moving average, subtract it, then average the seasonal residuals across years to get the seasonal component. Simple, but it assumes the seasonal pattern is fixed over time, which often isn’t true.

STL decomposition (Seasonal and Trend using Loess) is more flexible. It allows the seasonal component to change over time and is robust to outliers. This is generally the preferred approach for exploratory work.

Regression-based decomposition models trend and seasonality explicitly with equations, for example, fitting a linear trend and using dummy variables for months or quarters. This is where linear regression becomes directly relevant to time series work.


Why Review Linear Regression?

Regression is the foundation for modeling both trend and seasonality in a time series. A linear trend model takes the form:

yt=ฮฒ0+ฮฒ1t+ฯตty_t = \beta_0 + \beta_1 t + \epsilon_t

where t is just the time index. Seasonality can be added using indicator (dummy) variables, one for each month or quarter. External predictors like temperature, price, or holiday flags plug in as additional terms. And residual analysis, checking what the model missed, is the same diagnostic process whether you’re working with cross-sectional data or time series.


The Linear Regression Model

The general form is:

y=ฮฒ0+ฮฒ1x1+ฮฒ2x2+โ‹ฏ+ฮฒpxp+ฯตy = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \cdots + \beta_p x_p + \epsilon

Or in matrix notation: y = Xฮฒ + ฮต

The model says: the expected value of y is a linear function of the predictors. The ฮฒ coefficients tell you how much y changes per unit change in each x, holding the others fixed. ฮต is the error term; everything the model doesn’t capture.

The Four Assumptions

1. Linearity

The relationship between y and the predictors is linear in the parameters. This doesn’t mean the relationship has to look like a straight line; you can include xยฒ, log(x), or interaction terms, but the coefficients themselves must enter linearly. If the true relationship is fundamentally nonlinear and you haven’t accounted for it, the model will be systematically wrong in some regions of the data.

2. Independence of errors

The error terms ฮตแตข are independent of each other. In a standard cross-sectional setting, this is usually reasonable. In time series, it’s almost always violated: if the model underpredicts this month, it tends to underpredict next month too, because consecutive observations are correlated. This is why the ACF of residuals is such a useful diagnostic; it directly checks whether this assumption holds. When it doesn’t, ARIMA-type models for the residuals become necessary.

3. Normality

The errors follow a normal distribution: ฮตแตข ~ N(0, ฯƒยฒ). This assumption matters most for inference, constructing confidence intervals, and running hypothesis tests. For pure prediction, it matters less. In practice, you check this by plotting the distribution of residuals and looking for heavy tails or skew.

4. Constant variance (homoscedasticity)

The variance of the errors is the same across all observations: Var(ฮตแตข) = ฯƒยฒ for all i. If the variance grows with the level of y, larger values come with larger errors; the assumption is violated. This is called heteroscedasticity, and it’s common in economic and financial data. The log transformation is often the fix: it compresses large values relative to small ones and stabilizes the variance.

Log-transforming the response stabilizes the variance considerably. The same fix applies in time series contexts when multiplicative seasonality is present; a log transform makes the series amenable to additive decomposition and standard regression-based modelling.


Seasonally Adjusted Data

Once you have a decomposition, you can strip the seasonal component out of the original series. The result is called seasonally adjusted data:

  • Additive: ytโˆ’Sty_t – S_t
  • Multiplicative: yt/Sty_t / S_t

What remains is the trend-cycle plus the remainder, the non-seasonal variation.

Seasonally adjusted figures are everywhere in economic reporting. Monthly unemployment numbers are almost always published in seasonally adjusted form. The reason is straightforward: unemployment rises every June because school and university leavers flood the job market. That’s a predictable seasonal effect, not a signal about the economy. Removing it lets the underlying picture show through, whether the labour market is genuinely tightening or loosening, independent of the calendar.

One important caveat: seasonally adjusted data still contains the remainder component. It isn’t smooth. A short-term dip or rise in a seasonally adjusted series might just be noise, not a real turning point. If you’re trying to identify genuine changes in direction, the trend-cycle component alone, with both seasonality and remainder removed, gives a cleaner signal. The seasonally adjusted series is useful for communicating; the trend is useful for interpreting.

The next post takes decomposition from motivation to mechanics: how moving averages work, how classical decomposition is computed step by step, and what the remainder component tells you about what’s left to model.

Leave a Reply

Create a website or blog at WordPress.com

Up ↑