Commit 9cdbef8
Add enhanced FRS (wealth + consumption imputation) and VAT (#8)
* Add enhanced FRS (wealth + consumption imputation), VAT, and fix state 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>
* Move HICBC to income tax charge, add EFRS auto-detect default
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>
* Fix state pension (new vs basic SP), add fiscal_year to Simulation, add 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>
* State pension flows through to income tax: reorder simulation phases
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>
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 54af6fe commit 9cdbef8
58 files changed
Lines changed: 2206 additions & 227 deletions
File tree
- interfaces/python/policyengine_uk_compiled
- parameters
- src
- data
- efrs
- engine
- parameters
- variables
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
47 | 55 | | |
48 | 56 | | |
49 | 57 | | |
| |||
60 | 68 | | |
61 | 69 | | |
62 | 70 | | |
63 | | - | |
| 71 | + | |
64 | 72 | | |
65 | 73 | | |
66 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
133 | 139 | | |
134 | 140 | | |
135 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
133 | 139 | | |
134 | 140 | | |
135 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
133 | 139 | | |
134 | 140 | | |
135 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
133 | 139 | | |
134 | 140 | | |
135 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
133 | 139 | | |
134 | 140 | | |
135 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
133 | 139 | | |
134 | 140 | | |
135 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
133 | 139 | | |
134 | 140 | | |
135 | 141 | | |
| |||
0 commit comments