Bank of England structural VAR

BoE SVAR

Run it hosted, from the CLI or in Python, and reproduce its numbers.

Four ways to run it

From hosted to local: MCP tools, the CLI, Python, and the runner scripts that rebuild the paper’s outputs.

1

Hosted MCP tools

The quickest route is the hosted MCP server: no install, no credentials.

Tools, returns and runtimethe four tools · draws and runtime

The four tools and what each returns

  • forecast_uk(horizons=12, draws=2000): year-on-year GDP growth and CPI inflation fan charts with 68% and 90% bands.
  • latest_shocks(draws=2000): posterior sign probabilities of each identified shock in the latest quarter.
  • model_summary(): headline replication results; instant, no estimation.
  • svar_inflation_incidence(year=2027), experimental: the CPI gap priced through benefit uprating in the microsimulation.

Draws and runtime

  • The first call estimates the model, a couple of minutes cold; results are cached in-process.
  • The default 2,000 draws give about 159 accepted (ESS about 49), below the ESS of 100 at which the response warns.
  • 3,500 draws give ESS about 92, still under; 6,000 give 455 accepted and ESS about 181.
  • Every response carries a warnings list when inference is weak.
2

CLI mirrors

The CLI mirrors the four MCP tools one for one: same outputs, no MCP client required.

pe-macro forecast --horizons 12 --draws 2000   # fan charts
pe-macro shocks                                # latest-quarter shocks
pe-macro summary                               # replication headlines
pe-macro svar-inflation-incidence --year 2027  # experimental; needs HUGGING_FACE_TOKEN
3

Install locally

Install the suite from GitHub: it pins the model package, which ships the prepared quarterly dataset. The calls match the hosted tools and return dicts.

pip install "policyengine-macro[models] @ git+https://github.com/PolicyEngine/macro#subdirectory=integration"
from policyengine_macro import svar_forecast, svar_latest_shocks

fc = svar_forecast(horizons=12, draws=2000)   # median + 68%/90% bands
shocks = svar_latest_shocks(draws=2000)
About this stepthe model package alone · public inputs

The model package alone

  • pip install git+https://github.com/PolicyEngine/boe-var-model installs boe_var without the suite.
  • The prepared quarterly dataset is inside, so boe_var.data.load_data() works immediately.

All inputs are public

  • ONS: CPI, CPI energy, real GDP.
  • Bank of England: Bank Rate, sterling exchange-rate index.
  • FRED: oil, exchange rates, world components.
4

Development runner scripts

For development: clone the repository to rebuild the dataset or regenerate the paper outputs.

python scripts/download_data.py     # reassemble 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
About this stepwhat lands where · runtime

What lands where

  • Outputs land in results/: the replication figures (fig2–fig6), the forecast figures (fig1, fig7–fig9) and two summary reports.
  • Runtime scales with draw count; the importance weights are the expensive part, one numerical Jacobian per accepted draw.