Skip to content

Extend uprating factors through 2100 #6384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

MaxGhenis
Copy link
Contributor

@MaxGhenis MaxGhenis commented Aug 9, 2025

Summary

  • Extended all uprating factors through year 2100 using the growth rate from the final year of existing projections
  • This enables long-term policy simulations and fiscal projections

Changes

  • IRS uprating: Extended using 2034-2035 growth rate in policyengine_us/parameters/gov/irs/uprating.py
  • SNAP uprating: Extended using 2033-2034 growth rate (2.246% annual) in policyengine_us/parameters/gov/usda/snap/uprating.yaml
  • CPI-U: Extended using 2034-2035 growth rate (2.336% annual) in policyengine_us/parameters/gov/bls/cpi/cpi_u.yaml
  • Chained CPI-U: Extended using 2034-2035 growth rate (1.988% annual) in policyengine_us/parameters/gov/bls/cpi/c_cpi_u.yaml
  • CPI-W: Extended using approximately 2.3% annual growth rate in policyengine_us/parameters/gov/bls/cpi/cpi_w.yaml

Implementation Details

For each uprating factor, I calculated the growth rate from the last two years of existing projections and applied that constant rate forward through 2100. This approach ensures smooth continuation of trends without arbitrary assumptions about future economic conditions.

Test Plan

  • Verified Python syntax is valid
  • Verified YAML files parse correctly
  • Ran make format to ensure code style compliance
  • CI tests should verify microsimulation still works correctly

Fixes #6383

🤖 Generated with Claude Code

MaxGhenis and others added 6 commits August 9, 2025 06:05
Extended all uprating factors through year 2100 using the growth rate from the final year of existing projections. This enables long-term policy simulations and fiscal projections.

Changes:
- IRS uprating extended using 2034-2035 growth rate
- SNAP uprating extended using 2033-2034 growth rate (2.246% annual)
- CPI-U extended using 2034-2035 growth rate (2.336% annual)
- Chained CPI-U extended using 2034-2035 growth rate (1.988% annual)
- CPI-W extended using approximately 2.3% annual growth rate

Fixes PolicyEngine#6383

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Added comprehensive tests to verify that all uprating factors
(IRS, SNAP, CPI-U, Chained CPI-U, CPI-W) correctly extend
through year 2100 with consistent growth rates.

Tests verify:
- Values exist for year 2100
- Growth rates are consistent after the projection period
- Growth rates are within reasonable bounds (1-4% annually)
- Values in 2100 are appropriately higher than 2035 values

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Moved uprating tests to appropriate directories under tests/policy/baseline/gov/
to ensure they are picked up by the CI selective test runner:
- IRS uprating test → gov/irs/parameters/
- SNAP uprating test → gov/usda/snap/
- CPI uprating tests → gov/bls/

This ensures the tests will run when the corresponding parameter files are changed.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Refactored all uprating tests to be more resilient to future changes:
- Test properties (monotonic increase, consistent growth) rather than specific values
- Use wider growth rate bounds (0.5% - 5%) to avoid false failures
- Test that values exist for 2100 without hardcoding expected values
- Focus on verifying the extension logic works correctly

This makes the tests maintainable when we update the base uprating values
in the future - tests will continue to pass as long as the fundamental
properties (extension to 2100, consistent growth) are maintained.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Added underscore thousands separators to all values >= 1000 in:
- SNAP uprating (values from 2077 onward)
- CPI-U (values from 2075 onward)
- CPI-W (values from 2080 onward)

This improves readability following PolicyEngine conventions.
Chained CPI-U values don't exceed 1000 by 2100 so no changes needed there.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Extended SSA uprating through 2100 using 2.26% annual growth rate
- Extended HHS poverty line uprating through 2100 using 2.24% annual growth
- Updated SSA 2025 value to reflect actual 2.5% COLA announced by SSA
- Added thousands separators to all values >= 1000 for readability

This completes the extension of all major uprating factors (IRS, SNAP, SSA, HHS, CPI)
through year 2100 to support long-term policy simulations.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Created unified uprating extension script for all parameters
- Removed hardcoded future values from YAML files
- Updated tests to use microsimulation approach
- Removed unnecessary if statements in test code
- Cleaned up changelog entry
- Filed issue for moving this functionality to policyengine-core
@MaxGhenis
Copy link
Contributor Author

CI check requested after addressing review comments.

- Extended CPI-U, Chained CPI-U, and CPI-W through 2100 programmatically
- Removed hardcoded future values from CPI YAML files
- Created single comprehensive test for all uprating extensions
- Removed redundant individual uprating test files
@MaxGhenis
Copy link
Contributor Author

Latest changes:

  • Added CPI-U, Chained CPI-U, and CPI-W to the unified programmatic uprating approach
  • Created a single comprehensive test file for all uprating extensions
  • Removed hardcoded values from all YAML files (IRS, SNAP, SSA, HHS, and CPI parameters)

All tests pass locally. Waiting for CI to trigger.

@MaxGhenis
Copy link
Contributor Author

Verification of Programmatic Uprating Values

I've created a Jupyter notebook to verify that the programmatically generated uprating values compare with the previously hardcoded values:

📓 View the verification notebook

Key Findings:

The programmatic approach generates values that are very close to the hardcoded ones, with some expected differences:

  • SNAP: Nearly identical (max 0.11% difference)
  • CPI indices: Small differences that compound over time (< 1% for near years)
  • SSA/HHS: Larger differences in distant years due to compounding

These differences arise because:

  1. The programmatic approach uses a consistent growth rate calculated from the last two years of projections
  2. The hardcoded values may have used slightly different growth rates or rounding methods
  3. Small differences compound over long time horizons (to 2100)

The programmatic approach is more maintainable and consistent, ensuring:

  • Uniform methodology across all uprating factors
  • Easy updates when new CBO projections are released
  • No manual calculation errors
  • Consistent growth rates within each parameter

The small differences from hardcoded values are acceptable given the improved maintainability and consistency of the new approach.

- Kept upstream HHS uprating references (more complete)
- Accepted upstream uv.lock
- Maintained programmatic uprating extensions
@MaxGhenis
Copy link
Contributor Author

✅ CI Passed!

All checks have passed after merging with upstream master:

  • Lint: ✅ Code formatting is correct
  • Tests: ✅ All tests pass including the new unified uprating tests
  • Version: ✅ Changelog properly updated

The PR is ready for review. The unified programmatic uprating approach is working correctly for all parameters (IRS, SNAP, SSA, HHS, CPI-U, Chained CPI-U, and CPI-W).

Copy link
Collaborator

@PavelMakarchuk PavelMakarchuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits

changed:
- Updated SSA 2025 value to reflect actual 2.5% COLA announced by SSA
- Refactored all uprating extensions from hardcoded YAML values to programmatic generation
- Consolidated individual uprating tests into a single comprehensive test file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again nit but I dont think we should include this in the changelog. It seems like we are adding commit changes, this will make looking back through the changelog harder

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this live in parameters? I know the old .py file was also stored there but we should probably separate it out from actual policy parameters

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.

Extend uprating factors through 2100
2 participants