Lesson 4.2: Cointegration and Error Correction Models (VECM)
Finding stable, long-run equilibrium relationships between non-stationary series.
Part 1: The 'Drunk and Her Dog' Analogy
The Core Idea
Imagine a drunk person (a random walk) and their dog (another random walk). Both paths are non-stationary. But they are connected by a leash. They can't wander infinitely far apart. The **distance between them** is stationary and mean-reverting.
This is cointegration. It's a stable, long-run relationship between two or more non-stationary variables.
Part 2: Cointegration and The VECM
Definition of Cointegration
Two series, and , are cointegrated if a linear combination of them, , is stationary (). The vector is the cointegrating vector.
A VECM combines short-run dynamics (like a VAR in differences) with long-run equilibrium. It models the *change* in a variable based on lagged changes AND the "error correction term" from the previous period (the lagged cointegrating relationship).
The coefficient is the "speed of adjustment," telling us how quickly the variable corrects back towards the long-run equilibrium.
Part 3: Testing and Application
We test for cointegration using the **Engle-Granger** or **Johansen** tests. If found, it's the theoretical foundation for **pairs trading**, a market-neutral strategy that bets on the convergence of the spread between two cointegrated assets.
What's Next? State Space Models
The VAR/VECM framework models observed variables. But what if the true "state" of the system (like the "true" inflation rate) is unobservable and we only have noisy measurements?
In the next lesson, we'll explore **State Space Models and the Kalman Filter**, a powerful framework for estimating such hidden states.