Welcome to Time Series and Moving Averages

Hello! Have you ever wondered how shops know how many ice creams to stock in July versus December? Or how weather forecasters predict long-term temperature changes? They look at data collected over regular intervals of time. In this chapter, we will learn how to plot, smooth, and interpret time series data to uncover hidden patterns and make sensible future predictions.

Don't worry if this seems a bit mathematical at first. We will break every concept down step-by-step with clear examples!

Did you know? Businesses, streaming services like Netflix, and video game developers constantly use time series graphs to see peak hours of activity so their servers do not crash!

1. What is a Time Series Graph?

A time series is simply a set of data recorded at regular intervals over a period of time (for example: hourly, daily, monthly, quarterly, or yearly).

When we plot this on a graph:

Time is always placed on the horizontal axis (\(x\)-axis).
• The variable being measured (such as sales, temperature, or website visits) is placed on the vertical axis (\(y\)-axis).
• Data points are plotted and joined together with straight line segments.

Example: Imagine recording the temperature at 12:00 PM every day for a week. Plotting days on the \(x\)-axis and temperatures on the \(y\)-axis gives you a time series graph.

Quick Review: Graph Axes

Always remember: Time marches forward along the bottom (\(x\)-axis)!

A raw time series line can look very jagged and jumpy. To make sense of it, we look for different types of patterns or variations:

1. General Trend:
The overall, long-term direction of the data over a long period. A trend can be:
Upward trend: Values are generally rising over time (e.g., world population).
Downward trend: Values are generally falling over time (e.g., sales of DVD players).
Level / Constant trend: Values stay roughly around the same average level.

2. Seasonal Variation:
Regular, repeating patterns that happen over a fixed, known period (such as a day, a week, or a year).
Example: Ice cream sales peak every summer (Quarter 3) and drop every winter (Quarter 1). Toy sales spike every December before Christmas.

3. Cyclical Variation:
Long-term waves or cycles that occur over several years, often linked to economic booms and recessions. Unlike seasonal variations, these do not happen at fixed calendar intervals.

4. Random (Irregular) Variations:
Unpredictable, one-off events that cause sudden spikes or dips in data.
Example: An unexpected snowstorm causing an extreme spike in snow shovel sales on a single weekend.

Key Takeaway

Data = Underlying Trend + Seasonal Variation + Random Noise.

3. Smoothing the Data: Moving Averages

Because data jumps up and down due to seasonal and random noise, it can be hard to see the true direction of the trend. To solve this, we calculate moving averages.

A moving average "smooths out" the peaks and troughs so the underlying trend becomes clear.

How Moving Averages Work

We take a fixed number of consecutive values, calculate their mean, and then "move" forward by dropping the oldest value and adding the next one.

3-Point Moving Average (Example)

Suppose a bakery records its sandwich sales over 5 days: Monday (\(12\)), Tuesday (\(18\)), Wednesday (\(15\)), Thursday (\(21\)), Friday (\(24\)).

Step 1: Calculate the first 3-point average (Monday, Tuesday, Wednesday):
\(\text{Average}_1 = \frac{12 + 18 + 15}{3} = \frac{45}{3} = 15\)

Step 2: Move one day along (drop Monday, include Thursday):
\(\text{Average}_2 = \frac{18 + 15 + 21}{3} = \frac{54}{3} = 18\)

Step 3: Move one day along again (drop Tuesday, include Friday):
\(\text{Average}_3 = \frac{15 + 21 + 24}{3} = \frac{60}{3} = 20\)

Notice how our smoothed values (\(15, 18, 20\)) clearly show a steady upward trend!

Where Do We Plot Moving Averages?

Odd-number moving averages (e.g., 3-point, 5-point): Plot the moving average at the exact middle time point.
Example: The average of Monday, Tuesday, and Wednesday is plotted directly on Tuesday.
Even-number moving averages (e.g., 4-point quarterly data): The midpoint sits halfway between two time periods (e.g., between Quarter 2 and Quarter 3). In practice, you plot these midpoints and draw a straight trend line through them.

Memory Aid: Choosing the Number of Points

Always match your moving average to the length of your season!
• For quarterly data (4 quarters in a year) → use a 4-point moving average.
• For daily data over a week (7 days) → use a 7-point moving average.

4. Drawing the Trend Line

Once you have calculated and plotted your moving averages:

1. Draw a single straight line of best fit through the moving average points. This is your Trend Line.
2. Do not draw the trend line through the original raw data points; draw it through the moving average points because they represent the smoothed trend.

5. Estimating Seasonal Variations and Forecasting

We can use our trend line to forecast future values using the Additive Model.

Step-by-Step Forecasting Method

Step 1: Find the Seasonal Variation for individual points
For any given point in your historical data:
\(\text{Seasonal Variation} = \text{Actual Value} - \text{Trend Value}\)

Note: The seasonal variation can be positive (above trend) or negative (below trend).

Step 2: Calculate the Average Seasonal Variation for each season
Add up all the variations for that specific season (e.g., all Quarter 1s) and divide by the number of years:
\(\text{Mean Seasonal Variation} = \frac{\text{Sum of variations for that season}}{\text{Number of observations for that season}}\)

Step 3: Extend the Trend Line into the Future
Use a ruler to extend your straight trend line forward to the future time period to read off the expected Future Trend Value.

Step 4: Calculate the Forecast (Prediction)
\(\text{Predicted Value} = \text{Future Trend Value} + \text{Mean Seasonal Variation}\)

Worked Example:

Suppose a clothing store wants to predict coat sales for Winter 2026.
• By extending the trend line, the estimated Trend Value for Winter 2026 is \(450\) coats.
• The calculated Average Seasonal Variation for Winter is \(+85\) coats.
Predicted Sales \(= 450 + (+85) = 535\) coats.

If predicting for Summer 2026 where the trend value is \(460\) and the average variation is \(-60\):
Predicted Sales \(= 460 + (-60) = 400\) coats.

6. Reliability and Limitations of Predictions

When answering exam questions about predictions, always think critically about how trustworthy your forecast is:

1. Short-term vs. Long-term Predictions (Extrapolation):
• Predicting for the next quarter is usually reasonably reliable because trends tend to continue in the near future.
• Predicting for 5 or 10 years ahead is unreliable because circumstances change, market conditions alter, and the trend may level off or reverse.

2. External Factors:
Predictions assume past patterns will continue unchanged. Sudden unforeseen events (e.g., extreme weather, economic crises, new competition) can make forecasts inaccurate.

Common Mistakes to Avoid in Exams

Mistake 1: Plotting time on the vertical \(y\)-axis.
Correction: Always put time on the horizontal \(x\)-axis.

Mistake 2: Drawing the trend line through raw data points instead of the moving average points.
Correction: Always place your trend line through the center of the plotted moving averages.

Mistake 3: Forgetting that seasonal variation can be negative.
Correction: When actual values are below the trend, the variation is negative: \(\text{Actual} - \text{Trend} < 0\).

Mistake 4: Placing an odd-point moving average at the wrong time value.
Correction: A 3-point moving average of periods 1, 2, and 3 belongs exactly at period 2.

Chapter Summary Checklist

Time series graph: Plots time (\(x\)-axis) against a variable (\(y\)-axis) connected with straight lines.
Trend: The general long-term direction (upward, downward, or constant).
Moving average: Smooths out short-term fluctuations to reveal the trend.
Additive formula: \(\text{Seasonal Variation} = \text{Actual Value} - \text{Trend Value}\)
Forecasting formula: \(\text{Prediction} = \text{Trend Value} + \text{Average Seasonal Variation}\)
Reliability: Near-future forecasts are more reliable than long-term extrapolation.