Skip to main content

VAR — Vector Autoregression

VAR models a system of time series where each variable depends on its own lags and the lags of the others — without imposing a priori causal direction. It is the standard tool for system dynamics: impulse responses (IRF), forecast error variance decomposition (FEVD), and Granger causality tests.

When to use

Use VAR when all series are stationary I(0) (or differenced). If I(1) series are cointegrated ⇒ use VECM; if I(1) but not cointegrated ⇒ VAR in differences.


Model specification

Yt=c+A1Yt1+A2Yt2++ApYtp+εtY_t = c + A_1 Y_{t-1} + A_2 Y_{t-2} + \dots + A_p Y_{t-p} + \varepsilon_t

where YtY_t is a vector of variables and AiA_i are coefficient matrices. Choose lag pp via AIC/BIC/HQ.


Post-estimation analysis

  • IRF: the system's response to a shock.
  • FEVD: decomposition of forecast variance by shock source.
  • Granger causality: which variable helps forecast which.

Running in EcoLab

  1. Modeling module → Multivariate time series family → VAR.
  2. Choose the variable set (same frequency, stationarity checked), the lag length.
  3. Run; view IRF/FEVD/Granger; export the replication code.

Replication code

* --- VAR ---
tsset time

* Estimate VAR(2)
var rate inflation output, lags(1/2)

* Granger causality test
vargranger

* Impulse Response Functions (orthogonalized)
irf create myirf, set(irf_results) step(20)
irf graph oirf, impulse(rate) response(inflation output)

* Forecast Error Variance Decomposition
irf graph fevd

Limitations

  • Many parameters (explodes with number of variables × lags).
  • Structural IRFs require identification assumptions ⇒ see SVAR.

Video tutorial

Video Tutorial: Running VAR in EcoLab

See also