Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Chapter 22 — VAR Models

In earlier chapters, we studied models involving a single time series.

For example:

These models are powerful when the focus is a single variable through time.

But many economic and financial systems involve several variables evolving together.

Examples include:

Economic systems often involve:

Vector autoregression (VAR) models were developed precisely for this purpose.

VAR models allow multiple variables, feedback channels, and dynamic interactions to be modeled jointly.

This chapter introduces:

The emphasis remains intuition-first and applications-oriented.


Learning Objectives

By the end of this chapter, you should be able to:


22.1 Why Multivariate Models?

Economic variables rarely move independently.

For example:

A univariate AR model ignores these interactions.

VAR models attempt to capture them directly.


22.2 From AR Models to VAR Models

Recall the AR(1) model:

yt=α+ϕyt1+ety_t = \alpha + \phi y_{t-1} + e_t

The current value depends on:

Extending to Multiple Variables

Suppose we have two variables:

A VAR allows each variable to depend on:


22.3 A Simple VAR(1)

A two-variable VAR(1) may be written:

πt=α1+β11πt1+β12rt1+u1t\pi_t = \alpha_1 + \beta_{11}\pi_{t-1} + \beta_{12}r_{t-1} + u_{1t}
rt=α2+β21πt1+β22rt1+u2tr_t = \alpha_2 + \beta_{21}\pi_{t-1} + \beta_{22}r_{t-1} + u_{2t}

where:


VAR models became highly influential in macroeconomics and finance because they provide a flexible framework for studying dynamic interactions across variables.

Christopher Sims argued that many macroeconomic systems should be modeled jointly rather than through isolated single equations.

This contrasts with traditional regression models where some variables are treated as purely explanatory.


22.5 Endogenous and Exogenous Variables

In many regression models:

VAR models are different.

This means:

The relationship is dynamic and simultaneous through time.


22.6 Reduced Form VARs

The most common VAR specification is the reduced form VAR.

A reduced form VAR expresses each variable as a function of lagged values of all variables in the system.

Example

Suppose we model:

Then each equation includes:


22.7 VAR(p) Models

A VAR with multiple lags is written as VAR(pp).

For example:

General Form

Yt=A0+A1Yt1+A2Yt2++ApYtp+utY_t = A_0 + A_1 Y_{t-1} + A_2 Y_{t-2} + \cdots + A_p Y_{t-p} + u_t

where:

As the number of variables and lags increases, estimation becomes more complex.


22.8 Stationarity in VAR Models

Stationarity remains important in multivariate time series models.

Standard VAR models are typically estimated using stationary variables.

If variables are nonstationary:

Common Approaches

If variables are nonstationary:

We studied unit roots and cointegration earlier in the book.

Differencing may remove important long-run information when variables are cointegrated.


22.9 Example: Inflation and Interest Rates

Suppose inflation rises persistently.

Central banks may respond by:

But higher interest rates may later reduce:

VAR models attempt to capture these dynamic feedback effects.


22.10 Estimating a VAR in Python

We now estimate a simple VAR using financial data.

The system contains two variables:

This example is useful because returns and volatility often interact dynamically.

For example:

import yfinance as yf
import pandas as pd
import numpy as np

from statsmodels.tsa.api import VAR

# Download SPY data
spy = yf.download(
    "SPY",
    start="2015-01-01",
    auto_adjust=False
)

# Extract adjusted close prices
prices = spy["Adj Close"]

# Compute daily log returns in percent
returns = 100 * np.log(
    prices / prices.shift(1)
)

# Rolling 20-day volatility proxy
volatility = returns.rolling(20).std()

# Combine variables
data = pd.concat(
    [returns, volatility],
    axis=1
)

data.columns = [
    "Returns",
    "Volatility"
]

data = data.dropna()

# Estimate VAR(2)
model = VAR(data)

results = model.fit(2)

print(results.summary())
  Summary of Regression Results   
==================================
Model:                         VAR
Method:                        OLS
Date:           Thu, 07, May, 2026
Time:                     16:08:54
--------------------------------------------------------------------
No. of Equations:         2.00000    BIC:                   -4.95229
Nobs:                     2830.00    HQIC:                  -4.96572
Log likelihood:          -983.966    FPE:                 0.00692024
AIC:                     -4.97330    Det(Omega_mle):      0.00689585
--------------------------------------------------------------------
Results for equation Returns
================================================================================
                   coefficient       std. error           t-stat            prob
--------------------------------------------------------------------------------
const                 0.003909         0.037664            0.104           0.917
L1.Returns           -0.116688         0.018935           -6.162           0.000
L1.Volatility        -0.517839         0.271001           -1.911           0.056
L2.Returns            0.051612         0.018954            2.723           0.006
L2.Volatility         0.572478         0.271108            2.112           0.035
================================================================================

Results for equation Volatility
================================================================================
                   coefficient       std. error           t-stat            prob
--------------------------------------------------------------------------------
const                 0.009302         0.002573            3.615           0.000
L1.Returns           -0.008181         0.001294           -6.324           0.000
L1.Volatility         1.176947         0.018513           63.574           0.000
L2.Returns           -0.006876         0.001295           -5.310           0.000
L2.Volatility        -0.186193         0.018520          -10.053           0.000
================================================================================

Correlation matrix of residuals
               Returns  Volatility
Returns       1.000000   -0.122110
Volatility   -0.122110    1.000000

22.11 Reading VAR Output

A VAR output table may initially appear overwhelming.

Remember:

Rather than focusing immediately on individual coefficients, it is often more useful to ask broader questions:

This is one reason impulse response analysis becomes especially important in multivariate time series models.


22.12 Choosing Lag Lengths

One important decision is:

How many lags should be included?

Too few lags:

Too many lags:


Information Criteria

VAR lag lengths are often selected using:

Intuition

These criteria balance:


22.13 Lag Selection in Python

lag_selection = model.select_order(10)

print(lag_selection.summary())
 VAR Order Selection (* highlights the minimums)  
==================================================
       AIC         BIC         FPE         HQIC   
--------------------------------------------------
0      -0.7217     -0.7174      0.4859     -0.7201
1       -4.917      -4.904    0.007321      -4.912
2       -4.967      -4.946    0.006962      -4.960
3       -4.991      -4.962    0.006797      -4.981
4       -5.028      -4.990    0.006550      -5.015
5       -5.046      -4.999    0.006436      -5.029
6       -5.060      -5.006    0.006343      -5.041
7       -5.071      -5.007    0.006278      -5.048
8       -5.078      -5.006    0.006232      -5.052
9       -5.089     -5.009*    0.006166     -5.060*
10     -5.090*      -5.002   0.006155*      -5.058
--------------------------------------------------

In practice:

also matter.


22.14 Stability of VAR Models

A stable VAR system eventually absorbs shocks.

After temporary disturbances:

An unstable system may instead produce explosive dynamics.

Intuition

Suppose a shock temporarily increases inflation.

In a stable system:

In an unstable system:

Stability and Dynamic Systems

VAR models are dynamic systems.

Small changes today may influence future periods through recursive feedback.

A stable system prevents these effects from growing indefinitely.

This idea becomes especially important when studying:

22.15 Inverse Roots and Stability

One common way to assess VAR stability is through inverse roots plots.

A stable VAR requires all inverse roots to lie inside the unit circle.

Intuition

The unit circle acts like a stability boundary.

Inside the circle → stable dynamics Outside the circle → unstable or explosive dynamics

Add this inverse-roots code

import matplotlib.pyplot as plt
import numpy as np

# Statsmodels reports roots of the VAR characteristic polynomial.
# Stability requires these roots to lie outside the unit circle.
# Inverse roots should therefore lie inside the unit circle.

inverse_roots = 1 / results.roots

fig, ax = plt.subplots(figsize=(6,6))

circle = plt.Circle(
    (0, 0),
    1,
    fill=False,
    linestyle="--"
)

ax.add_artist(circle)

ax.scatter(
    inverse_roots.real,
    inverse_roots.imag
)

ax.axhline(0, linewidth=1)
ax.axvline(0, linewidth=1)

ax.set_xlim(-1.2, 1.2)
ax.set_ylim(-1.2, 1.2)
ax.set_aspect("equal")

ax.set_title("Inverse Roots of the VAR Model")
ax.set_xlabel("Real")
ax.set_ylabel("Imaginary")

plt.savefig("figs/ch22/inverse_roots.png", dpi=300, bbox_inches="tight")
plt.close()
Inverse Root

22.16 Forecasting with VAR Models

VAR models are widely used for forecasting because they incorporate:

Unlike univariate models, VAR forecasts allow information from several variables to influence future predictions jointly.


22.17 Dynamic Forecasting in VAR Models

VAR forecasts are recursive.

Forecasts for future periods depend partly on previous forecasts.

For example:

Y^t+2\hat Y_{t+2}

depends partly on:

Y^t+1\hat Y_{t+1}

This recursive structure allows VAR models to capture rich dynamic interactions across variables.

Intuition

Suppose stock-market volatility rises unexpectedly.

The VAR may predict:

This creates dynamic forecast paths rather than isolated predictions.

22.18 VAR Forecasting in Python

VAR models are widely used for forecasting.

Because they incorporate:

they often outperform simple univariate models.


Example: VAR Forecasting

forecast = results.forecast(
    data.values[-2:],
    steps=10
)

forecast_df = pd.DataFrame(
    forecast,
    columns=data.columns
)

print(forecast_df)
    Returns  Volatility
0 -0.007599    0.600904
1  0.130212    0.588281
2  0.027692    0.588780
3  0.039283    0.591609
4  0.031460    0.595456
5  0.032598    0.599441
6  0.032200    0.603460
7  0.032506    0.607443
8  0.032688    0.611383
9  0.032922    0.615275

22.19 Beyond Coefficients: Dynamic Responses

VAR coefficient tables alone are often difficult to interpret economically.

Because variables interact dynamically through time, economists frequently analyze systems using:

These tools help trace:

The next chapter develops these ideas in detail.


22.20 Common Applications of VAR Models

VARs are widely used in:

Financial Applications

Examples include:


22.21 Gretl Example: Estimating a VAR

Gretl provides built-in tools for VAR estimation.


Step 1

Load multiple time series.

Example:


Step 2

Menu:

Model → Time Series → VAR

Step 3

Choose:


[GRETL Screenshot Placeholder: VAR specification window]

Gretl Diagnostics

After estimation, GRETL provides:


[GRETL Screenshot Placeholder: VAR output]

22.23 Common Mistakes

22.24 Looking Ahead

VAR models provide a flexible framework for studying interacting time series systems.

But coefficient tables alone rarely provide the clearest economic interpretation.

The next chapter introduces impulse response functions (IRFs), which trace how shocks propagate dynamically through multivariate systems.

We will move from:


Key Takeaways

Concept Check

Basic

  1. What is a VAR model?

  2. How does a VAR differ from a univariate AR model?

  3. What does it mean for all variables in a VAR to be endogenous?


Intuition

  1. Why are multivariate models important in economics?

  2. What type of interactions can VAR models capture?

  3. Why is it unrealistic to model macroeconomic variables in isolation?


Structure

  1. In a VAR(1), what variables appear on the right-hand side?

  2. What does VAR(pp) mean?

  3. Why does the number of parameters increase quickly in VAR models?


Stationarity

  1. Why is stationarity important in VAR models?

  2. What are the consequences of estimating a VAR with nonstationary data?


Challenge

  1. Why are VAR coefficients often difficult to interpret directly?


Interpretation & Practice

  1. A VAR model shows that:


  1. A VAR is estimated with too few lags.

    • What might happen?


  1. A VAR is estimated with too many lags.

    • What problem might arise?


  1. A model includes multiple variables with strong feedback.

    • Why might a VAR be appropriate?


Lag Selection

  1. AIC suggests 5 lags, BIC suggests 2 lags.

    • Why might these differ?

    • Which might you prefer?


Stationarity

  1. Variables appear to be nonstationary.

    • What should you do before estimating a VAR?


Numerical Practice

VAR Interpretation

  1. Consider a VAR(1):

yt=0.5yt1+0.3xt1y_t = 0.5y_{t-1} + 0.3x_{t-1}
xt=0.2yt1+0.6xt1x_t = 0.2y_{t-1} + 0.6x_{t-1}

Lag Structure

  1. Suppose you increase lag length from 1 to 4.


Information Criteria

  1. Suppose:

LagAICBIC
1-4.5-4.4
2-4.8-4.6
3-4.9-4.5

Interpretation

  1. Suppose a variable responds strongly to its own lag.


Diagnostics

  1. Residuals show autocorrelation.


Challenge

  1. Suppose a VAR includes 5 variables and 4 lags.


Interpretation

  1. A coefficient on lagged inflation is positive and significant.

    • What does this imply?

    • Why might interpretation still be limited?


Challenge

  1. Why should VAR results be interpreted using IRFs rather than raw coefficients?

  2. Forecasting with VAR


Interpretation

Forecasts depend on previous forecasts.


Appendix 22A — Why VARs Became Influential

VARs became highly influential because they offered a systematic way to model rich dynamics across multiple time series.

Earlier macroeconomic models often relied heavily on strong theoretical restrictions.

VARs instead emphasized:

This made them especially attractive for applied macroeconomics and finance.


Appendix 22B — Dynamic Forecasting

VAR forecasts are dynamic because future values depend recursively on previous forecasts.

For example:

Y^t+2\hat Y_{t+2}

depends partly on:

Y^t+1\hat Y_{t+1}

This recursive structure is one reason VAR forecasting can capture complex dynamic interactions across variables.