|
34 | 34 | "docstring": "Impute rent and real_estate_taxes from ACS with state.\n\nArgs:\n data: CPS data dict.\n state_fips: State FIPS per household.\n time_period: Tax year.\n dataset_path: Path to CPS h5 for Microsimulation.\n\nReturns:\n Updated data dict.", |
35 | 35 | "id": "acs_qrf", |
36 | 36 | "kind": "function", |
37 | | - "line": 485, |
| 37 | + "line": 490, |
38 | 38 | "metadata": { |
39 | 39 | "api_refs": [ |
40 | 40 | "policyengine_us_data.calibration.source_impute._impute_acs" |
|
61 | 61 | "docstring": "\"Add auto loan balance, interest and net_worth variable.", |
62 | 62 | "id": "add_auto_loan", |
63 | 63 | "kind": "function", |
64 | | - "line": 2859, |
| 64 | + "line": 2894, |
65 | 65 | "metadata": { |
66 | 66 | "api_refs": [ |
67 | 67 | "policyengine_us_data.datasets.cps.cps.add_auto_loan_interest_and_net_worth" |
|
142 | 142 | "docstring": "Impute ORG-derived wage and union inputs onto CPS persons.", |
143 | 143 | "id": "add_org_inputs", |
144 | 144 | "kind": "function", |
145 | | - "line": 2743, |
| 145 | + "line": 2778, |
146 | 146 | "metadata": { |
147 | 147 | "api_refs": [ |
148 | 148 | "policyengine_us_data.datasets.cps.cps.add_org_labor_market_inputs" |
|
810 | 810 | "docstring": "Replace clone-half person-level feature variables with donor matches.", |
811 | 811 | "id": "clone_features", |
812 | 812 | "kind": "function", |
813 | | - "line": 411, |
| 813 | + "line": 412, |
814 | 814 | "metadata": { |
815 | 815 | "api_refs": [ |
816 | 816 | "policyengine_us_data.datasets.cps.extended_cps._splice_clone_feature_predictions" |
|
873 | 873 | "docstring": "Assert that final exported variables are leaf inputs.", |
874 | 874 | "id": "computed_export_contract", |
875 | 875 | "kind": "function", |
876 | | - "line": 1584, |
| 876 | + "line": 1585, |
877 | 877 | "metadata": { |
878 | 878 | "api_refs": [ |
879 | 879 | "policyengine_us_data.datasets.cps.extended_cps.ExtendedCPS._assert_no_computed_variables_exported" |
|
967 | 967 | "docstring": "Second-stage QRF: train on CPS, predict for PUF clones.\n\nFor the PUF clone half of the extended CPS we need plausible values\nof CPS-only variables (retirement distributions, transfers, hours,\nSPM components, etc.) that are consistent with the clone's\nPUF-imputed income -- not just naively copied from the CPS donor.\n\nWe train a QRF on CPS person-level data where:\n * predictors = demographics + key income variables\n * outputs = CPS-only variables listed in\n ``CPS_ONLY_IMPUTED_VARIABLES``\n\nFor PUF clone prediction we use the PUF-imputed income values\nfrom the second half of ``data`` (the clone half, which already\nhas PUF-imputed income from stage 1).\n\nUses ``fit_predict()`` with ``max_train_samples`` instead of\nmanual sampling + separate fit/predict.\n\nArgs:\n data: Extended dataset dict after ``puf_clone_dataset()`` --\n already doubled, with PUF-imputed income in the second half.\n time_period: Tax year.\n dataset_path: Path to the CPS h5 file for Microsimulation.\n\nReturns:\n DataFrame with one column per CPS-only variable, containing\n predicted values for the PUF clone half (person-level).", |
968 | 968 | "id": "cps_only", |
969 | 969 | "kind": "function", |
970 | | - "line": 450, |
| 970 | + "line": 451, |
971 | 971 | "metadata": { |
972 | 972 | "api_refs": [ |
973 | 973 | "policyengine_us_data.datasets.cps.extended_cps._impute_cps_only_variables" |
|
1252 | 1252 | "docstring": "Check formula-reconstructed housing assistance before export.\n\nThe final H5 must not export formula outputs such as ``housing_assistance``.\nThis guard verifies that the remaining leaf inputs still make those\nformulas produce nonzero values before the export contract strips or\nrejects computed variables.", |
1253 | 1253 | "id": "housing_assistance_microsim_validation", |
1254 | 1254 | "kind": "function", |
1255 | | - "line": 1354, |
| 1255 | + "line": 1355, |
1256 | 1256 | "metadata": { |
1257 | 1257 | "api_refs": [ |
1258 | 1258 | "policyengine_us_data.datasets.cps.extended_cps.ExtendedCPS._validate_housing_assistance_microsimulation" |
|
3075 | 3075 | "docstring": "Replace PUF clone half of CPS-only variables with QRF predictions.\n\nAfter ``puf_clone_dataset()`` the CPS-only variables in the second\nhalf are naive copies of the CPS donor values. This function\nreplaces them with the second-stage QRF predictions that are\nconsistent with the clone's PUF-imputed income.\n\nArgs:\n data: Extended dataset dict (already doubled).\n predictions: DataFrame from ``_impute_cps_only_variables()``.\n time_period: Tax year.\n dataset_path: Path to CPS h5 file for entity mapping.\n\nReturns:\n Modified data dict with CPS-only variables spliced in.", |
3076 | 3076 | "id": "qrf_pass2", |
3077 | 3077 | "kind": "function", |
3078 | | - "line": 824, |
| 3078 | + "line": 825, |
3079 | 3079 | "metadata": { |
3080 | 3080 | "api_refs": [ |
3081 | 3081 | "policyengine_us_data.datasets.cps.extended_cps._splice_cps_only_predictions" |
|
3461 | 3461 | "docstring": "Impute net_worth and auto_loan from SCF.\n\nArgs:\n data: CPS data dict.\n state_fips: State FIPS per household.\n time_period: Tax year.\n dataset_path: Path to CPS h5 for Microsimulation.\n\nReturns:\n Updated data dict.", |
3462 | 3462 | "id": "scf_qrf", |
3463 | 3463 | "kind": "function", |
3464 | | - "line": 922, |
| 3464 | + "line": 1004, |
3465 | 3465 | "metadata": { |
3466 | 3466 | "api_refs": [ |
3467 | 3467 | "policyengine_us_data.calibration.source_impute._impute_scf" |
|
3515 | 3515 | "docstring": "Impute tip_income, liquid assets, and vehicle signals from SIPP.\n\nArgs:\n data: CPS data dict.\n state_fips: State FIPS per household.\n time_period: Tax year.\n dataset_path: Path to CPS h5 for Microsimulation.\n\nReturns:\n Updated data dict.", |
3516 | 3516 | "id": "sipp_qrf", |
3517 | 3517 | "kind": "function", |
3518 | | - "line": 586, |
| 3518 | + "line": 591, |
3519 | 3519 | "metadata": { |
3520 | 3520 | "api_refs": [ |
3521 | 3521 | "policyengine_us_data.calibration.source_impute._impute_sipp" |
|
3542 | 3542 | "docstring": "Re-impute ACS/SIPP/ORG/SCF variables from donor surveys.\n\nOverwrites existing imputed values in data. ACS uses\nstate_fips as a QRF predictor; ORG uses state plus labor-market\npredictors; SIPP and SCF use only demographic and financial\npredictors (no state data).\n\nArgs:\n data: CPS dataset dict {variable: {time_period: array}}.\n state_fips: State FIPS per household.\n time_period: Tax year.\n dataset_path: Path to CPS h5 for Microsimulation.\n skip_acs: Skip ACS imputation.\n skip_sipp: Skip SIPP imputation.\n skip_org: Skip ORG imputation.\n skip_scf: Skip SCF imputation.\n\nReturns:\n Updated data dict with re-imputed variables.", |
3543 | 3543 | "id": "source_impute", |
3544 | 3544 | "kind": "function", |
3545 | | - "line": 180, |
| 3545 | + "line": 185, |
3546 | 3546 | "metadata": { |
3547 | 3547 | "api_refs": [ |
3548 | 3548 | "policyengine_us_data.calibration.source_impute.impute_source_variables" |
|
0 commit comments