Skip to content

WIP: port 75y long-run projection engine to microplex-us (rebase on MP base)#213

Draft
MaxGhenis wants to merge 1 commit into
mainfrom
claude/port-75y-longrun
Draft

WIP: port 75y long-run projection engine to microplex-us (rebase on MP base)#213
MaxGhenis wants to merge 1 commit into
mainfrom
claude/port-75y-longrun

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

WIP: port the 75y long-run projection engine to microplex-us

policyengine-us-data is being deprecated in favor of microplex-us, and the 75y long-run (CRFB) projection currently builds from the eCPS — it should build from the MP dataset. This PR relocates the engine into microplex_us.longrun ahead of MP promotion so it's ready to rebase the moment MP is promoted. Opening as draft.

Done

  • Relocated the 4-file engine (run_household_projection, projection_utils, calibration, ssa_data) into src/microplex_us/longrun/.
  • Rewired imports: relative cross-module imports; STORAGE_FOLDER → local longrun/data/ (the only us-data coupling was that one import).
  • Ported the SSA Trustees data it depends on (SSPopJul_TR2024.csv, social_security_aux.csv).
  • Added the MP-base rebase hook to the dataset registry (mp_2024).
  • Library modules (calibration, projection_utils, ssa_data) import + smoke-test clean.

Calibration backends (for reviewers)

The default reweighter is entropy balancing (KL-divergence min vs base weights via scipy.optimize.minimize); the L0 path is microcalibrate / HardConcrete (torch GD + L0). The 75y profile only calibrates age / SS / payroll / TOB — income tax is a free functional, which is why the native model can produce income tax > GDP (see TODO + loop journal iter87).

TODO (post-promotion)

  1. Rebase base_dataset on the promoted MP arch-calibrated dataset (set SELECTED_DATASET="mp_2024").
  2. Income anchoring — the real fix for the income-tax-over-GDP under-determination: regularize forward weights toward the income-rich MP base + add a CBO long-run income-tax-receipts %GDP target.
  3. Refactor run_household_projection.py from a top-level script into an importable def main() entrypoint.
  4. Finish lint cleanup of inherited code.

Depends on MP promotion (the 75y base = the promoted MP dataset). Tracks the calibration-fix work in #200 and the under-determination findings in the mp-ecps loop journal.

policyengine-us-data is being deprecated in favor of microplex-us, and the 75y
long-run (CRFB) projection should build from the MP dataset, not the eCPS. This
relocates the engine ahead of MP promotion.

Done:
- Relocate the 4-file engine (run_household_projection, projection_utils,
  calibration, ssa_data) into src/microplex_us/longrun/.
- Rewire imports: relative cross-module imports; STORAGE_FOLDER -> local
  longrun/data/ (only us-data coupling was this one import).
- Port the SSA Trustees data files it depends on (SSPopJul_TR2024.csv,
  social_security_aux.csv).
- Add the MP-base rebase hook to the dataset registry (mp_2024).
- Library modules import + smoke-test clean.

TODO (post-promotion):
- Rebase base_dataset on the promoted MP arch-calibrated dataset (set
  SELECTED_DATASET=mp_2024).
- Income anchoring (the real fix for income-tax>GDP under-determination):
  regularize forward weights toward the income-rich MP base + add a CBO
  long-run income-tax-receipts %GDP target. (calibration only constrains
  age/SS/payroll/TOB today; income tax is a free functional.)
- Refactor run_household_projection.py from a top-level script into an
  importable entrypoint (def main()).
- Finish lint cleanup of inherited code (bare excepts, unused vars).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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