Time series
VAR impulse response
A VAR impulse response traces how a one-time innovation propagates through a system of time series.
The task
Task statement
Fit a two-variable VAR(2) with a constant. Under Cholesky identification with y1 ordered first, report the orthogonal IRF of y1 to a one-standard-deviation shock in y2 at horizon 4 as row irf_y1_to_y2_h4.
Data
Columns: t, y1, y2.
- Files
- input.csv
Required output
Scored estimates: irf_y1_to_y2_h4.
Reference output
| Term | Reference estimate | Sample size |
|---|---|---|
irf_y1_to_y2_h4 | 0.081741308 | 200 |
A run succeeds when every scored estimate lies within 1 percent or 0.005 of its reference value, whichever is larger. Sample sizes are not scored.
Task success
| Agency condition | Claude Sonnet 4.6 | GPT-5.6 Luna |
|---|---|---|
| Chatbot | 80.0% | 53.3% |
| Self-repair | 98.3% | 78.3% |
| Constrained agent | 100.0% | 96.7% |
- All runs
- 84.4% of 360 runs
- By prompt condition
- Zero-shot 83.9%, One-shot 85.0%
- By software
- Python 98.3%, R 91.7%, Stata 63.3%
From lag equations to dynamic responses
A VAR$(2)$ models every variable using two lags of the full vector:
Its moving-average form writes $z_t=\sum_{h=0}^{\infty}\Psi_hu_{t-h}$. A structural impact matrix $P$ maps orthogonal shocks into reduced-form innovations (Lutkepohl, 2005).
A two-variable propagation table
Suppose a one-unit shock to the first variable produces these responses.
| Horizon | Response of $z_1$ | Response of $z_2$ |
|---|---|---|
| 0 | 1.00 | 0.40 |
| 1 | 0.60 | 0.50 |
| 2 | 0.25 | 0.32 |
| 3 | 0.05 | 0.12 |
The second variable reacts on impact because the contemporaneous identification matrix is not diagonal.
Assumptions and implementation
The fitted VAR should be stable. The shock needs an identification rule. Cholesky identification is recursive, so variable order changes $P$ and the responses.
Packages differ in whether horizon zero is included and how cumulative responses are labeled. Confidence intervals can use asymptotic formulas or simulation.
A coefficient-recursion diagram connects the VAR parameters to aligned response paths for each shock.
Interpretation and reporting
Each response traces the effect of one identified shock through future horizons. In the table, $z_2$ moves by $0.40$ on impact, peaks at $0.50$, and then declines. Those numbers depend on shock normalization and the matrix $P$.
Report the shocked variable, responding variable, shock size, identification rule, horizon indexing, and interval method. State whether horizon zero appears. For cumulative responses, name the transformation before interpreting long-horizon levels.
A Cholesky response changes when variable order changes because the ordering imposes contemporaneous exclusions. Stability of the reduced-form VAR does not validate that structural ordering. Long-horizon estimates can also accumulate substantial sampling uncertainty.
Reproducible implementation
Estimate every VAR equation on the same aligned sample and declared lag order. Check companion-matrix roots before computing responses. Build the moving-average matrices recursively from $A_1$ and $A_2$.
Choose an impact matrix and verify that it reproduces the innovation covariance through $PP'=\widehat\Sigma_u$. Multiply each $\Psi_h$ by $P$, then label rows and columns with response and shock names.
Compare the first horizons with a direct recursion calculation. Generate intervals with the stated asymptotic or resampling method. Reorder variables or use another defensible identification as a sensitivity check. Store the exact normalization and random seed with simulated intervals (Lutkepohl, 2005).
Further reading
Sims develops vector autoregressions as multivariate dynamic models (Sims, 1980). Lütkepohl covers impulse-response computation and inference (Lutkepohl, 2005).
Sources and further reading
- Helmut Lutkepohl. 2005. New Introduction to Multiple Time Series Analysis. Springer. doi:10.1007/978-3-540-27752-1.
- Christopher A. Sims. 1980. “Macroeconomics and Reality.” Econometrica 48(1): 1–48. doi:10.2307/1912017.
About this benchmark task
- Method group
- Time series
- Software
- Stata, R, and Python
- Runs
- 360 runs, ten in each combination of model, software, prompt, and agency condition