LU9 incl answers

📚 LU9_incl answers.pdf

Brief overview

This document provides a comprehensive guide to time series analysis, focusing on decomposition, trend estimation, seasonality modeling, and forecasting. Understanding these concepts is crucial for analyzing chronological data and predicting future trends in various fields.

Key points

  • Introduction to the nature and purpose of time series data.
  • Decomposition of time series using multiplicative models and moving averages.
  • Trend and seasonal analysis via the ratio-to-moving average method.
  • Methods for forecasting future time series values.
  • Practical application of forecasting with an example of ice-cream sales.

1. Introduction to time series analysis

1.1 What is time series analysis?

  • Time series data: numeric observations of a variable collected over time at regular intervals.

  • Arranged in chronological order, these data capture changes over time.

  • Examples include daily stock prices, monthly sales figures, or annual population counts.

  • The main goals of time series analysis are to:

  • Identify recurring patterns within the data.

  • Model these patterns statistically.

  • Forecast future values based on the models 2.

1.2 Components of a time series

Time series data are influenced by four main forces that can act alone or together.

ComponentDescription
Trend (T)Long-term movement, either an increase or decrease, over time.
Cycles (C)Changes related to economic activity (not covered in this topic).
Seasonal (S)Fluctuations repeating at regular intervals tied to the calendar.
Irregular (I)Random variations due to unpredictable, everyday influences.

3

🔑 Important: Every time series contains at least one of these components.

1.2.1 Identifying components in examples

Let's examine how these components appear in real-world examples.

  • Quarterly bicycle sales often show a roughly constant trend and unpredictable irregular variations 4.

  • Weekly bread sales might display an increasing linear trend along with irregular fluctuations 5.

  • Quarterly hot water bottle sales can exhibit a decreasing trend, seasonal patterns, and irregular effects.

  • Quarterly car sales typically show an increasing trend, seasonal variations, and irregular influences 7.

🔑 Important: Seasonal variations (S) are tied to calendar intervals like days, weeks, or months. The period for these variations is often denoted by kk. For quarterly data, k=4k=4 6.

🔑 Important: Time series analysis helps understand past data and predict future outcomes by modeling these underlying components.

2. Decomposition of time series and moving averages

2.1 The multiplicative time series model

  • The classical model states that a time series (YY) is a product of its components. The formula is Y=T×S×IY = T \times S \times I.
  • This model assumes a multiplicative relationship between trend (TT), seasonality (SS), and irregular fluctuations (II).
  • For this course, the focus is on modeling trend and seasonality only.

📝 Example: If YY is monthly sales, TT is the overall growth in sales over years, SS is the predictable increase in sales during holiday seasons, and II represents unexpected events like a sudden competitor launch.

  • In this model, TT has the same units as YY. Seasonality (SS) is a percentage adjustment.
  • A value of SS greater than 100% indicates an above-average seasonal effect. A value less than 100% indicates a below-average effect 8.
  • Decomposition analysis aims to isolate and model the trend and seasonal components separately.
  • Unpredictable irregular fluctuations (II) are not modeled.
  • The forecasting model uses the estimated trend and seasonal components: Y^=T^×S^\hat{Y} = \hat{T} \times \hat{S}.

2.2 Steps in decomposition analysis

  • Decomposition involves several key steps to isolate and estimate the components of a time series.
StepAction
1Estimate the trend (TT) using regression analysis
2Estimate seasonality (SS) using the ratio-to-moving average method
3Forecast future values (Y^\hat{Y})
  • The trend component is typically estimated first, often through linear regression analysis 9 11.
  • After estimating the trend, the seasonal component is isolated 12.
  • This involves removing the smoothed trend (moving average) from the original series.
  • The result is a series representing seasonal and irregular components, known as seasonal ratios 13.
  • These seasonal ratios are then used to calculate adjusted seasonal indices, which form the final seasonal estimate 14.
  • Finally, the estimated trend and seasonal components are combined to forecast future values 15.

2.3 Moving averages for smoothing

  • A moving average (MAV) smooths a time series by averaging successive observations.
  • The number of observations to average, kk, is determined by the length of the short-term fluctuations, often the number of seasons in a year.
  • Each original data point is replaced by its moving average, creating a smoothed series.

🔑 Important: Moving averages reduce the impact of random noise and highlight underlying trends and seasonal patterns.

  • A key rule for moving averages is that the value must be centered on a specific time period.

2.3.1 Moving averages with an odd number of seasons (kk)

  • When kk is odd, only the moving average (MAV) calculation is needed.
  • The MAV is calculated by averaging kk consecutive data points.
  • There is a loss of data at the beginning and end of the series because these points cannot be fully averaged 17.
Time (t)Observed Series (YtY_t)MAV for k=3k=3
1Y1Y_1Cannot calculate
2Y2Y_2MAV2=(Y1+Y2+Y3)/3MAV_2 = (Y_1 + Y_2 + Y_3) / 3
3Y3Y_3MAV3=(Y2+Y3+Y4)/3MAV_3 = (Y_2 + Y_3 + Y_4) / 3
4Y4Y_4MAV4=(Y3+Y4+Y5)/3MAV_4 = (Y_3 + Y_4 + Y_5) / 3
5Y5Y_5MAV5=(Y4+Y5+Y6)/3MAV_5 = (Y_4 + Y_5 + Y_6) / 3
6Y6Y_6Cannot calculate

🔑 Important: For an odd kk, the ii-th MAV value corresponds directly to time period ii.

2.3.2 Moving averages with an even number of seasons (kk)

  • When kk is even, moving averages are calculated first, and then these are averaged to center them.
  • This process is called calculating a centered moving average (CMAV) 16.
  • First, MAVs of kk values are computed. Then, two successive MAV values are averaged to center the result on a specific time period 18.
Time (t)Observed Series (YtY_t)MAV for k=4k=4CMAV for k=4k=4
1Y1Y_1Cannot calculateCannot calculate
2Y2Y_2MAV2.5=(Y1+Y2+Y3+Y4)/4MAV_{2.5} = (Y_1 + Y_2 + Y_3 + Y_4) / 4Cannot calculate
3Y3Y_3MAV3.5=(Y2+Y3+Y4+Y5)/4MAV_{3.5} = (Y_2 + Y_3 + Y_4 + Y_5) / 4CMAV3=(MAV2.5+MAV3.5)/2CMAV_3 = (MAV_{2.5} + MAV_{3.5}) / 2
4Y4Y_4MAV4.5=(Y3+Y4+Y5+Y6)/4MAV_{4.5} = (Y_3 + Y_4 + Y_5 + Y_6) / 4CMAV4=(MAV3.5+MAV4.5)/2CMAV_4 = (MAV_{3.5} + MAV_{4.5}) / 2
5Y5Y_5MAV5.5=(Y4+Y5+Y6+Y7)/4MAV_{5.5} = (Y_4 + Y_5 + Y_6 + Y_7) / 4CMAV5=(MAV4.5+MAV5.5)/2CMAV_5 = (MAV_{4.5} + MAV_{5.5}) / 2
6Y6Y_6Cannot calculateCannot calculate
7Y7Y_7Cannot calculateCannot calculate

🔑 Important: For an even kk, the first MAV calculation spans periods tt to t+k−1t+k-1. The CMAV then centers this average on the midpoint between two time periods.

  • An example shows calculating MAV for Year 2, Term 1 (t=4t=4) with k=3k=3. The average of Y3,Y4,Y5Y_3, Y_4, Y_5 is used.

  • Data: Y3=60,Y4=62,Y5=100Y_3=60, Y_4=62, Y_5=100.

  • MAV4=(60+62+100)/3=74MAV_4 = (60 + 62 + 100) / 3 = 74 20.

  • An example illustrates finding CMAV for Year 1, Quarter 3 (t=3t=3) with k=4k=4.

  • First, calculate MAV2.5=(4+7+12+9)/4=8MAV_{2.5} = (4+7+12+9)/4 = 8.

  • Next, calculate MAV3.5=(7+12+9+8)/4=9MAV_{3.5} = (7+12+9+8)/4 = 9.

  • Finally, 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.

🔑 Important: Moving averages help isolate the trend by filtering out seasonal and irregular components. The method of centring (MAV vs. CMAV) depends on whether the seasonal period (kk) is odd or even.

3. Trend and seasonal analysis using ratio-to-moving average

This method combines trend estimation with seasonal pattern identification. It helps understand how much of a time series' variation is due to long-term movement versus predictable yearly cycles.

3.1 Estimating the trend component

The trend represents the long-term direction of a time series. It is estimated by removing the seasonal and irregular components.

  • Regression analysis: This method fits a straight line to the data using least squares. The observed sales (YY) are the dependent variable, and time (XX) is the independent variable.

  • The trend is estimated by the formula: T^=a+bX\hat{T} = a + bX.

  • For the example data, the trend equation is: T^=127.71+7.54X\hat{T} = 127.71 + 7.54X 24.

  • Moving Averages (MAV): This method smooths out fluctuations to reveal the underlying trend. For an even number of periods (kk), a centered moving average (CMAV) is used.

  • A standard moving average calculates the average of a specific number of consecutive data points.

  • A centered moving average averages two consecutive moving averages to align the smoothed value with the original time period.

🔑 Important: Regression provides a linear trend, while moving averages can capture a smoother, potentially non-linear trend.

3.2 The ratio-to-moving average method

This method isolates the seasonal component by comparing actual sales to an initial trend estimate.

3.2.1 Initial trend estimate using moving averages

The first step is to calculate a centered moving average (CMAV) for each time period. This CMAV serves as an initial estimate of the trend.

25.

  • CMAV Calculation: For an even number of periods kk, calculate the simple moving average (MAV) for kk periods, then average two consecutive MAVs.
  • Example: For k=4k=4, calculate MAVs for periods 1-4 and 2-5, then average them 26.

3.2.2 Calculating seasonal ratios

Seasonal ratios (SR) are calculated by dividing the observed sales (YY) by the corresponding CMAV and multiplying by 100. This expresses seasonality as an index relative to the trend.

  • Formula: SR=YCMAV×100SR = \frac{Y}{CMAV} \times 100.
  • These ratios capture both the seasonal and irregular components (S×IS \times I).

🔑 Important: A seasonal ratio above 100 indicates the period's sales are higher than the trend, while below 100 suggests lower-than-trend sales 28.

Time (X)SeasonSales (Y)MAVCMAVSeasonal Ratio
1Cooler89---
2Warmer196142.5147.3133.1
3Cooler108152.0159.067.9
4Warmer224166.0168.5132.9
5Cooler118171.0177.566.5
6Warmer250184.0184.5135.5
7Cooler120---
29

3.2.3 Finding median/unadjusted seasonal indices

To get a stable seasonal index for each period (e.g., "Cooler" or "Warmer"), seasonal ratios are grouped by season and the median is calculated.

  • Steps:
  1. Sort the seasonal ratios for each season.
  2. Find the median of these sorted ratios for each season. The median is preferred as it resists outliers.
  • If there's an odd number of ratios, the median is the middle value.
  • If there's an even number, the median is the average of the two middle values.

🔑 Important: The number of seasonal ratios per season (kk) determines how the median is calculated if kk is even 31.

SeasonSeasonal RatiosMedian/Unadjusted Seasonal Indices
Cooler67.9, 66.5, 135.5(67.9+66.5)/2=67.2(67.9 + 66.5) / 2 = 67.2
Warmer133.1, 132.9(133.1+132.9)/2=133.1(133.1 + 132.9) / 2 = 133.1
32

3.2.4 Calculating adjusted seasonal indices

The sum of the unadjusted seasonal indices should ideally equal 100×k100 \times k. If it doesn't, an adjustment factor is used to correct them.

  • Steps:
  1. Sum the median seasonal indices.
  2. Calculate the adjustment factor: Factor=k×100∑Median Indices\text{Factor} = \frac{k \times 100}{\sum \text{Median Indices}}.
  • For the example, k=2k=2. Sum of indices = 200.3.
  • Adjustment factor = 2×100200.3=0.9985\frac{2 \times 100}{200.3} = 0.9985 34.
  1. Multiply each median 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.
SeasonMedian/Unadjusted Seasonal IndicesAdjustment FactorAdjusted Seasonal Index
Cooler67.20.998567.1
Warmer133.10.9985132.9

🔑 Important: This method provides a clear way to decompose a time series into its trend and seasonal components for better forecasting and analysis. 23 36.

4. Forecasting time series

4.1 Using trend and seasonal components for forecasts

Forecasting future time series values involves combining the estimated trend and adjusted seasonal components. This process allows us to predict future behavior based on historical patterns.

  • Forecast Formula: The predicted value (Y^\hat{Y}) is calculated by multiplying the estimated trend (T^\hat{T}) by the estimated seasonal component (S^\hat{S}). Y^=T^×S^\hat{Y} = \hat{T} \times \hat{S}
  • Forecasting steps:
  1. Determine the future time index value (xx) for which a forecast is needed.
  2. Identify the specific season corresponding to that future time index.
  3. Apply the forecast formula to calculate the predicted value.

4.2 Example: Ice-cream sales forecast

This example demonstrates forecasting ice-cream sales for the next four seasons using an additive trend and multiplicative seasonal model. Calculations are shown to two decimal places.

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

Time Index (xx)SeasonTrend Component (a+bxa + bx)Seasonal IndexForecasted Sales (Y^\hat{Y})Calculation
8Warmer127.71+7.54×8127.71 + 7.54 \times 8132.9249.89(127.71+7.54×8)×132.9100\frac{(127.71 + 7.54 \times 8) \times 132.9}{100}
9Cooler127.71+7.54×9127.71 + 7.54 \times 967.1131.23(127.71+7.54×9)×67.1100\frac{(127.71 + 7.54 \times 9) \times 67.1}{100}
10Warmer127.71+7.54×10127.71 + 7.54 \times 10132.9269.93(127.71+7.54×10)×132.9100\frac{(127.71 + 7.54 \times 10) \times 132.9}{100}
11Cooler127.71+7.54×11127.71 + 7.54 \times 1167.1141.35(127.71+7.54×11)×67.1100\frac{(127.71 + 7.54 \times 11) \times 67.1}{100}
The forecast for time x=9x=9 (cooler season) is 131.23. The forecast for time x=10x=10 (warmer season) is 269.93.

The forecast for time x=11x=11 (cooler season) is 141.35 38.

A plot visually represents these forecasted time series values for points 8 through 11.

🔑 Important: Combining trend and seasonal components allows for accurate prediction of future time series values, essential for planning and decision-making 37 39.

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

See also