model 06 — tax-benefit microsimulation · pe-microsim · UK · US · hosted
Calculate taxes and benefits.
Compare current law with a reform for a UK or US household, or estimate population-wide revenue and distributional effects.
A household in one call.
Four steps from nothing to a population-wide costing; each step's code sits alongside its narrative.
Pick a route: hosted MCP, CLI, or Python
Hosted MCP server
The quickest route is the hosted MCP server, with five tools — calculate_household, household_reform_impact, population_reform_impact, list_reform_parameters, and score_reform with model="microsim". The UK microdata credential is provisioned server-side.
CLI and Python
The pe-macro CLI mirrors the same tools; the Python package underneath is what the rest of this page walks through.
score_reform with model="obr"
takes this package's static costing as the direct effect and returns
the economy-wide feedback.
Install
From PyPI
The base install is shared tooling only; add [models] for the pinned UK + US country models, or a single country extra.
Calculate a household
Describe, pick a year, read
Describe the people, pick a year, read the results — no data access or credentials needed. Pass a reform dict to apply parameter changes.
Household-level reform impact
differencing runs with and without reform gives the
household-level impact: for the UK earner opposite, a 25% basic rate
({"gov.hmrc.income_tax.rates.uk[0].rate": 0.25}) adds
£1,872 of income tax and cuts net income by the
same amount.
Score a whole population
Representative datasets
The same package runs whole representative datasets — the enhanced UK Family Resources Survey, the US CPS — aggregating any variable by decile, entity or demographic.
HUGGING_FACE_TOKEN from an account with access to
policyengine/policyengine-uk-data before running UK
population examples locally. The hosted MCP server provisions this
credential server-side.
From one family to the whole distribution.
| question | how |
|---|---|
| What does this reform do to this family? | calculate_household / household_reform_impact — every tax, benefit and income variable at person, benefit-unit/tax-unit and household level. On the hosted MCP server and the pe-macro CLI. |
| What does it cost, and who wins? | population_reform_impact and pe.uk.economic_impact_analysis — budgetary impact, decile changes, winners and losers, poverty, inequality, regional impacts. Hosted, enhanced-FRS credential provisioned server-side. |
| What levers exist? | list_reform_parameters — the parameter tree you can write reforms against. |