Skip to content

Conversation

@baogorek
Copy link
Collaborator

Summary

  • Add build_calibration_matrix.py runner script for building sparse calibration matrices with combined SNAP and health insurance premium targets
  • Add test_sparse_matrix_builder.py with tests for person-level aggregation and combined target support
  • Update changelog for minor version bump

Details

The health_insurance_premiums_without_medicare_part_b variable is a person-level target that needs to be aggregated to household level. The existing sparse_matrix_builder.py already handles this through PolicyEngine's map_to="household" parameter, which automatically sums person-level values to household level while preserving totals.

Closes #472

Test plan

  • Run pytest policyengine_us_data/tests/test_sparse_matrix_builder.py - 3 tests pass
  • Run python build_calibration_matrix.py from the local_area_calibration directory
  • Verify entity aggregation preserves totals (person-level sum == household-level sum)

🤖 Generated with Claude Code

baogorek and others added 7 commits January 15, 2026 09:53
- Add build_calibration_matrix.py runner for building X_sparse matrix
  with SNAP + health_insurance_premiums_without_medicare_part_b targets
- Add test_sparse_matrix_builder.py with tests for person-level
  aggregation and combined target support
- Update changelog_entry.yaml

Closes #472

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Add fit_calibration_weights.py for L0-regularized weight optimization
- Add l0-python as optional dependency under [project.optional-dependencies]
- Uses SparseCalibrationWeights from l0.calibration package
- Builds calibration matrix for all 436 congressional districts
- Filters to achievable targets before fitting

Co-Authored-By: Claude Opus 4.5 <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.

Add health insurance premiums to local area calibration

2 participants