Lesson 45

Multiple Time Series

Big question

When several series move together, which relationships are short-run predictive and which are long-run equilibrating?

Lesson progress

Complete checkpoints as you learn

0% complete0 checkpoint streak
Progress tracking available after sign-in. Sign in to save your work.
Big question
Concept
Activity
Quiz

Learning objectives

  • Compute cross-correlation structures.
  • Estimate and diagnose VAR models.
  • Interpret Granger predictability and impulse responses cautiously.
  • Test cointegration and describe VECM adjustment.
  • Prerequisites: Chapters 18 to 20.
  • Key terms: cross-correlation, VAR, Granger predictability, impulse response, cointegration, VECM.

Simple explanation

A vector autoregression treats each variable as a function of lags of all variables in the system. This can improve forecasts when series contain complementary predictive information. The number of parameters grows quickly with variables and lags, making lag selection, sample size, and regularization important. Residual cross-correlation and serial diagnostics determine whether the system has captured its own dynamics.

Key terms

Compute cross-correlation structures
A core idea in Chapter 45 that students apply carefully in economic analysis.
Estimate and diagnose VAR models
A core idea in Chapter 45 that students apply carefully in economic analysis.
Granger predictability and impulse responses cautiously
A core idea in Chapter 45 that students apply carefully in economic analysis.
Test cointegration and describe VECM adjustment
A core idea in Chapter 45 that students apply carefully in economic analysis.
Prerequisites: Chapters 18 to 20
A core idea in Chapter 45 that students apply carefully in economic analysis.
Key terms: cross-correlation, VAR, Granger predictability, impulse response, cointegration, VECM
A core idea in Chapter 45 that students apply carefully in economic analysis.

Analytical workflow

Question+data+assumptions+transparentPython>evidenceQuestion + data + assumptions + transparent Python -> evidence

Interpret the expression in words and units before using it in a claim.

Example

Interpretation. The estimated lag matrix is close to the simulated system, with sampling variation.

Prerequisites

  • Complete the preceding course chapters or review their summaries as needed.

Full theory and examples

45.2

A vector model uses shared information

A vector autoregression treats each variable as a function of lags of all variables in the system. This can improve forecasts when series contain complementary predictive information. The number of parameters grows quickly with variables and lags, making lag selection, sample size, and regularization important. Residual cross-correlation and serial diagnostics determine whether the system has captured its own dynamics.

45.3

Predictive ordering is not structural causation

A Granger test asks whether lags of one variable improve prediction of another conditional on the model. Rejection can reflect omitted common causes, measurement timing, policy anticipation, or data aggregation. Impulse responses trace a model’s response to shocks, but contemporaneous identification requires assumptions such as variable ordering or structural restrictions. Those assumptions must be stated beside the graph.

45.4

Cointegration separates short and long horizons

Two or more unit-root series can share a stationary linear combination. Cointegration implies a long-run relation, while a vector error-correction model describes both short-run changes and adjustment toward that relation. Johansen methods estimate cointegrating rank and vectors under a specified deterministic and lag structure (Johansen 1988). Cointegration is not guaranteed arbitrage; trading costs, breaks, and data snooping can erase apparent opportunity.

45.5

Core equations

VAR(1)

Each variable can depend on all variables at the previous lag.

VECM

The rank of Pi determines the number of cointegrating relations.

45.6

Python demonstrations

45.6.1

Demonstration 26.1: Estimate a small VAR

Verified output

Interpretation. The estimated lag matrix is close to the simulated system, with sampling variation.

45.6.2

Demonstration 26.2: Test a cointegrating spread

Verified output

Interpretation. The constructed spread is stationary even though the two levels inherit a shared stochastic trend.

45.7

Visual evidence

45.8

Reference table

Why This Matters

Multivariate models separate joint prediction, shock identification, and long-run adjustment into distinct analytical questions.

Common Mistake

Calling a Granger test evidence that one policy variable causes another outcome.

Ceteris LAB Tip

Write the contemporaneous identification assumption directly in the impulse-response caption.

R-to-Python / Source Bridge

The final source lecture develops cross-covariance, VAR, Granger relations, cointegration, Johansen testing, and pairs trading. Python replaces custom R scripts with statsmodels VAR/VECM tools and stronger identification cautions (Tsay 2013).

Table 26. Chapter reference.
OutputWhat it answersRequired caution
VAR coefficientconditional lag relationsystem scale and many tests
Granger testincremental predictive contentnot structural causality
impulse responsedynamic response to identified shockordering/restriction dependence
cointegrating vectorstationary long-run combinationnormalization and breaks
error-correction loadingspeed/direction of adjustmentmodel specification

Visual evidence

Figure 42. A synthetic lead-lag relationship peaks near a lag of two periods.
Figure 42. A synthetic lead-lag relationship peaks near a lag of two periods.
Figure 43. A bivariate VAR forecast for U.S. GDP growth and changes in unemployment.
Figure 43. A bivariate VAR forecast for U.S. GDP growth and changes in unemployment.
Figure 44. Illustrative response of GDP growth to the second VAR innovation.
Figure 44. Illustrative response of GDP growth to the second VAR innovation.
Figure 45. Simulated cointegrated prices and their mean-reverting linear combination.
Figure 45. Simulated cointegrated prices and their mean-reverting linear combination.
Figure 46. A cointegration-spread z-score with illustrative entry thresholds.
Figure 46. A cointegration-spread z-score with illustrative entry thresholds.
Original Ceteris Lab course figure
Original Ceteris Lab course figure

Additional Python demonstrations

Live Python

Source demonstration 2

Source demonstration 2

Stdout

Run Python to see results here.

Status / stderr

Ready to run Python in your browser.

Line-by-line guide

  1. Line 1Load a Python library needed for data work or regression.
  2. Line 2Load a Python library needed for data work or regression.
  3. Line 4Create or update a Python object used in the analysis.
  4. Line 5Create or update a Python object used in the analysis.
  5. Line 6Create or update a Python object used in the analysis.
  6. Line 7Create or update a Python object used in the analysis.
  7. Line 8Create or update a Python object used in the analysis.
  8. Line 9Display a result so students can inspect the output.

Verified source output

[[ 0.55 0.15] [-0.13 0.47]]
0.00e+00
[[ 0.55  0.15]
 [-0.13  0.47]]

Interpretation. The estimated lag matrix is close to the simulated system, with sampling variation.

Interpretation. The constructed spread is stationary even though the two levels inherit a shared stochastic trend.

Guided practice

  1. 1Re-run Demonstration 26.1 and change one input while keeping the analytical question fixed.
  2. 2Explain in two sentences how the output supports, or fails to support, the chapter opening question.
  3. 3Add one validation check that would prevent a plausible error.

Exercises

  1. 1Fit a bivariate VAR and select lags by AIC and BIC.
  2. 2Test each predictive direction.
  3. 3Compare impulse responses under two variable orderings.
  4. 4Simulate cointegrated series and estimate a VECM.

Source and downloads

Chapter 45 of Fundamentals of Python for Financial Econometrics by Mohammad Safavi, Ph.D.. The lesson is an original Ceteris Lab web adaptation of the supplied publication package.

Live Python

Multiple Time Series: live Python

Multiple Time Series: live Python

Stdout

Run Python to see results here.

Status / stderr

Ready to run Python in your browser.

Line-by-line guide

  1. Line 1Load a Python library needed for data work or regression.
  2. Line 2Load a Python library needed for data work or regression.
  3. Line 3Load a Python library needed for data work or regression.
  4. Line 5Create or update a Python object used in the analysis.
  5. Line 6Create or update a Python object used in the analysis.
  6. Line 7Run this Python instruction as part of the lesson workflow.
  7. Line 8Create or update a Python object used in the analysis.
  8. Line 9Create or update a Python object used in the analysis.
  9. Line 10Create or update a Python object used in the analysis.
  10. Line 11Display a result so students can inspect the output.

Python walkthrough

  1. 1`import numpy as np`: Loads a package or function used by the analysis.
  2. 2`import pandas as pd`: Loads a package or function used by the analysis.
  3. 3`from statsmodels.tsa.api import VAR`: Loads a package or function used by the analysis.
  4. 4`rng = np.random.default_rng(26)`: Creates or updates a named object used by later steps.
  5. 5`y = np.zeros((400, 2))`: Creates or updates a named object used by later steps.
  6. 6`for t in range(1, 400):`: Repeats the indented calculation across observations or simulation draws.
  7. 7`y[t] = [0.55*y[t-1,0] + 0.20*y[t-1,1], -0.10*y[t-1,0] + 0.45*y[t-1,1]] + rng.normal(scale=0.`: Creates or updates a named object used by later steps.
  8. 8`df = pd.DataFrame(y, columns=["x", "z"])`: Creates or updates a named object used by later steps.
  9. 9`fit = VAR(df).fit(1)`: Fits the specified statistical or machine-learning model.
  10. 10`print(fit.coefs[0].round(2))`: Displays a result so it can be checked and interpreted.

Live notebook

Run this lesson as a notebook

Open an editable notebook cell-by-cell, run Python in the browser, and download the `.ipynb` file for later.

Related dataset

Ceteris Lab teaching sample

Estimated time

25 to 40 min

Packages

pandas, numpy

Expected output

Printed Python results that can be compared with the lesson explanation.

Learning goals

  • Load and inspect Ceteris Lab teaching sample.
  • Run the Python cells connected to Multiple Time Series.
  • Interpret the output using Compute cross-correlation structures and Estimate and diagnose VAR models.

Common errors

  • File not found: check that wage_sample.csv is installed or use the course data folder.
  • Package import error: use the browser notebook first, then download for local Jupyter if your local packages differ.
  • Column name error: compare your variable names with the dataset variables listed for this notebook.

Dataset path helper

import pandas as pd

df = pd.read_csv("/data/wage_sample.csv")
df.head()

Interactive activity

Chapter 45 interactive

Assumption stress test

Evidence strength: 55%
Weak designCredible design

What should determine the strength of an econometric claim?

Immediate feedback

Choose a decision, then test how the claim changes as evidence becomes stronger or weaker.

Try it yourself

Write one plain-English sentence explaining the main idea from this lesson.

Common mistakes

Check these before you move on.

Return to the lesson assumptions, units, diagnostics, and source evidence to replace this shortcut with a defensible interpretation.

Quick quiz

Which statement best answers the Chapter 45 opening question: When several series move together, which relationships are short-run predictive and which are long-run equilibrating?

Quick quiz

Which practice should be avoided when applying Multiple Time Series?

Quick quiz

What is the most defensible way to interpret the Python demonstration?

Quick quiz

Why does Chapter 45 matter in an applied econometrics workflow?

Key takeaway

VAR models exploit cross-series lag information. Granger tests are predictive, not structural. Cointegration and VECM connect nonstationary levels to stationary long-run combinations.