Innovation Accounting

Innovation accounting decomposes the dynamics of a structural VAR into the contributions of individual structural shocks. Starting from the reduced-form residual decomposition $u_t = B_0 \varepsilon_t$, where $B_0$ is the structural impact matrix and $\varepsilon_t$ are orthogonal structural shocks, the package provides three complementary tools:

  • Impulse Response Functions (IRF): trace the dynamic effect of a one-unit structural shock on each endogenous variable across horizons; see Impulse Responses
  • Forecast Error Variance Decomposition (FEVD): measure the share of each variable's forecast uncertainty attributable to each structural shock; see Variance Decomposition
  • Historical Decomposition (HD): attribute observed variable movements to individual structural shocks over the sample period; see Historical Decomposition

All three tools support frequentist VAR, Bayesian VAR, VECM, FAVAR, DSGE, and Local Projection estimation, with six structural identification schemes and interactive D3.js visualization via plot_result().

using MacroEconometricModels, Random
Random.seed!(42)
fred = load_example(:fred_md)
Y = to_matrix(apply_tcode(fred[:, ["INDPRO", "CPIAUCSL", "FEDFUNDS"]]))
Y = Y[all.(isfinite, eachrow(Y)), :]
Y = Y[end-59:end, :]
model = estimate_var(Y, 4; varnames=["INDPRO", "CPIAUCSL", "FEDFUNDS"])
<< @setup-block not executed in draft mode >>

Quick Start

Recipe 1: Cholesky IRF with bootstrap confidence intervals

# Recursive identification: INDPRO -> CPIAUCSL -> FEDFUNDS
irfs = irf(model, 20; ci_type=:bootstrap, reps=50)
report(irfs)
<< @example-block not executed in draft mode >>

Recipe 2: Forecast error variance decomposition

decomp = fevd(model, 20)
report(decomp)
<< @example-block not executed in draft mode >>

Recipe 3: Historical decomposition with verification

hd = historical_decomposition(model, size(model.U, 1))
verify_decomposition(hd)
report(hd)
<< @example-block not executed in draft mode >>

Recipe 4: Bayesian IRF with credible intervals

post = estimate_bvar(Y, 4; n_draws=100, varnames=["INDPRO", "CPIAUCSL", "FEDFUNDS"])

# Posterior median IRF with 68% credible intervals
birfs = irf(post, 20)
report(birfs)
<< @example-block not executed in draft mode >>

Recipe 5: Sign-restricted IRF

# Demand shock: positive output, positive prices; supply shock: positive output, negative prices
irfs_sign = irf(model, 20; method=:sign, sign_restrictions=[1 1 0; -1 0 0; 0 0 1])
report(irfs_sign)
<< @example-block not executed in draft mode >>

Recipe 6: Structural LP impulse responses

# LP-based IRF robust to VAR misspecification
slp = structural_lp(Y, 20; method=:cholesky, lags=4)
lp_irfs = irf(slp)
report(lp_irfs)
<< @example-block not executed in draft mode >>

Structural Identification Overview

Innovation accounting requires choosing an identification scheme to recover $B_0$ from the reduced-form covariance $\Sigma = B_0 B_0'$. The package implements six methods spanning point-identified and set-identified approaches:

Identification MethodFunctionPoint/Set IDKey Feature
Choleskyirf(model, H)PointRecursive ordering
Sign restrictionsirf(model, H; method=:sign, ...)SetAgnostic about magnitudes
Narrativeidentify_narrative(model, H, ...)SetIncorporates historical events
Long-runirf(model, H; method=:long_run)PointBlanchard-Quah decomposition
Arias et al.identify_arias(model, ...)SetZero + sign restrictions
Uhlig penaltyidentify_uhlig(model, ...)PointPenalty function approach

Point identification (Cholesky, long-run, Uhlig) produces a unique $B_0$ and hence unique IRFs. Set identification (sign, narrative, Arias et al.) produces a set of admissible $B_0$ matrices; the reported IRFs are the median across the admissible set, with the range reflected in wider confidence/credible bands.

All six methods integrate seamlessly with irf(), fevd(), and historical_decomposition() via the method keyword or by passing a pre-identified rotation matrix. For statistical identification via heteroskedasticity or non-Gaussianity (18 additional methods), see Statistical Identification.


Sub-Page Guide

For detailed treatment of each tool –- theory, equations, return value tables, and advanced usage:

  • Impulse Responses –- IRF definition, companion form representation, cumulative IRFs, bootstrap and Bayesian confidence intervals, stationarity filtering (Kilian 1998), LP-based IRFs
  • Variance Decomposition –- FEVD definition, properties, LP-FEVD (Gorodnichenko & Lee 2019), Bayesian FEVD, bootstrap CIs
  • Historical Decomposition –- HD definition, decomposition identity, shock contributions, LP-based HD, display and table output

Common Pitfalls

  1. Variable ordering matters for Cholesky. The default irf(model, H) uses Cholesky identification, where the column ordering of the data matrix determines the recursive causal structure. Placing the federal funds rate last assumes monetary policy does not contemporaneously affect output or prices.

  2. Confidence bands require explicit activation. The ci_lower and ci_upper fields contain zeros unless ci_type=:bootstrap is set (frequentist) or a Bayesian posterior is passed. Always check irfs.ci_type before interpreting bands.

  3. Sign restrictions produce set-identified IRFs. The median response across admissible rotations is a summary statistic, not a point estimate. Report the full credible set, not just the median, to avoid overstating precision (Uhlig 2005).

  4. HD verification should always pass. After computing hd = historical_decomposition(model, T), call verify_decomposition(hd) to confirm the additive identity $y_t = \sum_j \text{HD}_j(t) + \text{initial}(t)$ holds to numerical precision. A failure indicates a bug, not a data issue.

  5. LP-based IRFs are wider than VAR-based IRFs. Each horizon is estimated independently without cross-horizon restrictions, producing larger standard errors. This is a feature (robustness to dynamic misspecification), not a deficiency (Kilian and Lütkepohl 2017, Chapter 12).


References

  • Arias, J. E., Rubio-Ramírez, J. F., & Waggoner, D. F. (2018). Inference Based on Structural Vector Autoregressions Identified with Sign and Zero Restrictions. Econometrica, 86(2), 685–720. DOI: 10.3982/ECTA14468
  • Kilian, L. (1998). Small-Sample Confidence Intervals for Impulse Response Functions. Review of Economics and Statistics, 80(2), 218–230. DOI: 10.1162/003465398557465
  • Kilian, L., & Lütkepohl, H. (2017). Structural Vector Autoregressive Analysis. Cambridge University Press. DOI: 10.1017/9781108164818
  • Lütkepohl, H. (2005). New Introduction to Multiple Time Series Analysis. Springer. ISBN 978-3-540-40172-8.
  • Uhlig, H. (2005). What are the effects of monetary policy on output? Journal of Monetary Economics, 52(2), 381–419. DOI: 10.1016/j.jmoneco.2004.05.007