Emulator of the OBR macroeconometric model
OBR emulator
How the published EViews listing becomes a model you can solve and shock.
Transpile, solve, swap the closure
Transpile the published listing
The OBR publishes its equation listing as EViews source, which few can run.
Translation rules and outputdlog and lags in Python; what the listing yields
The transpiler rewrites every line (dlog(), @elem, lags like X(-1), error-correction terms) as an equivalent Python expression.
@elem → indexed array readsWhat comes out
The published listing in open code, not a complete working copy of the OBR’s model.
- All 372 equations parse; 82 are dropped at solve time because their inputs are not published, so about 290 are solved. They cover 383 endogenous variables; one without a live equation passes through at the OBR’s value.
- Some headline variables pass through at their published values rather than being computed.
- Business investment uses an equation the OBR had commented out of its listing, reconstructed here.
Initialise from official data
History loads from the OBR's detailed forecast tables.
Data sources and why they matterWhat each source fills in, and its vintage
The listing references 261 endogenous variables the outlook does not print; 199 have ONS series codes, supplied by a vendored 355-series ONS snapshot.
Why it matters
The snapshot ships inside the package, so there is no download step. It gives the circular fiscal and financial sub-blocks real balancing data rather than guessed starting values.
Solve by Gauss–Seidel iteration
The equations depend on each other, so each quarter is solved simultaneously, then the quarters in sequence.
Solver and runtimeAbout 30–40 s for a 12-quarter solve
Runtime
Locally, a twelve-quarter anchored solve takes roughly 30–40 seconds single-threaded (hosted runs take one to five minutes); a reform run is two such solves.
Anchor to the published EFO
Add-factors, the residuals that reconcile each behavioural equation to data, are set to hold the baseline near the published EFO; it still drifts to +0.4% GDP by 2027Q4.
Held add-factors and horizon limitsHow far the anchored path can be trusted
The OBR anchors the same way; these values are fitted here, not the OBR's own.
The path every scenario is read against:
October 2026 EFO outlook, index, 2026Q1 = 100
- Real GDP
- Household consumption
Source: OBR October 2026 EFO
Source details
Forecasting with held add-factors
To forecast rather than score a one-off shock, the emulator fits add-factors over 2024Q1–2025Q4, holds them constant and projects to 2027Q4. Exogenous inputs are extrapolated (seasonal cash series at their trailing annual mean).
Horizon limits
How closely the anchor holds out to 2031Q1, and how unemployment is held to the EFO, is on the validation tab.
Swap the closure, shock, compare
In the OBR file GDP (GDPM) is an exogenous input and inventories (DINV) are the residual that closes the expenditure identity.
The closure swap and the identical baselineWhy a policy effect is a difference of two solves
The emulator swaps the two so output can respond.
DINV equation removed and held at EFO; GDP identity added, GDPM endogenousClosure swap
Holding DINV at its EFO path and adding a GDP identity makes GDPM endogenous: output responds to the policy instead of being fixed.
Shock against an identical baseline
Shocked and baseline paths share one structure, so their difference isolates the policy effect from the underlying forecast.
Score a costed reform through the microsimulation bridge
The join from a statutory reform to GDP: the microsimulation costs the reform, and the emulator computes the second round.
The bridge, step by stepInjection, transmission, two bases, where it stops
HHDI_ADDFACTOR = −(annual costing) × 1000 ÷ 4, £m/qtr, heldHHDI → RHHDI → CONS → GDPMpe-macro score --country uk --reform '{…}' --model obrStatic costing in, second-round effects out
PolicyEngine's microsimulation costs a statutory reform year by year: who pays and how much.
score_reform(country="uk", reform=..., model="obr")hands this model the bill.- Each year's costing enters as
HHDI_ADDFACTOR, an add-factor on household disposable income. - It is minus the annual £bn, spread flat across four quarters (×1000 ÷ 4 → £m/qtr) and held.
What the emulator computes
- Lower income moves consumption through the published consumption equation, and consumption moves GDP under the demand closure.
- The second round runs quarter by quarter against the anchored baseline of step 4.
- The anchoring add-factors are fixed in both runs, so they cancel in the difference.
- The Overview’s worked example shows this for 1p on the basic rate.
Two bases for the ratio
- The model reports GDP in chained volumes (real); the costing is in current prices.
- GDP lost per pound of revenue is quoted in current prices, the basis of the OBR’s own multipliers.
- The real-GDP ratio that
obr_shockreturns is smaller by the GDP deflator (obr-macroeconomic-model #63).
Where the bridge stops
Only household-borne costings enter; corporation tax and US reforms are refused (limits). For the other joins, see combine the models.