Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 3

Understanding Stationarity in Time Series Analysis

Recommended resources

Introduction

In our last lesson, we learned how to decompose a time series into its constituent parts: trend, seasonality, and residuals. We saw that components like a long-term trend or a repeating seasonal pattern are fundamental drivers of a series's behavior. This ability to isolate systematic patterns is a crucial first step in your journey toward building sophisticated demand forecasting models.

Today, we will build directly on that foundation by exploring the concept of stationarity. This is one of the most important statistical properties of a time series. The trends and seasonalities you learned to identify are common reasons why a series is not stationary. This lesson directly addresses the learning outcome: Define strict and weak stationarity and explain why stationarity matters for classical forecasting methods.

Understanding stationarity is not just a theoretical exercise. It's a practical prerequisite for a large family of powerful forecasting models, including the ARIMA models we will study shortly. For these models to produce reliable forecasts, the underlying data must have stable statistical properties. We'll explore what "stable" means, why it's so important, and how it connects to the components we've already discussed.


What is Stationarity? An Intuitive View

At its core, a stationary time series is one whose statistical properties—such as the mean, variance, and autocorrelation—are all constant over time. Think of it as a process that is in a state of statistical equilibrium. The distribution from which the observations are drawn does not change.

This might sound abstract, so let's start with a visual and intuitive explanation. The following video introduces the three main criteria for stationarity in a very accessible way.

Time Series Talk : Stationarity

This video from the ritvikmath channel provides a clear, non-technical introduction to stationarity and illustrates how violations of its conditions appear in time series plots.

Please watch the first three minutes of the video, covering the following segments: The introduction, which explains why stationarity is an important assumption for classical models. The three criteria for stationarity: constant mean, constant standard deviation (variance), and no seasonality. Visual examples of non-stationary series that violate each of these conditions.

The examples in the video are excellent for building intuition. Let's connect them to the concepts from our last lesson and the image below.

From left to right: A time series with non-constant variance, a series with non-constant mean (a trend), and a series with a repeating pattern (violating constant covariance).
  1. Non-constant Mean: The middle plot shows a clear upward trend. The mean of the series in the first half is much lower than the mean in the second half. This is a classic example of non-stationarity. In demand forecasting, this could represent a product with growing popularity.
  2. Non-constant Variance: The plot on the left shows a series where the fluctuations are initially large and then dampen over time. This property, where the volatility changes, is called heteroscedasticity and is another form of non-stationarity.
  3. Non-constant Covariance/Seasonality: The plot on the right exhibits a clear, repeating pattern. This is a seasonal pattern. Why does this violate stationarity? Because the relationship (covariance) between observations depends on when they occur. For example, the covariance between an observation in a peak month and the next observation will be systematically different from the covariance between an observation in a trough month and the next. The structure of the dependence changes with the season.

A stationary series, by contrast, would look "flat" on average, with constant "width" of fluctuations, and no predictable, repeating patterns. The ritvikmath video also makes a good point distinguishing stationarity from white noise. A white noise process is always stationary, but a stationary process is not necessarily white noise, as it can still have autocorrelation (as long as that autocorrelation structure is constant over time).


Formalizing Stationarity: Weak vs. Strict

The intuitive definition is a great start, but in practice, we need more precise, mathematical definitions. This leads to a crucial distinction between two types of stationarity: strong (or strict) and weak (or covariance).

The next video clearly explains this distinction.

Weak Stationarity vs Strong Stationarity

In this video, Justin Eloriaga provides the formal definitions for strong and weak stationarity.

Please watch the following two segments: The explanation of strong stationarity from this timestamp. Focus on the idea that the entire joint probability distribution of the data must be invariant to shifts in time. The definition of weak stationarity from this timestamp. Note that this is a more relaxed condition, focusing only on the first and second moments (mean, variance, and autocovariance).

As you saw, strong stationarity is a very restrictive condition. It requires the entire probability distribution—including all its moments (mean, variance, skewness, kurtosis, etc.)—to remain identical through time. While this is theoretically clean, it's rarely met by real-world data, especially in economics and commerce.

This is why, for most practical applications, we rely on weak stationarity. The conditions for weak stationarity are precisely the ones we discussed intuitively, but stated mathematically:

A time series is weakly stationary if it satisfies three conditions:

  1. The mean is constant:
  2. The variance is constant:
  3. The autocovariance depends only on the lag:

The third condition is the most subtle. It says the covariance between two points only depends on how far apart they are in time (the lag ), not on where they are in the series (the time ). This is the condition that seasonality violates.

For a deeper look at these formal definitions, you can consult the following resource.

Lecture 13 Time Series: Stationarity, AR(p) & MA(q)

These lecture notes from the University of Houston provide the rigorous mathematical definitions of stationarity.

Please read the following sections: Start at the heading Time Series – Stationarity on page 8. Read through the definitions of different orders of stationarity and how they relate to the moments of the distribution. Continue to the next heading, Time Series – Weak Stationary, on page 11. Read the formal definition. This directly corresponds to the three conditions listed above.

From here on, unless specified otherwise, "stationarity" will refer to weak stationarity, as it is the standard for building classical time series models.


Why Does Stationarity Matter?

Now for the crucial question: why do we care so much about this property? Why do models like ARIMA assume it?

The fundamental reason is learnability and predictability. Classical forecasting models work by learning the statistical properties of a time series from past data. They estimate a mean, a variance, and an autocorrelation structure. The central assumption is that these learned properties will remain the same in the future. The model then uses these stable properties to make predictions.

If the series is non-stationary, this core assumption is broken.

  • If there's a trend (non-constant mean), what is the "mean" of the series? It's changing. The average value from the first half of your data is a poor estimate for the average value in the future.
  • If the variance is changing, a model might predict a range of future values that is far too narrow or wide.
  • If the covariance structure changes, the way past values relate to future values is not stable, making historical correlations a misleading guide.

Let's illustrate with a classic non-stationary process: the random walk. A random walk with drift is defined as , where is white noise. This model essentially says that the value at time is the previous value plus a constant drift and a random shock. Stock prices and other financial series are often modeled this way.

The lecture notes you just consulted show precisely why this process is non-stationary.

Lecture 13 Time Series: Stationarity, AR(p) & MA(q)

This section of the lecture notes derives the mean and variance for a random walk process.

Find the section titled Time Series – Non-Stationarity: Example on page 14. Read the derivation for the mean and variance of the random walk with drift.

As the derivation shows, both the mean () and the variance () depend explicitly on time . They are not constant. A model that assumes a constant mean would fail to capture the behavior of a random walk. This is why models that contain a "unit root" (like a random walk where the coefficient on is 1) are non-stationary and require special handling.

This is the primary motivation for the techniques we will learn in upcoming lessons. We will need to:

  1. Test for stationarity to see if a problem exists.
  2. Transform non-stationary data to make it stationary before we can apply models like ARIMA. The decomposition you performed in the last lesson is a first step—by isolating and removing the trend and seasonal components, you are in effect trying to produce a stationary residual series.

Conclusion

In this lesson, we have formally defined stationarity and explored its critical importance for time series modeling. This concept acts as a bridge between observing the structure of a time series and formally modeling it.

Here are the key takeaways:

  • A stationary process has statistical properties (mean, variance, covariance structure) that do not change over time.
  • Strict stationarity requires the entire joint probability distribution to be time-invariant, a condition rarely met in practice.
  • Weak stationarity is a more practical definition, requiring only the mean, variance, and autocovariance to be constant. This is the standard assumption for many classical models.
  • Stationarity is crucial because it ensures that the patterns learned from the past are a reliable guide for the future. Models like ARIMA depend on this stability to make predictions.
  • Common sources of non-stationarity, such as trends and seasonality, must be identified and handled before applying these models.

You now understand what stationarity is and why it's so important. The natural next question is, "How do I know if my data is stationary?" In our next lesson, we will answer exactly that. We will move from visual inspection to formal statistical procedures, learning how to use the Augmented Dickey-Fuller (ADF) and KPSS tests to rigorously check for stationarity in your data.