Time-Varying-Parameter VAR with Stochastic Volatility
Python · R · Part 5 of the VAR arc — the capstone
Overview
Part 5 of the VAR arc — the capstone. Part 4 let the shock variances move but held the VAR coefficients fixed: the economy's turbulence changed while its dynamics were assumed constant. That is still strong. Did the way a monetary-policy shock propagates to output and inflation really stay the same from the Great Inflation, through the Volcker disinflation, into the Great Moderation and 2008 — or did the transmission mechanism itself drift as the Fed's conduct changed and expectations re-anchored? Primiceri's (2005) time-varying-parameter VAR with stochastic volatility answers by letting everything drift — the autoregressive coefficients, the contemporaneous relations, and the volatilities all evolve as random walks. It is the canonical tool of empirical macro for structural change, and it nests every earlier model in this series: freeze the coefficients and it is Part 4's BVAR-SV; freeze the coefficients and the volatilities and it is Part 3's constant- BVAR; identify the shocks and it delivers Part 2's structural responses — now allowed to change through time. Built from scratch in NumPyro.
Letting everything drift — without hallucinating drift
Every parameter is dated: with , and the coefficient vector , the contemporaneous elements , and the log-volatilities each follow a driftless random walk. The crucial discipline is tight, calibrated drift: a TVP-VAR has hundreds of drifting states and will happily fit noise as "structural change" if the walks move freely. Following Primiceri, a pre-sample OLS calibration (first quarters) centres the initial states at and sets each per-coefficient drift standard deviation to a tiny fraction of the coefficient scale — global tightness centred at Primiceri's benchmark , so a coefficient may move only ~1% of its estimation uncertainty per quarter — though here the data lift the estimate to , ~3× the benchmark but still small. Crucially are estimated, not fixed — the data decide how much time-variation there is, while the tight priors stop it hallucinating drift. All latent states plus hyperparameters are sampled jointly by NUTS, every walk written non-centred to defuse the drift-variance funnel that makes TVP models notoriously hard to sample.
Results
The deliverable is the time-varying impulse response. The drifting coefficients are individually uninterpretable — but freezing the parameters at their date- values gives a fully specified structural VAR, from which we read the response to a recursively-identified (+1pp) monetary-policy shock, computed separately at four dates. The real effect of monetary policy was large in the 1970s–80s and much smaller by the Great Moderation. The peak output response to a tightening is −0.72 in 1975 and −0.49 in 1981, versus just −0.15 in 1996 — before deepening again to −0.50 in the 2008 crisis: monetary transmission to real activity weakened sharply as inflation became anchored, then re-intensified in the crisis — the central Primiceri / Boivin–Giannoni finding, reproduced from scratch. This is structural change a constant-coefficient VAR simply cannot see; Parts 3–4 would fit one average response across all four dates. The Great-Moderation volatility collapse persists even with the coefficients free to move, so it was not an artefact of holding the dynamics fixed in Part 4. (A caveat from Part 2 carries over: recursive identification produces a price puzzle in the early sample — an identification artefact, not a failure of the time-variation; the informative content is how the response magnitudes drift.) Cross-checked in R against a rolling-window OLS VAR — the classical foil Primiceri's model was built to improve on — which finds the same shrinking real transmission, only noisier, showing Bayesian shrinkage buys the smoothness.
Notebooks
Downloads
bvar.py The Minnesota / steady-state BVAR helpers (shared with the Bayesian VAR example) — here supplying the lag-regressor build and OLS calibration
bvar_sv_data.csv US quarterly annualised GDP growth, GDP-deflator inflation, and the Fed funds rate, 1959–2019 (FRED-QD) References
- Primiceri, G. E. (2005). Time varying structural vector autoregressions and monetary policy. Review of Economic Studies 72(3), 821–852. — the TVP-VAR-SV model, drift calibration, and time-varying IRFs reproduced here
- Cogley, T. & Sargent, T. J. (2005). Drifts and volatilities: monetary policies and outcomes in the post WWII US. Review of Economic Dynamics 8(2), 262–302. — the companion drifting-coefficient/SV VAR
- Boivin, J. & Giannoni, M. P. (2006). Has monetary policy become more effective? Review of Economics and Statistics 88(3), 445–462. — the changing transmission of monetary policy this example measures
- Del Negro, M. & Primiceri, G. E. (2015). Time varying structural vector autoregressions and monetary policy: a corrigendum. Review of Economic Studies 82(4), 1342–1345. — the corrected Gibbs ordering for the drifting-states sampler
- Nakajima, J. (2011). Time-varying parameter VAR model with stochastic volatility: an overview of methodology and empirical applications. Monetary and Economic Studies 29, 107–142. — a practical guide to estimating the model
- Kim, S., Shephard, N. & Chib, S. (1998). Stochastic volatility: likelihood inference and comparison with ARCH models. Review of Economic Studies 65(3), 361–393. — the stochastic-volatility component
- McCracken, M. W. & Ng, S. (2020). FRED-QD: a quarterly database for macroeconomic research. Federal Reserve Bank of St. Louis Review 103(1), 1–44. — the FRED-QD data source