Skip to content

Residualize modeled health premiums#844

Draft
daphnehanse11 wants to merge 2 commits intomainfrom
codex/issue-8089-moop-premium-residualization
Draft

Residualize modeled health premiums#844
daphnehanse11 wants to merge 2 commits intomainfrom
codex/issue-8089-moop-premium-residualization

Conversation

@daphnehanse11
Copy link
Copy Markdown
Collaborator

Summary

  • Adds a CPS data-generation step that residualizes imputed health premium inputs by subtracting baseline computed premiums when the installed policyengine-us exposes them.
  • Allocates tax-unit-level computed premiums, such as CHIP, Marketplace, and Medicaid premiums, to the first person in each tax unit before subtracting from person-level imputed premiums.
  • Adds unit tests for residual math and tax-unit-to-person allocation.

Addresses PolicyEngine/policyengine-us#8089.

Notes

The residualization step is version-gated so current builds remain safe when a computed premium variable is not present in the locked policyengine-us version. This creates the us-data path needed for computed premium reforms to replace, rather than double-count with, baseline imputed MOOP components.

Tests

  • uv run pytest tests/unit/datasets/test_health_premium_residualization.py tests/unit/datasets/test_marketplace_plan_benchmark_ratio.py tests/unit/test_medicare_part_b_inputs.py
  • uv run ruff format .
  • uv run ruff format --check .
  • uv lock --locked
  • uv run ruff check policyengine_us_data/datasets/cps/cps.py tests/unit/datasets/test_health_premium_residualization.py

Full uv run ruff check . was also run; it fails on existing unrelated lint issues across notebooks, Modal scripts, long-term projection scripts, and tests.

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.

2 participants