Skip to content

Panel VAR Tutorials

Learning Path

Prerequisites: Time series basics, GMM concepts helpful Time: 4--7 hours Level: Intermediate -- Advanced

Overview

Panel Vector Autoregression (Panel VAR) combines the multivariate structure of VAR models with the cross-sectional richness of panel data. This allows researchers to study dynamic interdependencies between multiple variables across many entities, while controlling for unobserved heterogeneity.

These tutorials cover the complete Panel VAR workflow: estimation via OLS and GMM, impulse response functions (IRFs), forecast error variance decomposition (FEVD), Granger causality testing, and the error-correction extension (VECM) for cointegrated panels. You will learn to select lag orders, assess model stability, and generate forecasts.

The existing Panel VAR Complete Guide provides additional theoretical context and a comprehensive decision tree for choosing between VAR and VECM.

Notebooks

# Tutorial Level Time Colab
1 Panel VAR Introduction Intermediate 45 min Open In Colab
2 IRF Analysis Intermediate 45 min Open In Colab
3 FEVD (Variance Decomposition) Intermediate 45 min Open In Colab
4 Granger Causality Intermediate 45 min Open In Colab
5 VECM (Cointegration) Advanced 60 min Open In Colab
6 Dynamic GMM Estimation Advanced 60 min Open In Colab
7 Case Study Advanced 60 min Open In Colab

Learning Paths

Core (4 hours)

Essential Panel VAR methods:

Notebooks: 1, 2, 3, 4

Covers estimation, IRFs, FEVD, and Granger causality. Sufficient for most empirical applications.

Advanced (7 hours)

Complete Panel VAR and VECM coverage:

Notebooks: 1--7

Adds VECM for cointegrated systems, GMM-based estimation, and a full applied case study.

Key Concepts Covered

  • Panel VAR specification: Lag selection (AIC, BIC, HQIC)
  • OLS and GMM estimation: Fixed effects with Helmert transformation
  • Impulse Response Functions: Orthogonalized and cumulative IRFs
  • FEVD: Variance decomposition over forecast horizons
  • Granger causality: Testing predictive relationships
  • Model stability: Eigenvalue tests and companion matrix
  • VECM: Error-correction models for cointegrated panels
  • Forecasting: Out-of-sample prediction with Panel VAR

Quick Example

from panelbox.var import PanelVAR

# Estimate a Panel VAR
var = PanelVAR(
    data=data,
    variables=["gdp", "investment", "consumption"],
    entity_col="country",
    time_col="year",
    lags=2
).fit()

# Impulse Response Functions
irf = var.irf(periods=10)
irf.plot()

# Granger Causality
gc = var.granger_causality()
print(gc.summary())

Solutions

Tutorial Solution
01. VAR Introduction Solution
02. IRF Analysis Solution
03. FEVD Decomposition Solution
04. Granger Causality Solution
05. VECM Cointegration Solution
06. Dynamic GMM Solution
07. Case Study Solution