UK: household-wealth imputation stage with cash / S&S ISA split#181
Draft
vahid-ahmadi wants to merge 2 commits into
Draft
UK: household-wealth imputation stage with cash / S&S ISA split#181vahid-ahmadi wants to merge 2 commits into
vahid-ahmadi wants to merge 2 commits into
Conversation
Declare a WAS-donor `household_wealth` source stage (manifest + plan module, mirroring the bus imputation pattern) that surfaces `cash_isa` and `stocks_and_shares_isa` as standalone outputs, with the investment-ISA component also folded into `corporate_wealth` for back-compatibility. Addresses the gap from the archived UK data wealth imputation, where investment ISAs were summed into corporate_wealth (not separable) and cash ISAs were never represented. The matching model-side input variables are in PolicyEngine/policyengine-uk#1791. Draft: the executable WAS donor transform is injected by the build runtime (not in this manifest by design); requesting review on stage placement given the UK build module (bus, geography) currently lives on uk-bus-fare-imputation-calibration. Closes #180 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The uk/ build package is a spec-only country package (JSON resources listed in country_package.json; runtime Python lives in shared modules). The first cut added a plan module and __init__.py into uk/, violating the spec-only contract. - Drop uk/wealth_imputation.py and uk/__init__.py. - Register wealth_source_stages.json in uk/country_package.json resources. - Rewrite test_uk_wealth.py to load the manifest via the shared load_source_manifest runtime and assert the cash/S&S ISA split, the fit+clip operations, and the fold into corporate_wealth. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a WAS-donor
household_wealthsource stage — a declarative manifest (uk/wealth_source_stages.json) plus a plan module (uk/wealth_imputation.py) mirroringuk_bus_plan/us_plan— that imputes UK household wealth holdings and surfacescash_isaandstocks_and_shares_isaas standalone outputs. The investment-ISA component is alsofold_intocorporate_wealthfor back-compatibility.Why
Closes #180. The archived UK-data wealth imputation summed investment ISAs into
corporate_wealth(so they weren't separable) and never represented cash ISAs, leaving ISA balances unusable. Model-side input variables added in PolicyEngine/policyengine-uk#1791.For review (@MaxGhenis)
uk/__init__.py, bus imputation, geography) currently lives onuk-bus-fare-imputation-calibration, notmain. I added a minimaluk/__init__.pyexporting only the wealth symbols; this will need reconciling/stacking with that branch when it lands — guidance welcome.notes:cash_isa←DVCISAVR8(not mapped in the legacy imputation),stocks_and_shares_isa←DVIISAVR8.test_uk_wealth.py(manifest validity, plan assembly + donor citations, ISA split present/nonnegative, fold-into corporate_wealth), mirroringtest_uk_bus.py. Passing locally.