Skip to content

Latest commit

 

History

History
67 lines (42 loc) · 1.93 KB

File metadata and controls

67 lines (42 loc) · 1.93 KB

Examples

Complete working scripts demonstrating common workflows. Each script can be run directly with python examples/<filename>.py.

US budgetary impact

The canonical workflow for comparing a baseline and reform simulation, using both economic_impact_analysis() and ChangeAggregate.

:language: python

UK policy reform analysis

Applying parametric reforms, comparing baseline and reform with ChangeAggregate, analysing winners and losers by income decile, and visualising results with Plotly.

:language: python

UK income bands

Calculating net income and tax by income decile using representative microdata and Aggregate with quantile filters.

:language: python

US income distribution

Loading enhanced CPS microdata, running a full microsimulation, and calculating statistics within income deciles.

:language: python

UK employment income variation

Creating a custom dataset with varied employment income, running a single simulation, and visualising benefit phase-outs.

:language: python

US employment income variation

Same approach as the UK version, varying employment income from $0 to $200k and plotting household net income.

:language: python

Household impact calculation

Using calculate_household_impact() to compute taxes and benefits for individual custom households (both UK and US).

:language: python

Simulation performance

Benchmarking how simulation.run() scales with dataset size.

:language: python