Skip to content

2015-2016 households with a member 65+ fail: Medicare IRMAA reads 2013-2014 AGI, where the 401(k) limit parameter does not exist #9613

Closed

Description

@MaxGhenis

Summary

Any 2015 or 2016 household with a member aged 65 or older fails to compute income_tax or household_net_income.

medicare_irmaa_magi_two_years_prior computes adjusted_gross_income at period.offset(-2, "year"), so it asks for AGI in 2013 or 2014. backdate_parameters(first_instant="2015-01-01") does not reach those years, and the AGI chain needs gov.irs.gross_income.retirement_contributions.limit[401k] through elective_deferral_limit, so the calculation raises.

Reproduction

main at 9e5852a:

from policyengine_us import Simulation
for y in (2015, 2016, 2017):
    sim = Simulation(situation={
        "people": {"p": {"age": {y: 66}, "employment_income": {y: 30000}}},
        "households": {"h": {"members": ["p"], "state_code": {y: "TX"}}},
    })
    print(y, sim.calculate("income_tax", y))
  • 2015: ParameterNotFoundError: The parameter 'gov.irs.gross_income.retirement_contributions.limit[401k]' was not found in the 2013-01-01 tax and benefit system.
  • 2016: the same error at 2014-01-01.
  • 2017: OK.

Call chain:

medical_expense_health_insurance_premiums
  -> medicare_part_b_premium
  -> gross_medicare_part_b_premium
  -> medicare_irmaa_magi_two_years_prior
  -> adjusted_gross_income (2013/2014)
  -> irs_employment_income
  -> traditional_401k_contributions
  -> elective_deferral_limit

The premium is computed even when medicare_enrolled is false, because medical_expense_health_insurance_premiums multiplies the premium by enrollment rather than gating the computation.

Possible fixes

  • Stop the lag at the model's first year: when period.offset(-2) is before 2015, use the earliest supported year, or return 0.
  • Alternatively, backdate the parameters on the AGI path to 2013.

Either way, add a 2015 test with a 65+ person.

Found while fixing Arkansas 2014-2020 income tax in #9611 and #9612. #9612's tests supply itemized_medical_expenses directly to avoid this.

Activity

  1. added a commit that references this issue on Sep 27, 2026
    b79d161
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions