model 02 — 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 six 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, shocked against an identical baseline so the difference is the policy effect — and joined to the PolicyEngine microsimulation, which supplies the static costing the shock comes from.
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.
@elem → indexed array readsInitialise 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 ships inside the package — there is no download step — and it 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.
GDPM endogenised; DINV becomes the residualScore a costed reform through the microsimulation bridge
Static costing in, second-round effects out
The suite's flagship join. PolicyEngine's microsimulation costs a statutory reform year by year — who pays and how much — and score_reform(country="uk", reform=..., model="obr") hands this model the bill: each year's costing enters as HHDI_ADDFACTOR, minus the annual £bn spread flat across its four quarters (×1000 ÷ 4 → £m/qtr), held as an add-factor on household disposable income.
What the emulator computes
Lower income moves consumption through the published consumption equation, and consumption moves GDP under the demand closure — the second round, quarter by quarter, against the anchored baseline of step 4. 1p on the basic rate from April 2026: £6.46bn static in 2026, and a GDP fall building to roughly 0.35× the revenue raised over the five-year window. Individual quarters are not reliable — no quarter of the solve converges to tolerance, and the first year flips sign under a shock that is flat across it.
Where the bridge stops
This route's implied multiplier is about 0.35, against the OBR's published 0.3 for income tax and NICs — the ~1-by-construction problem belongs to the spending lever (CGG, exactly 1.0000 against the OBR's 0.6), not to this one. Corporation tax is refused — not household-borne in the microsim, and the direct TCPRO closure converges only slowly (a 12-quarter run reaches ~40% of its plateau). UK only; no US bridge exists. Every join in the suite → /models#compose.
HHDI_ADDFACTOR = −(annual costing) × 1000 ÷ 4, £m/qtr, heldHHDI → RHHDI → CONS → GDPMpe-macro score --country uk --reform '{…}' --model obr