Skip to content

Add enhanced FRS (wealth + consumption imputation) and VAT#8

Merged
nikhilwoodruff merged 4 commits intomainfrom
add-efrs-and-vat
Apr 5, 2026
Merged

Add enhanced FRS (wealth + consumption imputation) and VAT#8
nikhilwoodruff merged 4 commits intomainfrom
add-efrs-and-vat

Conversation

@nikhilwoodruff
Copy link
Copy Markdown
Contributor

@nikhilwoodruff nikhilwoodruff commented Apr 4, 2026

Summary

Ports the EFRS pipeline from policyengine-uk-data to Rust, adds a VAT model, and fixes state pension reform responsiveness.

Enhanced FRS (--extract-efrs): trains random forest models (smartcore) on WAS Round 7 (10 wealth targets) and LCFS 2021/22 (17 consumption targets), predicts onto FRS households, and calibrates energy to NEED 2023 targets via iterative raking. New entity fields: TenureType, AccommodationType, 10 wealth fields, 17 consumption fields. Clean CSV format extended with backwards compatibility.

VAT (vat parameter block): applies standard (20%), reduced (5%), and zero rates by COICOP category when EFRS consumption data is available, or estimates from disposable income using ONS propensity-to-consume curves otherwise. Historical rates back to 1994 (17.5%/15%/20%). VAT is deducted from household net income and included in total tax revenue.

State pension fix: previously, reported SP amounts were passed through verbatim — changing the SP parameter had near-zero distributional impact because calculate_state_pension returned p.state_pension (the FRS-reported value) without scaling. Now, reported amounts are scaled by reform_rate / baseline_rate, and the gross income calculation adjusts accordingly. A 5% SP increase now correctly shows +£5.8bn spending, 30% winners (pensioner households), and a progressive distributional pattern (bottom decile +1.6%, top decile +0.2%).

Test plan

  • cargo test — 108 tests pass
  • cargo build --release — clean, no warnings
  • Baseline simulation produces sensible aggregates (IT £269bn, NI £49bn, VAT £96bn, SP £115bn)
  • VAT raise (25%) + IT cut (15% basic) shows expected regressive pattern
  • SP +5% reform shows +£5.8bn, progressive distributional impact
  • Run --extract-efrs with WAS + LCFS data to verify RF training pipeline end-to-end

nikhilwoodruff and others added 3 commits April 5, 2026 10:48
…e pension scaling

Ports the EFRS pipeline from policyengine-uk-data to Rust: trains random forest models on WAS (wealth) and LCFS (consumption) survey data, predicts onto FRS households, and calibrates energy consumption to NEED 2023 targets. Adds a household-level VAT calculation (standard/reduced/zero rates by COICOP category) wired into net income, enabling distributional analysis of consumption tax reforms.

Fixes state pension reform responsiveness: reported SP amounts are now scaled by reform_rate/baseline_rate so that changing the SP parameter actually affects household net income. Previously reported amounts were passed through verbatim, making SP reforms have near-zero distributional impact.

New CLI flags: --extract-efrs, --was-dir, --lcfs-dir.

Co-Authored-By: Claude <noreply@anthropic.com>
HICBC is now correctly modelled as an income tax charge on the highest
earner (Phase 2b of simulation) rather than a child benefit reduction.
Child benefit is paid in full; the charge is tapered between the HICBC
threshold and taper end based on adjusted net income.

Also adds auto-detection of data/efrs_clean (preferred) or data/frs_clean
when no explicit data source is specified on the CLI.

Co-Authored-By: Claude <noreply@anthropic.com>
…dd efrs to Python DATASETS

State pension now matches policyengine-uk approach: new SP recipients (reached SP age
after April 2016) get the full parameter rate directly; basic SP recipients get reported
amounts scaled by reform ratio. Also adds fiscal_year parameter to Simulation constructor
and adds "efrs" to the Python interface's DATASETS tuple for GCS download support.

Co-Authored-By: Claude <noreply@anthropic.com>
Calculate per-person state pension in Phase 1a before income tax in
Phase 1b, so SP reforms correctly affect taxable income. Previously
income tax used reported SP amounts regardless of reform parameters,
causing £0 revenue change for SP reforms.

Also fixes HMAC download truncation in Python data module (adds
content-length verification and timeout).

Co-Authored-By: Claude <noreply@anthropic.com>
@nikhilwoodruff nikhilwoodruff merged commit 9cdbef8 into main Apr 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant