Skip to content

Latest commit

 

History

History
59 lines (34 loc) · 1.88 KB

File metadata and controls

59 lines (34 loc) · 1.88 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.

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.

UK income bands

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

US income distribution

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

UK employment income variation

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

US employment income variation

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

Household calculation

Using pe.uk.calculate_household() and pe.us.calculate_household() to compute taxes and benefits for individual custom households with flat keyword arguments and dot-access result objects.

Simulation performance

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