ECON 410 · Econometrics II: Causal Methods and Time Series
Cointegration and Vector Autoregressions
How two wandering series can share a stable long-run link, and how to model several series that influence each other.
Key takeaways
- Two series that each have a unit root are cointegrated if some combination of them is stationary, so they cannot drift apart for long.
- A cointegrated pair can be written as an error correction model, where each period closes part of the gap from the long-run relationship.
- Regressing wandering series on each other is safe only when they are cointegrated; the residuals must be tested.
- A VAR models several series together, with each one depending on past values of every series.
- Granger causality asks whether one series helps predict another; it is about prediction, not about true cause.
A woman walks her dog through a park. She wanders: left, right, a stop at the bench. The dog wanders too, sniffing and darting off. Plot either path alone and you see a random walk with no home. But plot them together and you notice something. The dog never gets far from the leash's end. Both wander, yet the distance between them stays small.
That is the big idea of this lesson. Two series can each wander without any anchor, and still be tied together by a long-run relationship. Economists call this cointegration. It matters because it rescues the claim that two trending series can truly be linked. The lesson on spurious regression warned that unrelated wanderers fool us. Cointegration is the case where the link is real.
The second half of the lesson turns to a tool for several series at once: the vector autoregression, or VAR. It lets each variable depend on the past of all the others.
The dog on the leash
Let us make the walk concrete. Say bushels of wheat are sold in two neighboring cities, A and B. Each city's price wanders from month to month with farm weather, fuel costs and news. Neither price has a fixed home.
But traders can buy wheat in the cheap city and sell in the dear one. If A gets much more expensive than B, trucks start moving, and the gap closes. So the two prices can drift together over years, yet the gap between them stays within a narrow range.
In the picture, both lines climb and wobble. But the gap, A minus B, is 3, 3, 2, 3, 2, 3, 2. That gap is stationary: it hovers near 2.6 and does not wander. Each price alone has a unit root, yet a mix of the two (A minus B) does not. That is the definition. The mix, here a simple difference, is the cointegrating relationship, and it is the stable long-run link.
Why it matters: the equilibrium and the correction
The cointegrating relationship acts like a long-run equilibrium, a position the system keeps returning to. When the gap gets stretched, forces pull it back. This pull is captured by an error correction model (ECM). The "error" is how far the system is from its long-run link, and the "correction" is how much of that error gets fixed each period.
A simple version for the price of City A:
Change in A = −0.3 × (gap yesterday) + shocks The −0.3 is the speed of adjustment. A negative sign means a too-large gap pushes the price down. Suppose the long-run gap should be 0 (to keep the math clean) and the gap has been pushed out to 10, with A at 60 and B at 50. If B stays put and no new shocks arrive, here is what happens:
Period 1: gap 10 → A falls by 0.3 × 10 = 3 → A = 57, gap = 7
Period 2: gap 7 → A falls by 0.3 × 7 = 2.1 → A = 54.9, gap = 4.9
Period 3: gap 4.9 → A falls by 0.3 × 4.9 = 1.47 → A = 53.43, gap = 3.43 The gap is 10, 7, 4.9, 3.43. Each period it shrinks by 30%, so it keeps 70%. Check: 10 × 0.7 = 7, 7 × 0.7 = 4.9, 4.9 × 0.7 = 3.43. That is the same fading pattern from an AR model with a coefficient of 0.7. The wandering parts of the two series remain, but the distance between them is pulled home.
Testing for cointegration
How do you find out whether two series are cointegrated? The classic recipe is the Engle-Granger two-step method, from Robert Engle and Clive Granger, who shared the 2003 Nobel Prize in economics for related work.
- Check that each series has a unit root, using the tests from the earlier lesson. If either is stationary, cointegration is not the right question.
- Regress one series on the other and save the leftover errors, the residuals.
- Test the residuals for a unit root. If they are stationary, the pair is cointegrated. If they wander, the regression was spurious.
There is a catch. The residuals come from an estimated regression, so the usual Dickey-Fuller cutoffs are not quite right, and Engle-Granger style tests use their own table, built into software. A newer method, the Johansen test, handles more than two series and can find several cointegrating relationships at once. For a system of k wandering series, there can be anywhere from none up to k − 1 independent links.
One more caution: the result depends on having a long enough sample. Cointegration is a statement about the long run, and with 20 observations the test has little power.
Vector autoregressions: letting every variable talk
Now suppose you want to study several series that influence each other, such as sales and advertising. Advertising affects tomorrow's sales, and a sales jump may lead the owner to spend more on ads. A one-equation model cannot capture that two-way street.
A vector autoregression (VAR) fixes this by writing one equation for each variable, and putting the past of every variable on the right side of each. Christopher Sims popularized it in the 1980s, and it shared in the 2011 Nobel Prize in economics, in part for that work. Here is a tiny made-up VAR with one lag. Let S be sales and A be ad spending, both measured as gaps from their averages:
S(today) = 0.5 × S(yesterday) + 0.2 × A(yesterday)
A(today) = 0.3 × S(yesterday) + 0.6 × A(yesterday) These coefficients are invented to show the mechanics, not estimates from real data. Notice that each variable depends on its own past and on the other's past. Together the pair forms one system.
A worked example: following a shock through the system
An impulse response traces what happens to the system after a one-time shock to one variable. Suppose today ad spending jumps by 1 unit above its average, with sales at 0. Follow the system forward using the equations:
Day 0: S = 0, A = 1
Day 1: S = 0.5×0 + 0.2×1 = 0.2 A = 0.3×0 + 0.6×1 = 0.6
Day 2: S = 0.5×0.2 + 0.2×0.6 = 0.22 A = 0.3×0.2 + 0.6×0.6 = 0.42
Day 3: S = 0.5×0.22 + 0.2×0.42 = 0.194 A = 0.3×0.22 + 0.6×0.42 = 0.318 Sales rise to 0.2, then 0.22, then fall to 0.194, while ads decay from 1 to 0.6, 0.42, 0.318. The ad shock first lifts sales, then fades. The sales response peaks on day 2 and then declines.
These pictures are the main product of a VAR. They show the timing of effects in a way a single regression cannot. They also come with a warning: to give a shock a causal meaning, you must decide the order in which variables react, and that choice is an assumption. A different order can tell a different story.
Granger causality: a test of prediction
A VAR also lets you ask a limited question. Do past values of ad spending help predict sales, beyond what past sales already predict? If yes, we say ads Granger-cause sales. The name honors Clive Granger. The test checks whether the coefficients on A's lags in the sales equation are jointly zero.
The word "cause" here is easy to misread. Granger causality is about predictive content. Suppose Maya orders extra ice every time she expects a heat wave. Ice orders would help predict smoothie sales, because ice orders reveal her forecast. But ice does not cause the hot weather. The hidden driver is the weather forecast. A series can "Granger-cause" another without causing it in the sense of potential outcomes, where we ask what would happen if we intervened.
What cointegration is not
Cointegration is not the same as high correlation. Two series can have a correlation of 0.99 in their changes and still drift apart forever, with nothing pulling them back. Cointegration is about the level gap having a home.
It is also not guaranteed forever. A long-run link can break when the world changes. If a new tax or a blocked road stops trucks from moving wheat between City A and City B, the leash is cut, and the gap can wander again. Researchers therefore test whether the relationship held steady across the sample, and they treat a long-run link as a finding about a period, not a law of nature.
Finally, a cointegrating relationship tells you that the gap is pulled back, not which price does the moving. In the error correction equation, either City A, City B or both can have a nonzero speed of adjustment. If only A adjusts, B leads and A follows.
A common mistake: the wrong model for the type of data
If you have wandering series and run a VAR in levels without thinking, the standard results can be unreliable. If you difference them all, and they were cointegrated, you throw away the long-run link, and your forecasts miss the pull toward equilibrium. The sensible path:
For one wandering series on its own, return to AR and MA models. The methods that estimate all of these models often rely on maximum likelihood.
Words to know
Cointegration a situation where several series each wander but a mix of them is stationary, so they share a stable long-run link.
Error correction model a model where each period's change partly corrects the gap from the long-run relationship.
Speed of adjustment the share of the gap that gets closed each period.
Engle-Granger method a two-step test that regresses one series on another and checks whether the residuals are stationary.
Vector autoregression (VAR) a system of equations in which each variable depends on past values of all the variables.
Impulse response the path of a system after a one-time shock to one variable.
Granger causality the finding that past values of one series help predict another series.
Check yourself
- In your own words, what does it mean for two series to be cointegrated?
- A gap is 20 and the speed of adjustment is 0.25 (the gap loses 25% each period). What is the gap after two periods?
- In the VAR above, suppose S = 2 and A = 0 today. What are S and A tomorrow?
- Why is a regression of one wandering series on another not automatically spurious?
- Explain why Granger causality does not prove that one variable causes another.
- If two series both have unit roots and are not cointegrated, which model is the usual choice and why?
Show the answers
- Each series wanders with a unit root, but some mix of them is stationary, so they stay tied together in the long run.
- Each period keeps 75%: 20 × 0.75 = 15, then 15 × 0.75 = 11.25, so the gap is 11.25.
- S = 0.5×2 + 0.2×0 = 1; A = 0.3×2 + 0.6×0 = 0.6.
- If the two series are cointegrated, the residuals are stationary and the regression captures a real long-run link; only the residual test tells which case you have.
- It only shows that past values help predict the other series; a hidden third factor, such as a weather forecast, can drive both.
- A VAR in differences, because differencing makes each series stationary and, without a long-run link, nothing is lost by dropping the levels.