Restructure source-imputed CPS pipeline#631
Draft
MaxGhenis wants to merge 1 commit intoPolicyEngine:mainfrom
Draft
Restructure source-imputed CPS pipeline#631MaxGhenis wants to merge 1 commit intoPolicyEngine:mainfrom
MaxGhenis wants to merge 1 commit intoPolicyEngine:mainfrom
Conversation
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.
Summary
This rewires the CPS calibration pipeline around an explicit source-imputed stage instead of keeping ACS/SIPP/SCF donor imputations inside base
CPS.It also updates the donor inputs used by the 2024 path:
ACS_2024net_worthat the household level and align it to the 2024 national total before calibrationWhat changed
StratifiedExtendedCPS_2024,SourceImputedCPS_2024, andSourceImputedStratifiedExtendedCPS_2024CPSthe deterministic CPS transform only, and move donor-imputed variables behind the source-imputed stageEnhancedCPS_2024at the canonical source-imputed stratified inputacs_2022.h5toacs_2024.h5net_worthnet_worthfor now, so local calibration stays unchanged while we test the national path firstWhy
The current pipeline boundary is blurry: base
CPSmixes deterministic CPS ETL with modeled enrichment, and the 2024 path was still using stale 2022 ACS donors. This PR makes the staged artifacts line up with how calibration actually runs and gives us a cleaner place to evolve wealth/asset imputation.The
net_worthtarget split is intentionally transitional. The long-term direction is likely to replace the current local-vs-national distinction with multiple local-area presets at different sparsity levels, but this keeps the first wealth-target experiment scoped to the national unified-calibration path.Validation
uv run pytest -q policyengine_us_data/tests/test_calibration/test_source_impute.pyuv run pytest -q policyengine_us_data/tests/test_datasets/test_acs.py policyengine_us_data/tests/test_datasets/test_cps.py policyengine_us_data/tests/test_datasets/test_cps_pipeline.py policyengine_us_data/tests/test_calibration/test_target_config.pyFollow-ups
EnhancedCPSpath offbuild_loss_matrix()and onto the unified calibration path/config systemnet_worthtarget should become a more generic sparse-preset config instead of a "national" config