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

1

Transpile the published listing

The OBR publishes its equation listing as EViews source, which few can run.

From EViews source to open Python EViews listing dlog(X) X(-1) @elem error-correction terms needs an EViews licence transpiler line by line Python expressions log(X) - log(X[-1]) indexed array reads compiled once per solve no licence needed the published listing in open code — 372 parse, 82 dropped at solve, 290 solved
click to expand
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.

Translation
Growth rates
dlog(X)→log⁡Xt−log⁡Xt−1
Lags & elements
Xt−1, @elem → indexed array reads

What 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.
2

Initialise from official data

History loads from the OBR's detailed forecast tables.

Where the starting values come from OBR detailed forecast tables October 2026 EFO vendored ONS snapshot 355 series, ships in the package model history: 199 of 261 unprinted endogenous variables matched by ONS code fiscal and financial sub-blocks get real balancing data
click to expand
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.

Data sources
Forecast tables
OBR detailed forecast tables, October 2026 EFO
ONS snapshot
355 vendored series; 199 of 261 unprinted variables matched

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.

3

Solve by Gauss–Seidel iteration

The equations depend on each other, so each quarter is solved simultaneously, then the quarters in sequence.

Simultaneous within a quarter, sequential across quarters within a quarter cycle through the equations update each in turn repeat to convergence done Q1 Q2 Q3 … quarters solve sequentially forward 12-quarter anchored solve: ~30–40 s single-threaded; a reform run is two solves
click to expand
Solver and runtimeAbout 30–40 s for a 12-quarter solve
Solver
Within quarter
cycle → update → repeat to convergence
Across quarters
sequential forward 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.

4

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.

Add-factors pull the baseline onto the published EFO fit window 2024Q1–2025Q4 add-factors EFO raw fit add-factors hold constant, project to 2027Q4 to 2031Q1
click to expand
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.

Anchoring
Add-factor window
fit 2024Q1–2025Q4, hold constant, project to 2027Q4
Scenario solves
12 quarters, 2025Q1–2027Q4
Anchored horizon
to 2031Q1 (fit on the validation tab)

The path every scenario is read against:

October 2026 EFO outlook, index, 2026Q1 = 100

October 2026 OBR outlook for real GDP and household consumption Indexed line chart from 2026Q1 to 2031Q1. Real GDP rises from 100 to 107.9 and household consumption from 100 to 107.4.
  • Real GDP
  • Household consumption

Source: OBR October 2026 EFO

Source details

Source: papers/obr-macro/figures/current_outlook.csv

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.

5

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.

Two identical solves; the difference is the policy effect closure swap GDPM endogenised DINV held at EFO shocked baseline policy effect shock applied reported result = shocked path − baseline path identical structure isolates the policy from the forecast
click to expand
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.

Closure and shock
Closure swap
DINV equation removed and held at EFO; GDP identity added, GDPM endogenous
Policy effect
Xtshocked−Xtbaseline, identical structure

Closure 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.

6

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.

Static costing in, second-round effects out PE microsimulation static costing, £bn/yr who pays, how much HHDI_ADDFACTOR minus the costing ×1000 ÷ 4 → £m/qtr, held OBR emulator HHDI → CONS → GDPM quarterly, vs baseline 1p on the basic rate: static costing in → GDP feedback out close to the OBR's published 0.3 for income tax — read the scale, not single quarters
click to expand
The bridge, step by stepInjection, transmission, two bases, where it stops
The bridge
Injection
HHDI_ADDFACTOR = −(annual costing) × 1000 ÷ 4, £m/qtr, held
Transmission
HHDI → RHHDI → CONS → GDPM
Command
pe-macro score --country uk --reform '{…}' --model obr

Static 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_shock returns 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.

Notation 3 symbols
SymbolMeaningStep
Xtany model variable in quarter t1
dlog(X)EViews log difference, rewritten in Python1
Xtshocked, Xtbaselinethe same variable in the shocked and baseline solves5