14 — Advanced Models

VAR Models#

Advanced✓ Mathematical
◆ The PatternMultiple series forecasting each other

Vector Autoregression (VAR) generalises AR to multiple interrelated series. Each variable is modeled as a linear function of all variables’ lags. Granger causality tests whether one series helps predict another. Impulse response functions show how shocks propagate.

Yt = c + A1Yt−1 + A2Yt−2 + … + ApYt−p + εt
Y is a vector of all variables. Each A is a coefficient matrix capturing cross-series dependencies at that lag.
// Interactive — VAR impulse response
# Python — VAR
from statsmodels.tsa.api import VAR

model = VAR(df[['gdp', 'inflation', 'unemployment']])
results = model.fit(maxlags=4, ic='aic')
# Granger causality test
results.test_causality('gdp', ['inflation'], kind='f')
# Impulse response
irf = results.irf(20)
irf.plot()
Pattern bridge: VAR captures how variables influence each other — the same idea as correlation matrices but with temporal structure. In markets, cross-asset correlations and intermarket analysis are VAR in practice.
← Previous
GARCH
Open in the full reader, with the topic sidebar →