PolicyEngine Macro simulates the UK economy as it adjusts to a tax or benefit reform. It builds on an open-source overlapping-generations (OG) model maintained by the Policy Simulation Library (PSL), calibrated to the UK and wired into PolicyEngine’s tax-and-benefit microsimulation. In an OG model age cohorts coexist; each chooses consumption, hours and savings over its lifetime, firms hire labour and capital, and markets clear period by period. The model returns a year-by-year path for GDP, investment, interest rates and the public finances — not a single long-run number. The UK calibration draws on UN demographics, ONS national accounts, OBR fiscal aggregates, and tax rules from PolicyEngine.
Four tabs, each standing on its own: Showcase for the model in action on a worked UK reform, Code for the Python that drives it, Methodology for how it works, and OBR comparisonfor a side-by-side with the OBR’s UK OLG model (OBR Working Paper No. 22, April 2025).
What an OG model adds to a static analysis
A static tax model holds the economy fixed and totals up who pays more or less under a reform. It answers part of the question, but ignores how people and firms respond. When after-tax wages fall, households work less and save less. When the cost of capital rises, firms invest less. Tax revenues, GDP and the public finances move over years as those adjustments work through.
An overlapping-generations(OG) model captures those responses. Many age cohorts coexist; each chooses consumption, hours and savings over its lifetime; firms hire labour and rent capital; the government collects taxes and pays transfers; markets clear period by period. The model returns a year-by-year path for GDP, wages, interest rates, investment, debt and tax revenue under the reform, alongside the same path without it. The difference between the two paths gives the reform’s macroeconomic effect.
The reform: 1 pp on the basic rate, from 2027–28
The reform raises the basic rate of UK income tax by one percentage point, from 20% to 21%, starting in tax year 2027–28 and holding thereafter. It serves as a stylised illustration, not a forecast of any announced policy. In every chart, solid linesshow the UK economy under the OBR’s November 2025 baseline (history plus forecast); dashed linesshow the OG-UK reform path. The vertical gap between them, from 2027 onwards, gives the reform’s modelled effect.
Three views are available: the whole economy — six national-accounts series (consumption, investment, government consumption, tax revenue, debt, GDP); by industry — output, capital and labour across the eight UK industry sectors; and one sector at a time— a single sector × variable cell. Use the dropdowns to switch series. The transition path runs for 60 periods.
Macro aggregates — the whole economy
Six headline series for the UK economy: consumption, investment, government consumption, tax revenue, debt and GDP. Flows appear as a share of GDP (the natural scale for fiscal aggregates); GDP itself sits in £bn at current prices. Pick one from the dropdown — the vertical gap between the solid baseline and the dashed reform path from 2027 onwards gives the reform effect on that series.
Impact across sectors
The reform's effect on the whole industry mix at once. Pick output, capital or labour from the dropdown; the chart overlays all eight sectors as percentage change from baseline. Positive values: the sector grows under the reform. Negative values: it shrinks. A one-look answer to which sectors move most.
One sector at a time
The finest-grained view: any single sector × variablecell of the economy. Pick a variable (output, capital or labour) and a sector; the plot shows that cell's full path indexed to 2000 = 100. Solid = ONS outturn stitched to the OBR Nov 2025 EFO baseline; dashed = OG-UK's +1 pp basic-rate reform. History gives context for how far off-baseline the reform pushes that sector.
From a few lines of Python to a full UK transition path
OG-UK is open source, and every Code-tab step that carries logic ships as a runnable file in this repo’s python/ folder. Scroll through the seven steps below; the panel on the right shows the code for whichever step you are reading, and the filename label points to the same file on disk. Pick a step, run it on its own, swap the reform. Full context lives in PSL’s OG-UK repository.
OG-UK uses uv, a fast Python package manager. With Python 3.11+ and uv on your machine, three commands are enough — see the panel on the right.
OG-UK pulls the PolicyEngine UK microdata from HuggingFace, so set a token once with read access to policyengine/policyengine-uk-data.
With that done, uv run python scripts/03_steady_state.py solves a baseline and a reform steady state and prints the impact in £bn.
Reforms use the PolicyEngine API: pick a parameter from the UK tax-and-benefit rule book, give it a new value and a start date. Anything PolicyEngine can represent — rates, thresholds, allowance tapers, new benefits — flows straight through.
To simulate a different reform, swap the parameter path and value. The rest of the pipeline does not change.
The fastest way to see what a reform does. solve_steady_state finds the long-run equilibrium of the UK economy under a given policy: the prices, quantities and tax revenues that emerge once the economy has fully adjusted. Run it once for the baseline, once for the reform; the difference gives the answer.
A typical run takes a couple of minutes on a laptop. The terminal output on the right is illustrative — the format matches 03_steady_state.py, but the numbers depend on the calibration date and your data release.
The steady state tells you where the economy ends up. The transition pathtells you how it gets there — year by year, 60 periods by default (configurable). This is what powers the dashed lines in the Showcase tab.
The transition costs more compute — the model solves every cohort’s lifetime under rational expectations — so OG-UK uses Dask to parallelise across CPU cores.
OG-UK solves in dimensionless model units. To translate them into figures a policymaker can read — billions of pounds, percentages of GDP — the model anchors its steady-state GDP to the ONS figure and scales every other variable in proportion.
Each attribute returns as a NumPy array indexed by year — ready for a Plotly chart, a pandas DataFrame, or whatever else you like.
Pass multi_sector=Trueand the same call returns the breakdown across the eight UK industry sectors (energy, manufacturing, construction, trade & transport, info & finance, real estate, business services, public & other) — the basis for the industry by industry view in the Showcase tab.
The same call returns sector-level output, capital and labour alongside the macro aggregates.
Every step above ships as a runnable file in this repo’s python/ folder — the panel on the right shows the layout. Pick the script that matches the step you want and run it on its own:
scripts/03_steady_state.py— fastest, prints a one-line £bn impact summary.scripts/04_transition.py— heavier, produces the full year-by-year path.scripts/06_multi_sector.py— the 8-sector calibration behind the Showcase-tab industry views.
Edit og_dashboard/reform.py to swap the parameter, value or start date. Every script imports REFORM from there, so the rest of the pipeline stays unchanged. For more variations, the upstream OG-UK examples directory carries additional pipelines (run_oguk_fast_tpi.py, run_oguk_fast_sector.py, plot.py). Full API reference and theory documentation: pslmodels.github.io/OG-UK.
Core elements of OG-UK
The eight building blocks of the model, from overlapping cohorts to UK calibration. The panel on the right shows the formal structure for each section as you scroll.
The central insight of an overlapping-generations model is that the economy is not populated by a single “representative agent.” At any moment in time, many generations coexist: young people just entering the labour force, middle-aged workers at peak earnings, and retirees living off savings and pensions. Each generation has a different remaining lifespan, a different stock of accumulated wealth, and therefore a different response to any given policy change.
OG-Core models S economically active age cohorts (typically 80, representing ages 21 to 100). Each period, a new cohort is born and the oldest cohort dies with some probability. The population distribution by age evolves over time with fertility, mortality, and immigration, and eventually reaches a stationary distribution in the long run.
Within each age cohort, households split into J ability types, each with a distinct permanent labour productivity. High-ability types earn more per hour of work and typically save more. This heterogeneity captures how a tax reform affects the income distribution, not just average outcomes.
Every period, each household makes three decisions: how much to consume, how many hours to work, and how much to save for the future. The household chooses these to maximise expected lifetime utility, subject to a budget constraint.
Consumption utility follows a CRRA (constant relative risk aversion) function, where the risk aversion parameter governs how strongly households prefer smooth consumption over time. Before entering this function, a Stone-Geary Cobb-Douglas form aggregates the individual consumption goods, accounting for minimum subsistence levels.
Labour disutility uses an elliptical function rather than a standard power function. This ensures that the marginal cost of working goes to zero when hours are zero (so households always choose to work at least a little) and goes to infinity at the upper bound (so they never hit the ceiling). This avoids computationally expensive occasionally-binding constraint methods.
Bequest utility captures the “warm glow” from leaving wealth behind upon death. The age-specific mortality probability weights it, so it matters most for older households. The strength of the bequest motive varies by ability type and is calibrated to match the observed wealth distribution.
The household's budget constraint says that each period, income from savings returns, labour earnings, bequests received, government transfers, and pensions must cover consumption (including consumption taxes), income and wealth taxes, and savings carried into the next period.
Two Euler equations characterise the optimal decisions. The labour first-order condition says: work until the after-tax wage equals the marginal disutility. The savings Euler equation says: give up one unit of consumption today only if the discounted, after-tax return makes tomorrow’s consumption sufficiently valuable.
The production side of the economy consists of M industries, each populated by perfectly competitive firms. Each firm combines three inputs: private capital, public capital (government-provided infrastructure), and labour. A constant elasticity of substitution (CES) technology combines them.
The elasticity parameter governs how easily firms substitute between capital and labour. When it equals one, the function reduces to the Cobb-Douglas form. Total factor productivity varies across industries and over time, so the model can capture sector-specific technological change.
Profit maximisation yields the standard first-order conditions: the wage equals the marginal product of labour, and the rental rate of capital equals the after-tax marginal product of capital, accounting for depreciation, tax deductions, and investment tax credits.
One feature of OG-Core sets it apart: public capital generates economic rents. Since firms cannot deduct the cost of using government infrastructure, the returns from public capital flow to private capital owners through an augmented rate of return.
The government in OG-Core collects revenue from five tax instruments: individual income taxes, consumption taxes, wealth taxes, corporate income taxes, and bequest taxes. It spends on public goods, infrastructure, pensions, lump-sum transfers, and universal basic income. Issuing debt finances the difference.
The income tax carries the most structure. OG-Core supports several functional forms for effective and marginal tax rates, fitted to detailed tax-benefit calculations. For OG-UK, we use the Gouveia-Strauss specification, which estimates the effective tax rate as a smooth, monotonically increasing function of income and derives the marginal tax rate analytically. The estimation runs on PolicyEngine-UK output drawn from the Enhanced FRS — the Family Resources Survey enhanced with HMRC’s Survey of Personal Incomes, the Living Costs and Food Survey, and the Wealth and Assets Survey.
The wealth tax uses a progressive three-parameter function that produces anything from zero taxation to smoothly increasing marginal rates. Consumption taxes take linear rates that vary by good, covering VAT and excise. Corporate income taxes take flat rates by industry.
Since debt cannot grow without bound, a fiscal closure rule activates after a specified period to bring the debt-to-GDP ratio gradually towards a target. The modeller chooses whether the adjustment falls on government spending, transfers, or a combination of both.
Market clearing conditions connect all the pieces above — household decisions, firm production, and government policy. For the economy to be in equilibrium, supply must equal demand in every market simultaneously.
In the labour market, the total efficiency-weighted labour supply from all households across all ages and ability types must equal total firm demand across all industries. In the capital market, the total stock of savings (both domestic and foreign) must equal the capital firms demand plus government debt. The model runs as an open economy: parameters control foreign capital and foreign debt holdings, setting the degree of international capital mobility.
For each goods market, industry output must equal consumption demand. The final industry clears residually, absorbing investment, government purchases, and any remaining demand. The debt market splits government debt between domestic and foreign holders.
An equilibrium is a set of prices (the interest rate, wage, and goods prices) such that all households optimise, all firms optimise, the government budget constraint holds, and all four markets clear. Finding one is a large-scale nonlinear fixed-point problem.
Finding equilibrium is a two-stage computational problem. The model first solves for the long-run steady state, then computes the transition path from today's economy to that steady state.
The model first finds the long-run equilibrium where all variables stay constant (after removing trend growth). It uses a nested fixed-point algorithm. The outer loop guesses a vector of aggregate prices and quantities. The inner loop takes these as given and solves the Euler equations for every combination of ability type and age. Because each type is independent, the inner loop solves them in parallel. After solving all households, the algorithm aggregates their decisions, computes firm demands, checks the government budget, and derives new guesses. It iterates until convergence.
Starting from today’s economy, the model then solves for how the economy evolves towards the steady state over T periods. The Time Path Iteration (TPI) method guesses entire time paths for all prices and quantities, solves every cohort’s lifetime decisions given those paths (with rational expectations about future prices), checks whether the implied paths match the guesses, and iterates. This step produces the year-by-year projections.
OG-Core provides the theoretical framework. Turning it into a model of the UK economy means calibrating every parameter to UK data. The OG-UK calibration layer handles that step.
Macroeconomic parameters come from the ONS national accounts and the OBR’s Economic and Fiscal Outlook: the debt-to-GDP ratio, the revenue-to-GDP ratio, government spending shares, and growth rates. The state pension age matches current UK rules. Demographics come from the UN World Population Prospects data for the United Kingdom.
Tax functions come from PolicyEngine UK. Rather than hard-coding the UK income tax schedule, the model fits smooth Gouveia-Strauss functions that capture the effective relationship between income and taxes across the entire population. This approach folds in the interaction of income tax, National Insurance, and the personal allowance taper.
The model outputs values in abstract units. To translate them into pound-sterling figures, OG-UK anchors the model’s steady-state GDP to the ONS figure and scales all other variables proportionally. Results then read as changes in billions of pounds — a format that policymakers and the public can read directly.
Together with a static microsimulation engine, OG-UK supports two complementary views of any UK tax or benefit reform. Static analysis provides the detailed distributional picture: which households gain, which lose, and by how much. OG-UK provides the macroeconomic picture: what happens to GDP, investment, government revenue, interest rates, and wages as the economy adjusts over time.
The two perspectives can tell different stories. A reform that raises revenue in a static analysis may raise less in practice, because higher tax rates reduce labour supply and investment and shrink the tax base. The reverse also holds: a reform that costs revenue upfront might pay for itself over time through extra economic activity. OG-UK captures these dynamics.
The transition path carries the bulk of the answer. Rather than comparing two long-run steady states, it shows the year-by-year adjustment: how GDP dips in the first few years, how interest rates respond, when revenue stabilises. These time paths map onto OBR forecast horizons.
OG-UK is a structural macro model and inherits the simplifications of that class. The caveats for reading its outputs:
- Smoothed tax functions, not statutory bands. A single Gouveia–Strauss function, fitted to PolicyEngine-UK output, folds in income tax and National Insurance. Reforms that change average liability across the income distribution flow through cleanly; reforms whose mechanism is the kink itself (a new threshold, an allowance taper change) come through only to the extent the smoothed function shifts.
- Permanent ability types, no earnings risk. OG-UK uses J = 7 deterministic ability types. There is no idiosyncratic earnings shock within a type, so precautionary savings and earnings-risk-driven inequality are not a channel here. This is a deliberate trade-off — see the OBR-comparison tab for the alternative.
- UK as a single entity. The model calibrates to UK-wide aggregates; there is no England / Scotland / Wales / Northern Ireland breakdown. Devolved tax differentials and reforms with explicit regional incidence sit below the model’s granularity.
- Reforms are step changes. A PolicyEngine reform sets parameter values from a start date and they hold thereafter. Phased introductions, sunset clauses or year-on-year indexation changes need explicit scripting; they are not the default.
- Truncated horizon. The default 60-period transition assumes the steady state arrives by year 60. Effects that play out over longer horizons collapse into the steady-state anchor.
None of these are model bugs — they are choices that make the macro accounting tractable. Worth knowing when reading the Showcase tab’s charts.
Overview
This tab compares the two UK overlapping-generations macro models side by side: OG-UK — the UK calibration of OG-Core, maintained by the Policy Simulation Library — and the OBR UK OLG model described in OBR Working Paper No. 22 (April 2025).
The sections below walk through how each model treats production, households, bequests, the tax system, government, the open economy, and the solution method & calibration — so you can see where the two approaches agree, where they differ, and when to reach for one over the other. The two models occupy complementary niches: OG-UK carries more structural detail and traces full year-by-year transition paths; OBR UK OLG calibrates tightly to UK fiscal institutions and reports steady-state outcomes.
| Dimension | OG-UK strength | OBR UK OLG strength |
|---|---|---|
| Transition dynamics | Full year-by-year paths | Steady-state only |
| UK institutional detail | Smooth approximations | Explicit bands and rates |
| Within-cohort inequality | Permanent types | Stochastic earnings |
| Production structure | Multi-sector CES | Single-sector Cobb-Douglas |
| Tax instruments | 5 instruments | 3 instruments (more detailed) |
| Fiscal policy levers | G, TR, UBI, Ig | RBI, age-dependent transfers |
| Openness | Open-source, Python | MATLAB, closed toolkit |
Production technology
How each model represents firms — the technology for combining capital and labour, and whether production is a single aggregate or split across multiple industries.
| OG-UK | OBR UK OLG | |
|---|---|---|
| Production function | CES (nests Cobb-Douglas as special case) | Cobb-Douglas only |
| Industries | M industries (multi-sector) | Single sector |
| Public capital | Yes — generates rents to private capital | No |
| Capital share | Configurable per industry | α = 0.33 |
| Labour input | Efficiency-weighted across permanent types | Efficiency-weighted by age + stochastic shocks |
| TFP | Varies by industry and over time | Normalised to 1, with labour-augmenting growth g = 1.2% |
| Depreciation | Configurable per industry | δ = 5% |
Household heterogeneity
How households differ within each age cohort, and the utility function they maximise. The core structural difference: OG-UK uses permanent ability types assigned at birth, while the OBR model uses stochastic earnings shocks each period — the latter generates precautionary savings and within-cohort inequality that evolves over the lifecycle.
| OG-UK | OBR UK OLG | |
|---|---|---|
| Within-cohort variation | J permanent ability types (deterministic) | Stochastic earnings shocks (AR(1) persistent + i.i.d. transitory) |
| Income inequality driver | Fixed type assignment at birth | Random shocks each period (ρz = 0.9, σz = 0.05, σe = 0.7) |
| Precautionary savings | Not a primary channel | Yes — driven by earnings uncertainty |
| Utility function | CRRA on consumption; elliptical labour disutility | Cobb-Douglas over consumption and leisure (non-separable) |
| Labour disutility | Elliptical function — always interior solutions | Implicit in Cobb-Douglas composite — corner solutions possible |
| Risk aversion parameter | σ on consumption only | σ₂ = 2 on consumption-leisure composite |
| Consumption aggregation | Stone-Geary Cobb-Douglas (subsistence levels, I goods) | Single consumption good |
| Discount factor | βj varies by ability type | β = 0.99 (uniform) |
Bequest motive
How each model handles wealth transfer across generations at death — whether bequests reflect a deliberate utility-generating choice, an accident of mortality, or some combination.
| OG-UK | OBR UK OLG | |
|---|---|---|
| Motive | “Warm glow” weighted by mortality probability ρs | “Warm glow” with target level, kicks in at age j* = 91 |
| Varies by type | Yes — χbj calibrated per ability type | Uniform (φ₁ = 10, φ₂ = 4.55) |
| Distribution | To surviving households | Equal distribution to ages 55–75 |
Tax system
OG-UK estimates smooth parametric tax functions (Gouveia–Strauss, DEP or linear) from microdata that PolicyEngine UK generates — an open-source microsimulation of the UK income-tax and NICs rulebook. The estimated functions fold in income tax and NICs; OG-UK models consumption, wealth, corporate and bequest taxes separately on top. Any reform PolicyEngine can represent — rate, threshold or allowance changes — flows straight through after re-estimating on post-reform microdata.
The OBR UK OLGmodel instead hard-codes the statutory UK schedule directly: income tax as explicit bands (PA £12,570, HRT £50,270, ART £125,140 at 20 / 40 / 45%); NICs as a separate instrument (£12,570 / £50,270 at 8 / 2%); VAT as an effective 9.3%; and an explicit treatment of pension relief and drawdown taxation. A lever like “+1 pp basic rate from 2027–28” then takes one parameter to simulate — at the cost of less flexibility for reforms that reshape the schedule.
Government & fiscal policy
How the government collects revenue, spends, and closes its budget. The fiscal closure rule — which item adjusts to keep debt sustainable — is the modelling choice that determines who bears the long-run burden of any reform.
| OG-UK | OBR UK OLG | |
|---|---|---|
| Budget constraint | Revenue + new debt = debt service + G + Ig + pensions + TR + UBI | Revenue = welfare transfers + RBI + debt service (growth-adjusted) |
| Fiscal closure rule | Configurable: adjust G, TR, or combination after period TG1 | Residual Budgetary Item (RBI) adjusts to stabilise debt/GDP at 100% |
| Debt target | Configurable | Fixed at 100% of GDP |
| Public investment | Explicit (Ig contributes to public capital stock) | Not modelled as productive |
| Welfare transfers | Lump-sum TR | Age-dependent transfers (γj scaling) calibrated to OBR welfare spending projections |
| State pension | Part of transfers | Explicitly modelled as age-dependent welfare transfer from state pension age onwards |
| Spending categories | G (public goods) + Ig (infrastructure) + pensions + TR + UBI | Welfare transfers + residual non-interest spending (G⁰) |
Open economy
How foreign capital and foreign holdings of government debt enter each model, and whether the interest rate that follows comes from a global or a domestic margin.
| OG-UK | OBR UK OLG | |
|---|---|---|
| Approach | Parameterised capital mobility (ζK for capital, ζD for debt) | Binary switch: fully open (r = 5% exogenous) or fully closed (r endogenous) |
| Foreign capital | Continuous degree of openness | Either all or nothing |
| Net foreign assets | Derived from capital mobility parameters | NFA residually determined in open economy |
| Interest rate | Endogenous (influenced by openness parameters) | Either fixed at 5% (open) or MPK − δ (closed) |
Solution method & calibration
Both models are rational-expectations dynamic general equilibrium, but they solve different problems. OG-UK solves households’ first-order conditions directly via Euler equations and iterates to a full year-by-year transition path (Time Path Iteration), so a reform shows up as a complete trajectory rather than a long-run snapshot. OBR UK OLG uses Value Function Iteration (Kirkby’s VFI toolkit) and compares long-run steady states only; it does not trace the adjustment path between them. As a consequence OG-UK’s state space is continuous and its expectations run over the whole path, while the OBR model discretises assets and stochastic earnings on a grid and forms expectations within each steady state.
Calibration differs mainly in data sources and anchors. OG-UK draws demographics from the UN World Population Prospects (country 826), age-earning profiles from microdata via its permanent ability types, and tax functions from PolicyEngine-UK’s Enhanced FRS (FRS enhanced with HMRC SPI, LCFS and WAS); ONS GDP levels anchor the macro aggregates, and the modeller sets fiscal targets and growth assumptions. OBR UK OLGuses ONS mortality statistics for demographics, ONS ASHE plus the HMRC earnings distribution for age-earnings profiles, and HMRC / GOV.UK parameters directly for taxes; the model pins to the OBR March 2024 EFO — GDP per person of £35,100 (scaling parameter S = 19.81), population growth n = 0.75%, productivity growth g = 1.2%, and debt / GDP stabilised at 100%.
Source: OBR Working Paper No. 22, “A new UK overlapping generations model” (April 2025). OG-Core documentation and OG-UK calibration code.