LU9 Lecture Notes

📚 LU9 Lecture Notes_5927bb2f90765bea021a57af5a93d3fa.pdf

Brief overview

This document provides an introduction to time series analysis, focusing on identifying patterns and forecasting future values from data collected over regular intervals. It explains the fundamental components influencing time series and their decomposition for modeling and prediction.

Key points

  • Introduction to time series data and its four core components: trend, cycles, seasonal, and irregular variations.
  • Decomposition methods, including the multiplicative model (Y = T × S × I), for isolating and understanding time series components.
  • Techniques for trend estimation using moving averages and linear regression.
  • The ratio-to-moving average method for calculating and applying seasonal indices in analysis and forecasting.
  • How to build a forecasting model by combining estimated trend and seasonal components.

1. Introduction to time series analysis

1.1 What is time series analysis?

  • A time series is data collected over time at regular intervals.
  • Examples include daily stock prices or monthly sales figures.
  • Time series analysis aims to find patterns and predict future values 2.

📝 Example: Monthly rainfall data collected over many years.

1.2 Components of a time series

Time series data are influenced by four main forces:

  • Trend (T): The long-term direction (up or down) of the data.
  • Cycles (C): Changes linked to economic activity. (Note: Not covered in detail for this module.)
  • Seasonal variations (S): Predictable patterns repeating at fixed intervals, often tied to the calendar (e.g., daily, monthly).
  • Irregular variations (I): Unpredictable events or random fluctuations 3.

1.2.1 Identifying components in data

Different time series show combinations of these components.

  • Bicycle sales might have a steady trend and random noise.
  • Bread sales could show an increasing trend with random ups and downs.
  • Hot water bottle sales might decrease over time and show seasonal peaks.
  • Car sales often have an upward trend, seasonality, and random effects 4 5 6 7.

📝 Example: Quarterly car sales can show growth over years (trend), specific peaks in certain seasons (seasonal), and unexpected drops due to events (irregular).

🔑 Important: Understanding these components is key to modeling and forecasting time series data.

🔑 Important: A time series can be influenced by one or more of these four components acting together.

2. Decomposition and modeling of time series

2.1 Introduction to the multiplicative time series model

  • The multiplicative model describes how time series components combine: Y=T×S×IY = T \times S \times I.

  • Components represent:

  • Trend (T): The long-term direction of the data, in the same units as Y.

  • Seasonality (S): Recurring patterns within a fixed period (e.g., year), expressed as percentages ( > 100 is above average, < 100 is below average).

  • Irregular (I): Unpredictable, random fluctuations; these are not modeled.

  • Decomposition isolates and models trend and seasonality separately.

  • The forecasting model uses estimated components: Y^=T^×S^\hat{Y} = \hat{T} \times \hat{S}.

2.2 Steps in decomposition analysis

  1. Estimate the trend component using regression.
  2. Estimate the seasonal component using the ratio-to-moving average method.
  3. Forecast future values by combining trend and seasonal estimates.

2.3 Moving averages for smoothing

  • A moving average (MAV) smooths short-term fluctuations by averaging kk successive observations.
  • The value of kk usually matches the number of seasons in the time series.
  • Each time period's value is replaced by its MAV, creating a smoothed series.
  • MAV values must be centered on a middle time period.

2.3.1 Moving averages for odd kk

  • Calculate the MAV by averaging kk consecutive data points.
  • There is a loss of data at the beginning and end of the series.
  • Example for k=3k=3: MAVt=(Yt−1+Yt+Yt+1)/3MAV_t = (Y_{t-1} + Y_t + Y_{t+1}) / 3 17.

2.3.2 Moving averages for even kk

  • First, calculate the MAV of kk values.
  • Then, average two successive MAV values to center them, creating a centered moving average (CMAV) 18.
  • Example for k=4k=4:
  • MAVt.5=(Yt−1+Yt+Yt+1+Yt+2)/4MAV_{t.5} = (Y_{t-1} + Y_t + Y_{t+1} + Y_{t+2}) / 4.
  • CMAVt=(MAVt−0.5+MAVt+0.5)/2CMAV_t = (MAV_{t-0.5} + MAV_{t+0.5}) / 2 19.

2.3.3 Calculating MAV/CMAV for a specific period

  • For odd kk: Calculate the MAV directly. For k=3k=3 and time period t=4t=4, MAV4=(Y3+Y4+Y5)/3MAV_4 = (Y_3 + Y_4 + Y_5) / 3.
  • For even kk: Calculate two adjacent MAVs and then average them for the CMAV. For k=4k=4 and time period t=3t=3, CMAV3=(MAV2.5+MAV3.5)/2CMAV_3 = (MAV_{2.5} + MAV_{3.5}) / 2.

📝 Example: To find the MAV for Year 2, Term 1 (t=4t=4) with k=3k=3: MAV4=(60+62+100)/3=74MAV_4 = (60 + 62 + 100) / 3 = 74 20.

📝 Example: To find the CMAV for Year 1, Quarter 3 (t=3t=3) with k=4k=4: First, MAV2.5=(4+7+12+9)/4=8MAV_{2.5} = (4 + 7 + 12 + 9) / 4 = 8. Then, MAV3.5=(7+12+9+8)/4=9MAV_{3.5} = (7 + 12 + 9 + 8) / 4 = 9. Finally, CMAV3=(8+9)/2=8.5CMAV_3 = (8 + 9) / 2 = 8.5 21.

2.4 Estimating the trend component

  • The trend (T^\hat{T}) is estimated by removing the seasonal component.
  • This can be done via least squares regression (straight-line trend) or moving averages (smooth curve).

2.4.1 Trend estimation using linear regression

  • Use least squares regression to model YY on time (XX).
  • The dependent variable is YY (observed data).
  • The independent variable is XX (time index, x=1,2,3,…,nx = 1, 2, 3, \dots, n).
  • The estimated trend component is given by: T^=a+bX\hat{T} = a + bX, where aa is the intercept and bb is the slope.
  • An example regression model for trend is: T^=127.71+7.54X\hat{T} = 127.71 + 7.54X 24.

🔑 Important: Linear regression provides a straight-line trend, while moving averages can create a smoother, curved trend 23.

🔑 Important: Decomposition analysis focuses on modeling trend and seasonality, treating irregular fluctuations as unpredictable noise 8 9.

🔑 Important: Moving averages smooth data; the method differs for odd (MAVMAV) versus even (CMAVCMAV) seasonal periods 16.

3. Seasonal analysis and forecasting

3.1 The ratio-to-moving average method

This method models the seasonal component of a time series. It first estimates the trend and then removes it.

This process leaves the seasonal and irregular components. These remaining parts are used to calculate seasonal indices.

The overall goal is to break down a time series, YY, into its trend (TT), seasonal (SS), and irregular (II) components. The multiplicative model assumes Y=T×S×IY = T \times S \times I.

3.1.1 Step 1: Initial trend estimate

The first step is to find an initial estimate of the trend. This is done using moving averages (MAV) or centered moving averages (CMAV).

A moving average smooths out fluctuations in the data. A centered moving average is used to align the average with the original time points.

Calculations for moving average:

  • MAV: Sum of values over a period divided by the number of periods. For a 2-period MAV, it's (Yt+Yt+1)/2(Y_t + Y_{t+1})/2.
  • CMAV: Average of two consecutive MAVs. For CMAV at time tt, it's (MAVt−0.5+MAVt+0.5)/2(MAV_{t-0.5} + MAV_{t+0.5})/2 26.

This initial trend estimate is then plotted against the original time series to visualize its smoothing effect 27.

3.1.2 Step 2: Calculate seasonal ratios

Seasonal ratios are calculated by dividing the observed time series value (YY) by its corresponding centered moving average (CMAV). This ratio isolates the seasonal and irregular components (S×IS \times I).

The formula for a seasonal ratio (SR) is: SR=YCMAV×100SR = \frac{Y}{CMAV} \times 100 Multiplying by 100 expresses the ratio as an index, where 100 represents the average seasonal effect 28.

These seasonal ratios are then plotted to observe their patterns over time 30.

Example calculation:

  • For time t=2t=2: SR2=(196/147.3)×100=133.1SR_2 = (196 / 147.3) \times 100 = 133.1 29.

3.1.3 Step 3: Find median/unadjusted seasonal indices

This step aims to represent the typical seasonal effect for each period. The median is preferred because it is robust to extreme values (outliers).

The process involves:

  1. Sorting all calculated seasonal ratios for each specific season (e.g., all 'Cooler' ratios together).
  2. Finding the median of these sorted ratios for each season.
  • Median for odd kk values: The middle value in the sorted list.
  • Median for even kk values: The average of the two middle values.

These medians are the unadjusted seasonal indices.

Example calculation (assuming 2 seasons: Cooler, Warmer):

  • Sorted Cooler ratios: 66.5, 67.9, 135.5
  • Median Cooler: 67.9 (Correction: the document shows 67.2, likely from a different example set than listed on page 29. Using the provided example on page 32).
  • Sorted Warmer ratios: 132.9, 133.1, 135.5
  • Median Warmer: 133.1 (Correction: the document shows 133.1. However, page 32 example shows 133.1. Using the provided example on page 32) 31.

📝 Example: Unadjusted index for Cooler = (67.9+66.5)/2=67.2(67.9 + 66.5) / 2 = 67.2. Unadjusted index for Warmer = 133.1133.1 32.

3.1.4 Step 4: Calculate adjusted seasonal indices

The sum of the unadjusted seasonal indices must equal k×100k \times 100, where kk is the number of seasons. If it doesn't, an adjustment factor is used.

  1. Sum unadjusted indices: Add up the median seasonal indices for all seasons.
  • Example Sum: 67.2+133.1=200.367.2 + 133.1 = 200.3.
  • Target sum: k×100=2×100=200k \times 100 = 2 \times 100 = 200 33.
  1. Calculate adjustment factor: Adjustment Factor=k×100∑median seasonal indices\text{Adjustment Factor} = \frac{k \times 100}{\sum \text{median seasonal indices}}.
  • Example Factor: 200/200.3=0.9985200 / 200.3 = 0.9985 34.
  1. Adjust seasonal indices: Multiply each unadjusted seasonal index by the adjustment factor.
  • Adjusted Cooler Index: 67.2×0.9985=67.167.2 \times 0.9985 = 67.1.
  • Adjusted Warmer Index: 133.1×0.9985=132.9133.1 \times 0.9985 = 132.9 35.

The sum of the adjusted indices should now equal k×100k \times 100. These adjusted indices are plotted alongside the seasonal ratios 36.

3.2 Forecasting using seasonal components

Once the trend and seasonal components are estimated, future values can be forecast. This uses the adjusted seasonal indices.

The forecasting formula is: Y^=T^×S^\hat{Y} = \hat{T} \times \hat{S} Where:

  • Y^\hat{Y} is the forecasted value.
  • T^\hat{T} is the estimated trend value for the future period.
  • S^\hat{S} is the adjusted seasonal index for the future season.

The trend value T^\hat{T} is typically calculated using the trend equation derived from the moving averages, often in the form T^=a+bx\hat{T} = a + bx.

📝 Example: Forecast ice-cream sales for the next four seasons:

  • x = 8, Warmer: Y^=(127.71+7.54×8)×(132.9/100)=249.89\hat{Y} = (127.71 + 7.54 \times 8) \times (132.9 / 100) = 249.89.
  • x = 9, Cooler: Y^=(127.71+7.54×9)×(67.1/100)=131.23\hat{Y} = (127.71 + 7.54 \times 9) \times (67.1 / 100) = 131.23.
  • x = 10, Warmer: Y^=(127.71+7.54×10)×(132.9/100)=269.93\hat{Y} = (127.71 + 7.54 \times 10) \times (132.9 / 100) = 269.93.
  • x = 11, Cooler: Y^=(127.71+7.54×11)×(67.1/100)=141.35\hat{Y} = (127.71 + 7.54 \times 11) \times (67.1 / 100) = 141.35 38.

The forecasted values are plotted against the historical data to show future projections 39.

🔑 Important: The ratio-to-moving average method provides a systematic way to decompose a time series, isolate seasonal patterns, and use them for forecasting. Accurate estimation of the trend and careful adjustment of seasonal indices are crucial for reliable forecasts 25 37.

© 2026 Maeve. All rights reserved. This content is protected by copyright.

See also