The Horseshoe BVAR

Python · R · Part 12 of the VAR arc — global-local adaptive shrinkage

Overview

Part 12 of the VAR arc — adaptive shrinkage. Every Bayesian VAR in this series shrank with the Minnesota prior: a fixed structure that treats all own-first-lag coefficients alike, all cross-lags alike, and tightens mechanically with lag length. It works, but it cannot learn which coefficients matter — it imposes the same shrinkage whether a coefficient is a genuine dynamic or pure noise. Global-local shrinkage priors — the horseshoe (Carvalho–Polson–Scott 2010) foremost — do learn: a single global parameter pulls everything toward zero, while heavy-tailed local parameters let a few genuinely important coefficients escape. The result is automatic, adaptive sparsity. This example builds the horseshoe VAR from scratch, fits it to a 10-variable quarterly macro system (a VAR(2), 200 coefficients), and asks whether adaptive shrinkage beats the Minnesota rule — and what it reveals that Minnesota hides.

The horseshoe prior

Give each coefficient a normal prior whose variance is the product of a local and a global scale — both half-Cauchy. The global τ\tau shrinks the whole equation; the local λj\lambda_j, with heavy tails, occasionally take large values that let individual coefficients slip free of the global pull. Writing the implied shrinkage weight κj=1/(1+λj2τ2)\kappa_j = 1/(1+\lambda_j^2\tau^2) (κ=0\kappa=0 escapes, κ=1\kappa=1 crushed to zero), the horseshoe induces a Beta(12,12)\text{Beta}(\tfrac12,\tfrac12) prior on κj\kappa_jU-shaped, piling mass at 0 and 1. Hence the name: coefficients are either kept nearly intact or crushed, with little in between — exactly what a fixed Minnesota variance cannot produce. Sampling from scratch: the half-Cauchy scales are written as inverse-gamma mixtures (Makalic–Schmidt 2016), so every full conditional is inverse-gamma or normal — a fast conjugate Gibbs sampler, run equation by equation.

βjN ⁣(0, λj2τ2σ2),λjC+(0,1),τC+(0,1)\beta_j \sim \mathcal N\!\big(0,\ \lambda_j^2\,\tau^2\,\sigma^2\big), \qquad \lambda_j \sim C^+(0,1), \qquad \tau \sim C^+(0,1)

Results

Radical sparsity. Of the 200 coefficients in the 10-variable VAR(2), the horseshoe kills ~96% (κ>0.9\kappa>0.9) and lets only a handful escape — and those it keeps are exactly the ones economics expects to persist: the own first lags of the interest rates and unemployment (κ0.08\kappa\approx0.08 for unemployment, 0.230.23 for the 10-year yield). The near-unpredictable growth-rate equations are shrunk almost entirely away. Without being told anything about the variables, the prior performs automatic variable selection, separating persistent dynamics from noise — something Minnesota's uniform, rule-based shrinkage never surfaces. But the sparsity is not free. Measured honestly — an expanding-window, refit-every-quarter, 1-step density test over 2011–2019 — the horseshoe (14.16-14.16) forecasts significantly worse than the Minnesota prior (13.85-13.85; paired-tt p0.015p\approx0.015), and even a near-flat prior (13.96-13.96) edges it. The same aggressive shrinkage that yields the sparsity over-shrinks coefficients carrying genuine short-horizon signal — a known tension, since the horseshoe optimises for selection, not prediction. What it buys instead is interpretability: a radically smaller, readable model that names which dynamics are real, for a small but real forecast premium — which is why global-local priors are a modern default for large, high-dimensional VARs, where the regularisation matters more and the gap typically narrows (Huber–Feldkircher 2019; Cross–Hou–Poon 2020). The R notebook reproduces the same equation-level selection from a base-R implementation of the sampler.

Notebooks

Downloads

References