01 / 21

Time Series
Basics

Master the building blocks of trend, seasonality, and decomposition to unlock the stories hidden in data over time.

Business Analytics

What Is a Time Series?

A time series is a sequence of data points collected at equally spaced time intervals. Instead of looking at data as a static snapshot, we track how a variable changes over minutes, days, months, or years.

Ordered
Each observation has a specific position in time: the order matters.
Dependent
Adjacent observations are often correlated: today's value relates to yesterday's.
Measurable
Values are quantitative: sales revenue, temperature, stock prices.

Why Time Series Matters

Businesses rely on time series analysis for forecasting: predicting what comes next. From inventory planning to staffing decisions, understanding temporal patterns is a core analytics skill.

Retail
Forecast holiday demand to optimize inventory and avoid stockouts.
Finance
Analyze stock price movements to manage risk and spot trends.
Operations
Predict equipment failures by tracking sensor readings over time.

The Four Components

Every time series can be understood as a combination of four underlying components. Recognizing each one is the first step to decomposition.

Trend \( T_t \)
The long-term upward or downward movement in the data.
Seasonality \( S_t \)
Regular, repeating patterns tied to calendar periods.
Cyclical \( C_t \)
Longer fluctuations not fixed to a calendar (e.g., business cycles).
Residual \( R_t \)
Random noise left over after removing trend, seasonality, and cycles.

Visualizing the Components

Time (months) Observed Trend Seasonal Residual

The Decomposition Model

Decomposition separates a time series into its components so each can be analyzed independently. There are two classical models:

Additive
Components add together. Seasonal swings stay roughly constant in size over time.
Multiplicative
Components multiply together. Seasonal swings grow proportionally with the trend.

Additive vs Multiplicative

Additive Constant amplitude Multiplicative Shrinking amplitude

Understanding Trend

The trend component \( T_t \) captures the long-run direction. It filters out short-term noise and reveals whether the series is increasing, decreasing, or flat over time.

Trend Raw data Time

Understanding Seasonality

Seasonality \( S_t \) is a fixed, repeating pattern within a known period: daily, weekly, quarterly, or yearly. Unlike cycles, seasonal patterns have a predictable length.

Year 1 Year 2 Year 3 Year 4 0

Trend vs Seasonality vs Cycle

Trend Seasonality Cycle
Direction Upward, downward, or flat Oscillates around zero Oscillates around zero
Period No fixed period Fixed and known Variable and unknown
Duration Long-term Repeats within a fixed, known period Usually > 1 year
Example GDP growth over decades Holiday retail spikes Boom-bust business cycles
Predictability Moderate High Low

How to Decompose a Time Series

1
Plot the raw data. Inspect visually for trend direction and seasonal patterns.
2
Choose additive or multiplicative. Constant seasonal swings: additive. Growing swings: multiplicative.
3
Estimate the trend \( T_t \) using a centered moving average of order equal to the seasonal period.
4
Remove the trend. Additive: \( Y_t - T_t \). Multiplicative: \( Y_t / T_t \).
5
Average by season to find seasonal indices \( S_t \). Adjust so they sum to zero (or average to 1).
6
Compute residuals: \( R_t = Y_t - T_t - S_t \) (additive) or \( R_t = Y_t / (T_t \times S_t) \) (multiplicative).

Example 1: Reading the Data

A coffee shop tracks monthly sales (in thousands of dollars) over 2 years. Let's identify the components visually.

Month Sales ($K) 10 15 20 25 Trend Year 1 Year 2

Example 2: Moving Average

Quarterly revenue data: \( Y = [20, 35, 25, 30, 22, 38, 28, 33] \). Compute a 4-quarter centered moving average for \( T_3 \) through \( T_6 \).

1
First 4-point average: \( \frac{20+35+25+30}{4} = 27.5 \) (centered between \( t=2 \) and \( t=3 \))
2
Second 4-point average: \( \frac{35+25+30+22}{4} = 28.0 \) (centered between \( t=3 \) and \( t=4 \))
3
Centered value at \( t=3 \): \( T_3 = \frac{27.5 + 28.0}{2} = 27.75 \)

Example 3: Seasonal Indices

Suppose after removing the trend from a quarterly sales dataset, we average the detrended values by quarter to get seasonal indices.

Quarter Q1 (Jan-Mar) Q2 (Apr-Jun) Q3 (Jul-Sep) Q4 (Oct-Dec)
\( Y_t - T_t \) (Year 1) \(-1.2\) \(-2.8\) \(+3.1\) \(+0.9\)
\( Y_t - T_t \) (Year 2) \(-1.0\) \(-3.0\) \(+3.3\) \(+0.7\)
Seasonal Index \( S_j \) \(-1.1\) \(-2.9\) \(+3.2\) \(+0.8\)

The Residual Component

After extracting trend and seasonality, the residual \( R_t \) should look like random noise: no patterns, no trend, centered near zero. If patterns remain, the decomposition is incomplete.

0 Time Residuals

Common Mistakes

✕ Wrong Model Choice
Using an additive model when seasonal swings grow with the level. Always plot the data first to check.
✕ Confusing Cycle and Season
Calling a business cycle "seasonal." Seasonality has a fixed, known period; cycles do not.
✕ Ignoring Residual Patterns
Assuming decomposition is done without checking residuals. Patterns in residuals mean missing components.

Question 1 of 5

In the additive decomposition model, the observed value \( Y_t \) is expressed as:

Question 2 of 5

A retail store's sales show seasonal peaks during the holidays that have been getting larger each year as overall sales grow. Which decomposition model is most appropriate?

Question 3 of 5

What distinguishes seasonality from a cyclical pattern in a time series?

Question 4 of 5

Given quarterly data, you compute a 4-quarter centered moving average. How many observations are lost at each end of the series?

Question 5 of 5

After decomposing a time series, you plot the residuals and notice a clear upward trend. What does this indicate?