model 01 — OBR macroeconometric model · obr-macro · UK · hosted
UK fiscal reform, quarter by quarter.
Run selected UK tax and spending scenarios and trace GDP, consumption, and investment over 3–5 years against the March 2026 EFO baseline. Borrowing is not yet returned by the PolicyEngine Macro adapter.
Transpile, solve, swap the closure.
The pipeline in five steps: the OBR's published EViews equation listing is rewritten in Python, initialised from official data, solved quarter by quarter until the equations agree, anchored so the baseline reproduces the published EFO, and shocked against an identical baseline so the difference is the policy effect.
Transpile the published listing
From EViews to Python
The OBR publishes its full equation listing, but as EViews source that few can run. The transpiler rewrites every EViews line — dlog(), @elem, lags like X(-1), error-correction terms — into an equivalent Python expression, compiled once per solve.
What comes out
The result is the model itself in open code: the same behavioural equations, identities, and technical relationships the official forecaster relies on, runnable without an EViews licence.
Initialise from official data
Loading history
History loads from the OBR's detailed forecast tables. Of the 261 endogenous variables the listing referenced but the outlook did not print, 199 had ONS series codes; a vendored 348-series ONS snapshot supplies them.
Why it matters
That snapshot gives the circular fiscal and financial sub-blocks real balancing data rather than guessed starting values.
Solve by Gauss–Seidel iteration
Simultaneous within a quarter
The equations depend on each other, so each quarter is solved simultaneously: cycle through the equations, update, repeat to convergence. Quarters then solve sequentially forward.
Runtime
A twelve-quarter anchored solve takes roughly 30–40 seconds single-threaded; a reform run is two such solves.
Anchor to the published EFO
Add-factors, the OBR's own device
Add-factors — the residuals reconciling each behavioural equation to data — are set so the baseline reproduces the published EFO. This is the OBR's own device, used the OBR's own way.
Forecasting with held add-factors
For forecasting rather than one-off shocks, the emulator fits add-factors over a base window of 2024Q1–2025Q4, holds them constant, and projects to 2027Q4, with exogenous inputs extrapolated (seasonal cash series at their trailing annual mean). Scenario solves run twelve quarters, 2025Q1–2027Q4.
Horizon limits
The anchored horizon extends to 2031Q1, where GDP is reproduced to 0.29%. Anchored unemployment (LFSUR) is unreliable beyond 2027Q4, drifting to 0.9% against the EFO's 4.1% by 2031Q1.
Swap the closure, shock, compare
Closure swap
The GDP identity is switched off in the OBR file, so for a shock GDPM is swapped in and inventories (DINV) become the residual — output responds to the policy instead of being fixed.
Shock against an identical baseline
The emulator solves shocked and baseline paths with identical structure and reports the difference, isolating the policy effect from the underlying forecast.