LU9 Lecture Notes

📚 LU9 Lecture Notes.pdf

Brief overview

This document introduces the fundamental concepts and techniques of time series analysis. Understanding these methods is crucial for identifying patterns, modeling temporal dependencies, and forecasting future values in sequential data.

Key points

  • Overview of time series data and the goals of time series analysis.
  • Identification of the four core components of a time series: trend, cycles, seasonality, and random effects.
  • Methods for estimating the trend component using moving averages and centered moving averages.
  • Techniques for calculating and adjusting seasonal indices using the ratio-to-moving average approach.
  • Application of estimated trend and seasonal components for forecasting future time series values.

1. Introduction to time series analysis

1.1 What is time series data?

  • Time series data: Numerical data of a random variable collected over time at regular intervals, arranged chronologically.
  • Common examples include daily stock prices, monthly sales, and annual population figures.
  • Trendline graphs visualize time series data with time on the x-axis and variable values on the y-axis.

1.2 Purpose of time series analysis

  • The main goals are to identify recurring patterns, model them statistically, and forecast future values 2.

🔑 Important: Time series analysis helps us understand past patterns to predict future outcomes.

1.3 Components of a time series

Time series data are influenced by four underlying forces that operate over time.

ComponentDescription
Trend (T)Long-term upward or downward movement in the data.
Cycles (C)Economic activity fluctuations (not covered in this course).
Seasonal (S)Repeats at regular intervals tied to the calendar (e.g., months, quarters).
Irregular (I)Unpredictable variations due to random influences. 3

1.4 Identifying components in data

Analyzing time series graphs helps identify which components are present.

📝 Example: Quarterly bicycle sales might show a trend and irregular variations, but not strong seasonality.

Here are examples of components in different data types:

Data SeriesComponents Present
Quarterly bicycle salesTrend, Irregular 4
Weekly bread salesTrend, Irregular 5
Quarterly hot water bottle salesTrend, Seasonal, Irregular 6
Quarterly car salesTrend, Seasonal, Irregular 7

1.5 Decomposition of a time series

  • The classical model for time series is the multiplicative model: Y=T×S×IY = T \times S \times I.
  • YY is the observed value, TT is the trend, SS is seasonality, and II is the irregular component.
  • Trend (TT) has the same units as YY.
  • Seasonality (SS) is a percentage; >100 means above average, <100 means below average 8.

🔑 Important: This course focuses on modeling only the trend and seasonal components.

1.6 Steps in decomposition analysis

Decomposition isolates and models trend and seasonality separately, as irregular fluctuations are unpredictable.

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

The key steps are:

  1. Estimate trend: Use regression analysis.
  2. Estimate seasonality: Use the ratio-to-moving average method.
  3. Forecast: Combine trend and seasonal estimates 9.

🔑 Important: Decomposition analysis breaks down a time series into its core influences.

1.6.1 Finding the trend estimate

  • The trend component is estimated using linear regression analysis.
  • This process models the long-term movement of the data 11.

1.6.2 Calculating seasonal indices

  • Moving averages are used to smooth the trend estimate 12.
  • Dividing the original data by the smoothed trend isolates seasonal and irregular components, called seasonal ratios 13.
  • These seasonal ratios are then averaged to find adjusted seasonal indices 14.

🔑 Important: Seasonal indices represent the typical pattern of variation within a year.

1.6.3 Forecasting future values

  • The final forecast combines the estimated trend and seasonal components.
  • This involves multiplying the projected trend by the seasonal index for the future period 15.

🔑 Important: Combining trend and seasonality allows for predicting future values of the time series.

2. Moving averages and trend estimation

2.1 Smoothing time series with moving averages

  • Moving averages (MAV) smooth short-term fluctuations in a time series. They do this by averaging a fixed number (kk) of consecutive observations.
  • The value of kk is typically set to the number of seasons in the time series.
  • Each time period's actual value is replaced by its moving average, creating a smoothed series.
  • MAV values must be centered on a middle time period.

2.1.1 Moving averages for odd kk

  • When kk is odd, only moving averages (MAV) are calculated.
  • For a series of length nn, information is lost at both ends because not all kk periods can be formed.

📝 Example: For a series Y1,...,Y6Y_1,..., Y_6 and k=3k=3:

  • MAV2=(Y1+Y2+Y3)/3MAV_2 = (Y_1 + Y_2 + Y_3) / 3
  • MAV3=(Y2+Y3+Y4)/3MAV_3 = (Y_2 + Y_3 + Y_4) / 3
  • MAV4=(Y3+Y4+Y5)/3MAV_4 = (Y_3 + Y_4 + Y_5) / 3
  • MAV5=(Y4+Y5+Y6)/3MAV_5 = (Y_4 + Y_5 + Y_6) / 3 17.

2.1.2 Moving averages for even kk

  • When kk is even, first calculate all moving averages of kk values.
  • Then, center successive moving averages by averaging two consecutive MAVs. This results in a centered moving average (CMAV).

📝 Example: For a series Y1,...,Y7Y_1,..., Y_7 and k=4k=4:

  • MAV2.5=(Y1+Y2+Y3+Y4)/4MAV_{2.5} = (Y_1 + Y_2 + Y_3 + Y_4) / 4
  • MAV3.5=(Y2+Y3+Y4+Y5)/4MAV_{3.5} = (Y_2 + Y_3 + Y_4 + Y_5) / 4
  • CMAV3=(MAV2.5+MAV3.5)/2CMAV_3 = (MAV_{2.5} + MAV_{3.5}) / 2
  • CMAV4=(MAV3.5+MAV4.5)/2CMAV_4 = (MAV_{3.5} + MAV_{4.5}) / 2 19.

2.1.3 Calculating MAV/CMAV for a specific period

  • To find a MAV for an odd kk, center the calculation on the target period.
  • To find a CMAV for an even kk, first calculate two MAVs straddling the target period, then average them.

📝 Example: Calculating MAV for Year 2, Term 1 (t=4) with k=3k=3: MAV4=(Y3+Y4+Y5)/3MAV_4 = (Y_3 + Y_4 + Y_5) / 3 Using sales data: MAV4=(60+62+100)/3=74MAV_4 = (60 + 62 + 100) / 3 = 74 20.

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

2.2 Estimating the trend component

  • The trend component (T^\hat{T}) represents the long-term movement in a time series.
  • It can be estimated by removing the seasonal component using methods like least squares regression or moving averages.

2.2.1 Trend estimation using regression

  • This method models the time series (YY) as a function of time (XX) using a linear equation: T^=a+bX\hat{T} = a + bX.
  • The dependent variable is the observed time series data (YY).
  • The independent variable is the time index (X=1,2,3,...,nX = 1, 2, 3,..., n).
  • Regression coefficients aa (intercept) and bb (slope) are found using a calculator.

🔑 Important: The regression method yields a straight-line trend estimate 23.

2.2.2 Trend estimation using moving averages

  • Moving averages (MAV/CMAV) can also be used to estimate the trend component by smoothing out seasonal and irregular fluctuations.
  • This provides a smooth curve representing the long-term trend.

🔑 Important: Moving averages are used to find an initial trend estimate before seasonal decomposition.

2.3 Seasonal component estimation: Ratio-to-moving average method

  • This method first estimates the trend using MAV/CMAV, then removes it to isolate the seasonal and irregular components. These are then used to derive the seasonal indices.

2.3.1 Step 1: Initial trend estimate

  • Calculate the initial trend estimate using MAV or CMAV as described previously.
  • This smoothed series represents the trend (T^\hat{T}) 25.

2.3.2 Step 2: Calculate seasonal ratios

  • For each time period, calculate the seasonal ratio (SR) by dividing the actual value (YY) by its corresponding MAV/CMAV.
  • Multiply by 100 to express it as an index. The formula is: SR=(Y/MAV)×100SR = (Y / MAV) \times 100.
  • This ratio represents the combined effect of the seasonal and irregular components (S×IS \times I).

🔑 Important: This step assumes the relationship Y=T×S×IY = T \times S \times I (multiplicative model) 28.

2.3.3 Step 3: Find median/unadjusted seasonal indices

  • Group the seasonal ratios by season (e.g., all January ratios together).
  • Calculate the median seasonal ratio for each season. The median is used because it is resistant to outliers.
  • If kk (number of seasonal ratios per season) is odd, the median is the middle value.
  • If kk is even, the median is the average of the two middle values.

📝 Example: For "Cooler" season with ratios 67.9, 66.5, 135.5: Sorted: 66.5, 67.9, 135.5. Median = 67.9. For "Warmer" season with ratios 133.1, 132.9, 135.5: Sorted: 132.9, 133.1, 135.5. Median = 133.1. Note: The provided example calculation for "Cooler" uses average of 67.9 and 66.5, implying k=2k=2 for the median calculation based on page 32 31 32.

2.3.4 Step 4: Calculate the adjusted seasonal indices

  • The sum of the unadjusted seasonal indices should equal 100×k100 \times k (where kk is the number of seasons).
  • If the sum is not equal, adjust the indices using an adjustment factor.
  • Adjustment factor: (k×100)/(Sum of median seasonal indices)(k \times 100) / (\text{Sum of median seasonal indices}).
  • Multiply each median seasonal index by this factor to obtain the final, adjusted seasonal indices.

🔑 Important: The adjusted seasonal indices sum to 100×k100 \times k, ensuring proportionality across seasons 33 34 35.

🔑 Important: Moving averages and seasonal decomposition are crucial for understanding time series patterns and forecasting 16.

3. Forecasting with time series models

3.1 Forecasting future values

Forecasts use estimated trend and seasonal components to predict future time series values. The process involves identifying the future time index and its corresponding season.

The forecast value is calculated by multiplying the estimated trend by the adjusted seasonal index.

The core formula for forecasting 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 component.
  • S^\hat{S} is the estimated seasonal index.

3.2 Forecasting example: Ice-cream sales

This example forecasts ice-cream sales for the next four seasons. Calculations are rounded to two decimal places.

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

Time Index (xx)SeasonCalculationForecasted Sales (Y^\hat{Y})
8Warmer127.71+7.54×8×1.329127.71 + 7.54 \times 8 \times 1.329249.89
9Cooler127.71+7.54×9×0.671127.71 + 7.54 \times 9 \times 0.671131.23
10Warmer127.71+7.54×10×1.329127.71 + 7.54 \times 10 \times 1.329269.93
11Cooler127.71+7.54×11×0.671127.71 + 7.54 \times 11 \times 0.671141.35

A plot can visualize these forecasted values for time points 8 through 11, illustrating the seasonal pattern in future sales.

🔑 Important: Forecasts combine the underlying trend with the cyclical seasonal patterns to predict future outcomes 37 38 39.

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

See also