model 03 — UK structural VAR

Read the economy in shocks, not headlines.

A Python replication of the Bank of England's structural VAR for the UK economy — an 8-variable Bayesian time-series model that decomposes UK GDP and inflation into six structural shocks, forecasts with credible bands, and explains why a forecast changed between quarters.

01 — what it is

The Bank's own empirical lens, replicated in the open.

In July 2025 the Bank of England published Macro Technical Paper No. 3 — A structural VAR model for the UK economy (Brignone & Piffer) — documenting the Bayesian SVAR the Bank uses to disentangle domestic and global drivers of the UK business cycle. No replication package was released. This project re-implements the full pipeline in Python — data assembly from public sources, Bayesian estimation, identification, and every output figure — and validates it against the paper's published results.

Within the suite it is the empirical, time-series member: where the OLG model derives behaviour from optimising agents and the OBR emulator reproduces the official forecaster's equation system, the SVAR imposes minimal theory and lets the data speak — just enough structure (zero and sign restrictions) to name the shocks hitting the economy right now.

02 — the model in brief

Eight variables, six named shocks.

A VAR in eight quarterly variables — three global, five UK — estimated over 1992Q1–2023Q2 (the inflation-targeting era), in levels with Covid dummies for 2020Q1–2021Q2. The global block uses UK-trade-weighted world aggregates over the euro area, US, Japan, and China.

blockvariables
Global World GDP · World CPI (both UK-trade-weighted) · real oil price in sterling
UK Bank Rate · sterling exchange-rate index · CPI · CPI energy · real GDP

Estimation is Bayesian with a Minnesota (normal-inverse-Wishart) prior plus sum-of-coefficients and dummy-initial-observation priors. Identification follows Arias–Rubio-Ramírez–Waggoner (2018): zero restrictions make the UK a small open economy (UK shocks cannot move world variables on impact) and sign restrictions on impact name six structural shocks — world demand, world energy, world supply, UK demand, UK supply, and UK monetary policy — with importance weights and the Chan–Matthes–Yu (2025) permutation search making the draws efficient. Two unidentified shocks absorb residual volatility.

03 — quickstart

Estimate, identify, decompose.

The package installs straight from GitHub; the runner scripts live in the repository, so grab a checkout for those. Every input series is public — ONS, the Bank of England database, and FRED — and the data script assembles them for you.

pip install git+https://github.com/PolicyEngine/boe-var-model
git clone https://github.com/PolicyEngine/boe-var-model && cd boe-var-model
python scripts/download_data.py     # assemble the public data
# the paper's core outputs: IRFs, FEVDs, shocks, historical decompositions
python scripts/run_replication.py

# the forecasting toolkit: fan charts, latest-quarter shock distributions,
# composite IRFs, and the forecast-revision decomposition
python scripts/run_forecast_revision.py

outputs land in results/ — the replication figures (fig2–fig6) plus the forecast figures (fig1, fig7–fig9) and two summary reports.

04 — what it answers

What's happening now, and why.

The SVAR's outputs are diagnoses and forecasts, not reform scores. Four tools, all posterior distributions rather than point estimates:

toolwhat it tells you
IRFs & FEVDs How each named shock propagates through the UK economy, and how much of GDP and inflation variance each explains at every horizon.
Historical decompositions Which shocks drove each episode — how much of the 2022 inflation surge was world energy versus UK demand.
Fan-chart forecasts Unconditional forecasts with credible bands, plus the probability that each shock hitting the latest quarter was positive or negative.
Forecast-revision decomposition The paper's Section 5 exercise: why did the forecast change since last quarter? Splits the revision into news (new shocks) and reassessment, via composite impulse responses — an adding-up identity verified to ~1e-12.
Unlike the other two models, the SVAR does not yet score PolicyEngine reform objects — it has no policy levers to pull. Its job is the empirical complement: establishing what state the economy is in before you simulate changing it. Reform scoring (e.g. conditional forecasts under a policy path) is planned.
05 — validation

Checked against the published paper.

With no official replication package, validation is against the paper's published figures and headline numbers. All of Figures 2–6 replicate, and the headline variance decompositions land on the paper's benchmarks. The replication was independently reviewed — econometrics, data construction, and figures.

checkthis replicationthe paper
Global shocks' share of UK GDP variance (1 year) 40.9% ~40%
Global shocks' share of UK CPI variance (1 year) 50.1% ~50%
IRFs, FEVDs, shocks, historical decompositions Figures 2–6 replicate qualitative match
Forecast-revision adding-up identity exact to ~1e-12 per draw holds by construction
variables 8 3 global + 5 UK, quarterly
identified shocks 6 world demand · energy · supply, UK demand · supply · monetary policy
tests 53 passing — estimation, identification, analysis

Honest caveats, reported in the repository rather than smoothed over: the Bank's internal UK-trade-weighted world aggregates are not published, so they are proxied from public sources; the lag length is not stated in the paper (p = 4 assumed, as a parameter); and one known discrepancy — the paper's ranking of UK monetary policy as the largest domestic contributor to CPI variance — does not replicate, most likely because of the proxy world aggregates.

Open the Bank's empirical model of the UK.