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.
| Component | Description |
|---|---|
| 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. |
🔑 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 k. For quarterly data, k=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 (Y) is a product of its components. The formula is Y=T×S×I.
- This model assumes a multiplicative relationship between trend (T), seasonality (S), and irregular fluctuations (I).
- For this course, the focus is on modeling trend and seasonality only.
📝 Example: If Y is monthly sales, T is the overall growth in sales over years, S is the predictable increase in sales during holiday seasons, and I represents unexpected events like a sudden competitor launch.
- In this model, T has the same units as Y. Seasonality (S) is a percentage adjustment.
- A value of S 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 (I) are not modeled.
- The forecasting model uses the estimated trend and seasonal components: Y^=T^×S^.
2.2 Steps in decomposition analysis
- Decomposition involves several key steps to isolate and estimate the components of a time series.
| Step | Action |
|---|---|
| 1 | Estimate the trend (T) using regression analysis |
| 2 | Estimate seasonality (S) using the ratio-to-moving average method |
| 3 | Forecast future values (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, k, 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 (k)
- When k is odd, only the moving average (MAV) calculation is needed.
- The MAV is calculated by averaging k 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 (Yt) | MAV for k=3 |
|---|---|---|
| 1 | Y1 | Cannot calculate |
| 2 | Y2 | MAV2=(Y1+Y2+Y3)/3 |
| 3 | Y3 | MAV3=(Y2+Y3+Y4)/3 |
| 4 | Y4 | MAV4=(Y3+Y4+Y5)/3 |
| 5 | Y5 | MAV5=(Y4+Y5+Y6)/3 |
| 6 | Y6 | Cannot calculate |
🔑 Important: For an odd k, the i-th MAV value corresponds directly to time period i.
2.3.2 Moving averages with an even number of seasons (k)
- When k 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 k values are computed. Then, two successive MAV values are averaged to center the result on a specific time period 18.
| Time (t) | Observed Series (Yt) | MAV for k=4 | CMAV for k=4 |
|---|---|---|---|
| 1 | Y1 | Cannot calculate | Cannot calculate |
| 2 | Y2 | MAV2.5=(Y1+Y2+Y3+Y4)/4 | Cannot calculate |
| 3 | Y3 | MAV3.5=(Y2+Y3+Y4+Y5)/4 | CMAV3=(MAV2.5+MAV3.5)/2 |
| 4 | Y4 | MAV4.5=(Y3+Y4+Y5+Y6)/4 | CMAV4=(MAV3.5+MAV4.5)/2 |
| 5 | Y5 | MAV5.5=(Y4+Y5+Y6+Y7)/4 | CMAV5=(MAV4.5+MAV5.5)/2 |
| 6 | Y6 | Cannot calculate | Cannot calculate |
| 7 | Y7 | Cannot calculate | Cannot calculate |
🔑 Important: For an even k, the first MAV calculation spans periods t to t+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=4) with k=3. The average of Y3,Y4,Y5 is used.
-
Data: Y3=60,Y4=62,Y5=100.
-
MAV4=(60+62+100)/3=74 20.
-
An example illustrates finding CMAV for Year 1, Quarter 3 (t=3) with k=4.
-
First, calculate MAV2.5=(4+7+12+9)/4=8.
-
Next, calculate MAV3.5=(7+12+9+8)/4=9.
-
Finally, CMAV3=(MAV2.5+MAV3.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 (k) 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 (Y) are the dependent variable, and time (X) is the independent variable.
-
The trend is estimated by the formula: T^=a+bX.
-
For the example data, the trend equation is: 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 (k), 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 k, calculate the simple moving average (MAV) for k periods, then average two consecutive MAVs.
- Example: For k=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 (Y) by the corresponding CMAV and multiplying by 100. This expresses seasonality as an index relative to the trend.
- Formula: SR=CMAVY×100.
- These ratios capture both the seasonal and irregular components (S×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) | Season | Sales (Y) | MAV | CMAV | Seasonal Ratio |
|---|---|---|---|---|---|
| 1 | Cooler | 89 | - | - | - |
| 2 | Warmer | 196 | 142.5 | 147.3 | 133.1 |
| 3 | Cooler | 108 | 152.0 | 159.0 | 67.9 |
| 4 | Warmer | 224 | 166.0 | 168.5 | 132.9 |
| 5 | Cooler | 118 | 171.0 | 177.5 | 66.5 |
| 6 | Warmer | 250 | 184.0 | 184.5 | 135.5 |
| 7 | Cooler | 120 | - | - | - |
| 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:
- Sort the seasonal ratios for each season.
- 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 (k) determines how the median is calculated if k is even 31.
| Season | Seasonal Ratios | Median/Unadjusted Seasonal Indices |
|---|---|---|
| Cooler | 67.9, 66.5, 135.5 | (67.9+66.5)/2=67.2 |
| Warmer | 133.1, 132.9 | (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×k. If it doesn't, an adjustment factor is used to correct them.
- Steps:
- Sum the median seasonal indices.
- Calculate the adjustment factor: Factor=∑Median Indicesk×100.
- For the example, k=2. Sum of indices = 200.3.
- Adjustment factor = 200.32×100=0.9985 34.
- Multiply each median seasonal index by the adjustment factor.
- Adjusted Cooler index: 67.2×0.9985=67.1.
- Adjusted Warmer index: 133.1×0.9985=132.9.
| Season | Median/Unadjusted Seasonal Indices | Adjustment Factor | Adjusted Seasonal Index |
|---|---|---|---|
| Cooler | 67.2 | 0.9985 | 67.1 |
| Warmer | 133.1 | 0.9985 | 132.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^) is calculated by multiplying the estimated trend (T^) by the estimated seasonal component (S^). Y^=T^×S^
- Forecasting steps:
- Determine the future time index value (x) for which a forecast is needed.
- Identify the specific season corresponding to that future time index.
- 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 (x) | Season | Trend Component (a+bx) | Seasonal Index | Forecasted Sales (Y^) | Calculation |
|---|---|---|---|---|---|
| 8 | Warmer | 127.71+7.54×8 | 132.9 | 249.89 | 100(127.71+7.54×8)×132.9 |
| 9 | Cooler | 127.71+7.54×9 | 67.1 | 131.23 | 100(127.71+7.54×9)×67.1 |
| 10 | Warmer | 127.71+7.54×10 | 132.9 | 269.93 | 100(127.71+7.54×10)×132.9 |
| 11 | Cooler | 127.71+7.54×11 | 67.1 | 141.35 | 100(127.71+7.54×11)×67.1 |
| The forecast for time x=9 (cooler season) is 131.23. The forecast for time x=10 (warmer season) is 269.93. |
The forecast for time x=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.