Biostatistics · Intermediate

Time Series Forecasting Methods

Written by SignalsLab

Early edition: these lessons are being reviewed.

Content

Summary

Time series forecasting relies on decomposing data into trend, seasonal, cyclic, and residual components to build predictive models. A critical baseline for analysis is white noise, characterized by a mean near zero, constant variance, and uncorrelated segments, which helps identify non-random patterns.

Intuition

Think of a time series as a layered cake where the goal is to taste each layer separately. You have the long-term trend (the cake's height), the seasonal cycles (regular frosting patterns), and the cyclic shifts (irregular bumps). The final layer is the residual noise, which should ideally be 'white noise'—pure randomness with no predictable structure. If you can isolate and model the first three layers, you can predict the future. White noise serves as the control group; if your model's residuals look like white noise, you've captured all the signal. Techniques like moving averages act as filters, smoothing out the short-term noise to reveal the underlying trend, while differencing removes trends to make the data stationary and easier to model.

Key equations

yn−yn−1
(1)

First-order difference used to remove linear trends by subtracting the previous value from the current value.

SMAt=1k∑i=0k−1yt−i
(2)

Simple Moving Average, the arithmetic mean of k consecutive data points, used to smooth short-term fluctuations.

Derivation

  1. Define a time series as a sequence of data points indexed in chronological order, where order matters.
  2. Decompose the series into four components: Trend (Tt), Seasonal (St), Cyclic variation, and Residual/Noise (Et).
  3. Identify the goal of forecasting as building a robust model by isolating these components.
  4. Recognize that the residual component should ideally be white noise, defined by a mean near zero, constant variance (homoscedasticity), and uncorrelated segments.
  5. Apply smoothing techniques like Simple Moving Average (SMA) or Weighted Moving Average (WMA) to reduce noise and highlight trends.
  6. Use differencing (yn−yn−1) to remove trends and achieve stationarity, which is required for ARIMA and other standard models.
  7. Verify the model by checking if the remaining residuals exhibit white noise properties using windows of consecutive terms.

Worked example

Problem

You have a time series with a clear linear upward trend. You need to prepare this data for an ARIMA model, which requires stationarity. How do you remove the trend, and what property should the resulting series exhibit if the trend was the only non-stationary element?

  1. Identify that the series has a linear trend, making it non-stationary.
  2. Apply first-order differencing, calculating yn−yn−1 for each consecutive pair of points.
  3. This operation transforms the linear trend into a constant level (often near zero).
  4. Check the resulting series for stationarity: it should have constant variance and no trend.
  5. If the original series had no other components, the differenced series should resemble white noise (mean near zero, constant variance, uncorrelated).

Answer Apply first-order differencing (yn−yn−1). The resulting series should be stationary, ideally exhibiting white noise characteristics if the trend was the sole source of non-stationarity.

Common mistakes

  • Confusing seasonal variation (fixed period) with cyclic variation (irregular period).
  • Assuming a time series is stationary just because it has no trend, ignoring constant variance and autocorrelation.
  • Choosing a window size for moving averages that is too large, obscuring genuine local fluctuations.
  • Failing to check if residuals are white noise, leading to models that haven't captured all predictable information.
  • Using simple moving averages when recent data is significantly more relevant than older data, ignoring the benefits of weighted averages.

Animation

Animation coming soon

The animated version of this lesson is being prepared for the web. In the Signals AI app, lessons are drawn step by step.

Code

This is a text lesson: it has no animation code yet.

ccBYNC© 2026 SignalsLab. Lesson text shared as is under CC BY-NC 4.0.