From 1d369d99ca950069b3ee9acf6fe7110f2facf035 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 11 Oct 2026 12:59:59 -0400 Subject: [PATCH 01/35] Use CMS Medicare spending per enrollee for the Medicare per capita cost Replace KFF's 2021 traditional-Medicare figure and an unsourced $14,500 2025 estimate (held flat for every later year) with CMS National Health Expenditure Table 17's Medicare spending per enrollee: historical 2013-2024, projected 2025-2034, extended to 2100 at the 2031-2032 rate so the end of sequestration in 2033 does not compound. Co-Authored-By: Claude Opus 5.5 --- .../medicare-per-enrollee-cms.fixed.md | 1 + .../gov/hhs/medicare/per_capita_cost.yaml | 68 ++++++++++++++++--- .../parameters/uprating_extensions.py | 17 +++++ 3 files changed, 78 insertions(+), 8 deletions(-) create mode 100644 changelog.d/medicare-per-enrollee-cms.fixed.md diff --git a/changelog.d/medicare-per-enrollee-cms.fixed.md b/changelog.d/medicare-per-enrollee-cms.fixed.md new file mode 100644 index 00000000000..04369fcfd3f --- /dev/null +++ b/changelog.d/medicare-per-enrollee-cms.fixed.md @@ -0,0 +1 @@ +Value Medicare enrollees at CMS's Medicare spending per enrollee (National Health Expenditure projections, 2013-2034, extended to 2100) instead of a $14,500 estimate held flat from 2025. diff --git a/policyengine_us/parameters/calibration/gov/hhs/medicare/per_capita_cost.yaml b/policyengine_us/parameters/calibration/gov/hhs/medicare/per_capita_cost.yaml index 3e92c3e491c..756e0272c4a 100644 --- a/policyengine_us/parameters/calibration/gov/hhs/medicare/per_capita_cost.yaml +++ b/policyengine_us/parameters/calibration/gov/hhs/medicare/per_capita_cost.yaml @@ -1,12 +1,64 @@ -description: Average Medicare spending per enrolled beneficiary (national average). Represents the annual value of Medicare coverage including Part A and Part B. -values: - 2021-01-01: 11_080 # Traditional Medicare (Part A and/or Part B) per KFF - 2025-01-01: 14_500 # Estimated - update with official Centers for Medicare & Medicaid Services (CMS) data when available +description: The Centers for Medicare and Medicaid Services (CMS) reports and projects this Medicare spending per enrollee, which is all Medicare spending, including payments to Medicare Advantage plans, Part D and program administration, divided by average enrollment in Part A, Part B or both. metadata: - label: Medicare per capita cost unit: currency-USD period: year + label: CMS Medicare spending per enrollee reference: - - title: KFF Medicare Spending Per Beneficiary (2021) - href: https://www.kff.org/medicare/state-indicator/per-beneficiary/ - - title: Note - 2024 value is estimated and should be updated with official Centers for Medicare & Medicaid Services (CMS) data + # Table17 Health Insurance Enrollment and Enrollment Growth Rates, + # "Spending per Enrollee ($)", "Medicare" row: Medicare spending (the same + # row as Table03's Medicare source of funds) divided by Medicare + # enrollment. Historical for 2013-2024, projected for 2025-2034. ZIP + # Last-Modified 2026-09-03, sha256 + # 264f822618a5e1829138aea57cc6c8bf45bbaf072a72898fef5547f7ece6cd70, + # retrieved 2026-10-11 from + # https://www.cms.gov/data-research/statistics-trends-and-reports/national-health-expenditure-data/projected + - title: CMS National Health Expenditure Projections 2025-2034, Table 17 + href: https://www.cms.gov/files/zip/nhe-projections-tables.zip + # Medicare enrollment is Part A and/or B enrollment by "a person-year + # methodology, which sums the number of months each beneficiary is enrolled + # during the year and divides by 12", with U.S. territories removed. + - title: "CMS National Health Expenditure Accounts: Methodology Paper, 2024, Medicare enrollment" + href: https://www.cms.gov/files/document/definitions-sources-and-methods.pdf#page=34 + # Medicare spending covers Parts A, B, C (Medicare Advantage) and D (file + # page 15) and, as program spending, federal administration and the + # non-medical expenditures of Part C and Part D private plans (file page + # 23). Premiums finance part of that spending rather than reduce it: the + # sponsor analysis counts SMI premiums as household spending on Medicare + # (file page 30). + - title: "CMS National Health Expenditure Accounts: Methodology Paper, 2024, Medicare spending" + href: https://www.cms.gov/files/document/definitions-sources-and-methods.pdf#page=23 + # "Projections of Medicare spending and enrollment used in the NHE + # projections were generated for the most recent Trustees Report", here + # the 2026 report. Last Updated June 24, 2026, sha256 + # ce62fe2c236cc96ce287027784b141584ddf39e62c5fd8ddc3e771a014944817. + - title: "Projections of National Health Expenditures and Enrollment: Methodology and Model Specification" + href: https://www.cms.gov/research-statistics-data-and-systems/statistics-trends-and-reports/nationalhealthexpenddata/downloads/projectionsmethodology.pdf#page=7 +values: + # Historical. + 2013-01-01: 11_483 + 2014-01-01: 11_683 + 2015-01-01: 11_929 + 2016-01-01: 12_119 + 2017-01-01: 12_319 + 2018-01-01: 12_795 + 2019-01-01: 13_366 + 2020-01-01: 13_547 + 2021-01-01: 14_293 + 2022-01-01: 14_921 + 2023-01-01: 15_915 + 2024-01-01: 16_779 + # Projections. + 2025-01-01: 17_751 + 2026-01-01: 18_983 + 2027-01-01: 20_096 + 2028-01-01: 21_310 + 2029-01-01: 22_543 + 2030-01-01: 23_789 + 2031-01-01: 25_185 + 2032-01-01: 26_552 + 2033-01-01: 28_277 + 2034-01-01: 30_129 + # 2035 to 2100 grow at the 2031-2032 rate (26_552 / 25_185, 5.4% a year), + # not the 2033-2034 rate, which carries the end of Medicare sequestration + # on August 31, 2033; later years hold the 2100 value. See + # set_all_uprating_parameters in uprating_extensions.py. diff --git a/policyengine_us/parameters/uprating_extensions.py b/policyengine_us/parameters/uprating_extensions.py index 23ec45e9904..df50047bd66 100644 --- a/policyengine_us/parameters/uprating_extensions.py +++ b/policyengine_us/parameters/uprating_extensions.py @@ -880,6 +880,23 @@ def set_all_uprating_parameters(parameters: ParameterNode) -> ParameterNode: period_day=1, ) + # CMS Medicare spending per enrollee (January values, last projection + # year 2034), which Medicare cost variables read directly. Sequestration + # cuts Medicare benefit payments 2 percent through August 31, 2033 (2026 + # Medicare Trustees Report, file page 62); its end lifts 2033 and 2034 + # growth, and the Trustees' per-beneficiary growth falls from 6.6 + # percent in 2034 to 5.4 percent in 2035 (Table V.D1, file page 210). + # So each year from 2035 to 2100 grows at the 2031-2032 rate, and later + # years hold the 2100 value. + extend_parameter_values( + parameters.calibration.gov.hhs.medicare.per_capita_cost, + last_projected_year=2034, + end_year=END_YEAR, + period_month=1, + period_day=1, + growth_years=(2031, 2032), + ) + # CBO income-by-source aggregates are used directly and as anchors for # SOI-based income upraters. Extending them in the baseline path keeps # long-run nominal data aging independent of scenario-specific reforms. From cdfe759d6fad3d2a226b2f6de05fb5d9cbf953de Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 11 Oct 2026 13:18:16 -0400 Subject: [PATCH 02/35] Test the Medicare spending per enrollee series and its consumers Transcription checks against NHE Table 17 (and its spending over enrollment), a cross-source level check against the Trustees Report's per beneficiary cost, Hypothesis properties for order, the 2035-2100 closed form and calendar-year steps, and identities for medicare_gross_cost, medicare_cost and qmb_cost_sharing. Existing expectations move from $14,500/$11,080 to the CMS values. Co-Authored-By: Claude Opus 5.5 --- .../core/test_medicare_per_capita_cost.py | 245 ++++++++++++++++++ .../gov/hhs/medicare/costs/medicare_cost.yaml | 10 +- .../medicare/costs/medicare_gross_cost.yaml | 6 +- .../medicare/savings_programs/msp_cost.yaml | 4 +- .../msp_federal_and_state_cost.yaml | 6 +- .../savings_programs/qmb_cost_sharing.yaml | 4 +- .../hhs/medicare/test_part_b_msp_offset.py | 6 +- .../household/cbo_household_income.yaml | 10 +- .../parameters/test_uprating_extensions.py | 5 + 9 files changed, 276 insertions(+), 20 deletions(-) create mode 100644 policyengine_us/tests/core/test_medicare_per_capita_cost.py diff --git a/policyengine_us/tests/core/test_medicare_per_capita_cost.py b/policyengine_us/tests/core/test_medicare_per_capita_cost.py new file mode 100644 index 00000000000..986236c9d7d --- /dev/null +++ b/policyengine_us/tests/core/test_medicare_per_capita_cost.py @@ -0,0 +1,245 @@ +"""The CMS Medicare spending per enrollee series that values Medicare coverage. + +``calibration.gov.hhs.medicare.per_capita_cost`` holds the "Medicare" row of +"Spending per Enrollee ($)" in CMS's National Health Expenditure projections, +Table 17 (2025-2034 release): Medicare spending over Medicare enrollment. +Spending covers every Part, including payments to Medicare Advantage plans and +program administration; enrollment counts Part A and/or Part B enrollees in +person-years; both exclude the territories (NHEA methodology paper, file pages +15, 23 and 34). 2013-2024 are historical and 2025-2034 projected, from the +projections prepared for the 2026 Medicare Trustees Report. 2035 to 2100 grow +at the 2031-2032 rate, because the end of sequestration on August 31, 2033 +lifts 2033 and 2034 growth. + +``medicare_gross_cost`` returns the series for each enrolled person, +``medicare_cost`` subtracts the person's Part A and gross Part B premiums, and +``qmb_cost_sharing`` pays QMB enrollees a share of it each month. + +Invariants: + +1. Transcription: every value is Table 17's published dollar figure, and is + consistent with the same table's Medicare spending over Medicare enrollment + within rounding. +2. Cross-source level: the Trustees Report's per beneficiary cost (Table V.D1) + runs 5% to 8% above the series in every year from 2015 to 2034. V.D1 sums + per-Part averages (its footnote 2), while Table II.B1 counts 63.4 million + Part B and 56.8 million Part D enrollees among 69.3 million in 2025. +3. Bounds and order: the series is positive and strictly increasing from 2013 + to 2100, and holds the 2100 value afterwards. +4. Extension rule: each year from 2035 to 2100 equals the 2034 value times + (26,552 / 25,185) ** (year - 2034), the closed form of the iterative + extension; the 2035 value is within 0.1% of the 2034 value grown at the + Trustees' 2034-2035 per beneficiary growth. +5. Calendar years: every date within a year reads the January 1 value. +6. Consumers: for an enrolled person, ``medicare_gross_cost`` equals the + series; ``medicare_cost`` equals the series less the Part A premium and the + gross Part B premium, floored at zero, so never exceeds + ``medicare_gross_cost``; a QMB enrollee's monthly ``qmb_cost_sharing`` is + the series over 12 times the QMB rate. A person not enrolled gets zero. +""" + +import pytest +from hypothesis import given, settings +from hypothesis import strategies as st +from policyengine_core.parameters.operations.get_parameter import get_parameter + +from policyengine_us import Simulation +from policyengine_us.system import system + +SERIES = "calibration.gov.hhs.medicare.per_capita_cost" +FIRST_YEAR, LAST_PROJECTED_YEAR, END_YEAR = 2013, 2034, 2100 +YEARS = range(FIRST_YEAR, LAST_PROJECTED_YEAR + 1) +GROWTH_YEARS = (2031, 2032) + +# CMS NHE projections tables, Table 17, "Medicare" rows +# (https://www.cms.gov/files/zip/nhe-projections-tables.zip, Last-Modified +# 2026-09-03, sha256 264f8226...cd70). +MEDICARE_SPENDING_PER_ENROLLEE = dict( + zip( + YEARS, + ( + *(11_483, 11_683, 11_929, 12_119, 12_319, 12_795, 13_366, 13_547), + *(14_293, 14_921, 15_915, 16_779, 17_751, 18_983, 20_096, 21_310), + *(22_543, 23_789, 25_185, 26_552, 28_277, 30_129), + ), + ) +) +MEDICARE_SPENDING_BILLIONS = dict( + zip( + YEARS, + ( + *(588.9, 617.3, 647.7, 675.7, 704.9, 751.6, 805.2, 833.8, 894.6), + *(951.7, 1037.3, 1118.0, 1204.0, 1314.6, 1422.7, 1544.2, 1664.6), + *(1783.7, 1911.1, 2035.8, 2188.3, 2354.3), + ), + ) +) +MEDICARE_ENROLLMENT_MILLIONS = dict( + zip( + YEARS, + ( + *(51.3, 52.8, 54.3, 55.8, 57.2, 58.7, 60.2, 61.6, 62.6, 63.8), + *(65.2, 66.6, 67.8, 69.2, 70.8, 72.5, 73.8, 75.0, 75.9, 76.7), + *(77.4, 78.1), + ), + ) +) +# 2026 Medicare Trustees Report, Table V.D1 (file page 210), "Total" average +# per beneficiary cost: historical through 2025, intermediate estimates after. +TRUSTEES_PER_BENEFICIARY_COST = dict( + zip( + range(2015, 2036), + ( + *(12_734, 12_922, 13_127, 13_604, 14_224, 14_401, 15_170, 15_820), + *(16_809, 17_837, 18_894, 20_430, 21_497, 22_783, 24_076, 25_401), + *(26_826, 28_169, 29_989, 31_967, 33_687), + ), + ) +) + +years = st.integers(FIRST_YEAR, END_YEAR) + + +def _series(date): + return get_parameter(system.parameters, SERIES)(date) + + +def _value(year): + return _series(f"{year}-01-01") + + +@pytest.mark.parametrize("year", YEARS) +def test_series_is_table_17_medicare_spending_per_enrollee(year): + assert _value(year) == MEDICARE_SPENDING_PER_ENROLLEE[year] + + +@pytest.mark.parametrize("year", YEARS) +def test_published_values_match_spending_over_enrollment(year): + """Checks the transcribed rows against each other, so one mistyped + spending, enrollment or per-enrollee figure fails.""" + spending = MEDICARE_SPENDING_BILLIONS[year] + enrollment = MEDICARE_ENROLLMENT_MILLIONS[year] + # Both components are rounded to one decimal and the published value to + # the dollar. + low = 1_000 * (spending - 0.05) / (enrollment + 0.05) - 0.5 + high = 1_000 * (spending + 0.05) / (enrollment - 0.05) + 0.5 + assert low <= MEDICARE_SPENDING_PER_ENROLLEE[year] <= high + + +@pytest.mark.parametrize("year", range(2015, LAST_PROJECTED_YEAR + 1)) +def test_trustees_per_beneficiary_cost_runs_5_to_8_percent_above(year): + ratio = TRUSTEES_PER_BENEFICIARY_COST[year] / _value(year) + assert 1.05 <= ratio <= 1.08 + + +def test_2035_extension_follows_the_trustees_2035_growth(): + trustees_growth = ( + TRUSTEES_PER_BENEFICIARY_COST[2035] / TRUSTEES_PER_BENEFICIARY_COST[2034] + ) + assert _value(2035) == pytest.approx( + _value(LAST_PROJECTED_YEAR) * trustees_growth, rel=0.001 + ) + + +@given(years, st.integers(1, END_YEAR - FIRST_YEAR)) +def test_series_is_positive_and_strictly_increasing(year, gap): + later = min(year + gap, END_YEAR) + if later == year: + return + assert 0 < _value(year) < _value(later) + + +@given(st.integers(LAST_PROJECTED_YEAR + 1, END_YEAR)) +def test_extension_is_the_closed_form_of_the_2031_2032_growth(year): + earlier, later = GROWTH_YEARS + growth = ( + MEDICARE_SPENDING_PER_ENROLLEE[later] + / (MEDICARE_SPENDING_PER_ENROLLEE[earlier]) + ) + expected = MEDICARE_SPENDING_PER_ENROLLEE[LAST_PROJECTED_YEAR] * growth ** ( + year - LAST_PROJECTED_YEAR + ) + assert _value(year) == pytest.approx(expected, rel=1e-9) + assert _value(year) / _value(year - 1) == pytest.approx(growth, rel=1e-12) + + +@given(st.integers(END_YEAR, END_YEAR + 100)) +def test_series_holds_the_2100_value_afterwards(year): + assert _value(year) == _value(END_YEAR) + + +@given(years, st.integers(1, 12), st.integers(1, 28)) +def test_every_date_in_a_year_reads_the_january_value(year, month, day): + assert _series(f"{year}-{month:02d}-{day:02d}") == _value(year) + + +def _person_simulation(year, person): + members = ["person"] + return Simulation( + situation={ + "people": {"person": person}, + "tax_units": {"tax_unit": {"members": members}}, + "spm_units": {"spm_unit": {"members": members}}, + "families": {"family": {"members": members}}, + "marital_units": {"marital_unit": {"members": members}}, + "households": { + "household": {"members": members, "state_code": {year: "CA"}} + }, + } + ) + + +@settings(max_examples=20, deadline=None) +@given( + st.integers(2015, END_YEAR), + st.floats(0, 12_000, allow_nan=False), + st.floats(0, 40_000, allow_nan=False), +) +def test_medicare_cost_nets_premiums_from_the_series( + year, part_a_premium, part_b_premium +): + simulation = _person_simulation( + year, + { + "age": {year: 70}, + "is_medicare_eligible": {year: True}, + "medicare_enrolled": {year: True}, + "base_part_a_premium": {year: part_a_premium}, + "gross_medicare_part_b_premium": {year: part_b_premium}, + }, + ) + gross = simulation.calculate("medicare_gross_cost", year)[0] + net = simulation.calculate("medicare_cost", year)[0] + # Variables are float32, so compare to single precision. + assert gross == pytest.approx(_value(year), rel=1e-6) + expected = max(_value(year) - part_a_premium - part_b_premium, 0) + assert net == pytest.approx(expected, rel=1e-6, abs=0.01) + assert net <= gross + + +@settings(max_examples=10, deadline=None) +@given(st.integers(2015, END_YEAR)) +def test_person_not_enrolled_has_no_medicare_cost(year): + simulation = _person_simulation( + year, + { + "age": {year: 70}, + "is_medicare_eligible": {year: True}, + "medicare_enrolled": {year: False}, + }, + ) + assert simulation.calculate("medicare_gross_cost", year)[0] == 0 + assert simulation.calculate("medicare_cost", year)[0] == 0 + + +@settings(max_examples=10, deadline=None) +@given(st.integers(2015, END_YEAR), st.integers(1, 12)) +def test_qmb_cost_sharing_is_the_qmb_rate_of_monthly_spending(year, month): + period = f"{year}-{month:02d}" + rate = system.parameters( + period + ).gov.hhs.medicare.savings_programs.qmb.cost_sharing_rate + simulation = _person_simulation(year, {"msp_category": {period: "QMB"}}) + assert simulation.calculate("qmb_cost_sharing", period)[0] == pytest.approx( + _value(year) / 12 * rate, rel=1e-6 + ) diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/medicare_cost.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/medicare_cost.yaml index 5cb855c4319..b0fb091fce4 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/medicare_cost.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/medicare_cost.yaml @@ -9,7 +9,7 @@ tax_exempt_interest_income: 2023: 0 output: - medicare_cost: 12_280 # $14,500 spending - $2,220 Part B premium (2025) + medicare_cost: 15_531 # $17,751 spending - $2,220 Part B premium (2025) - name: unit test 2 - enrolled, pays full Part A premium period: 2025 @@ -22,7 +22,7 @@ tax_exempt_interest_income: 2023: 0 output: - medicare_cost: 6_064 # $14,500 - $6,216 Part A - $2,220 Part B (2025) + medicare_cost: 9_315 # $17,751 - $6,216 Part A - $2,220 Part B (2025) - name: unit test 3 - enrolled with IRMAA period: 2025 @@ -36,7 +36,7 @@ 2023: 0 filing_status: SINGLE output: - medicare_cost: 6_953.2 # $14,500 - $7,546.80 Part B with IRMAA (2025) + medicare_cost: 10_204.2 # $17,751 - $7,546.80 Part B with IRMAA (2025) - name: unit test 4 - eligible but not enrolled period: 2025 @@ -58,7 +58,7 @@ tax_exempt_interest_income: 2019: 0 output: - medicare_cost: 9_298 # $11,080 - $1,782 Part B (2021: $148.50*12) + medicare_cost: 12_511 # $14,293 - $1,782 Part B (2021: $148.50*12) - name: unit test 6 - direct Part B premium input period: 2025 @@ -68,4 +68,4 @@ medicare_quarters_of_coverage: 40 gross_medicare_part_b_premium: 3_000 output: - medicare_cost: 11_500 # $14,500 spending - $3,000 Part B premium + medicare_cost: 14_751 # $17,751 spending - $3,000 Part B premium diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/medicare_gross_cost.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/medicare_gross_cost.yaml index cba1201e13c..15eb8725e7d 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/medicare_gross_cost.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/medicare_gross_cost.yaml @@ -10,7 +10,8 @@ tax_exempt_interest_income: 2023: 0 output: - medicare_gross_cost: 14_500 + # CMS Medicare spending per enrollee, 2025. + medicare_gross_cost: 17_751 - name: unit test 2 - premiums do not reduce gross Medicare value period: 2025 @@ -25,4 +26,5 @@ 2023: 0 filing_status: SINGLE output: - medicare_gross_cost: 14_500 + # CMS Medicare spending per enrollee, 2025. + medicare_gross_cost: 17_751 diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/savings_programs/msp_cost.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/savings_programs/msp_cost.yaml index 1e9cdaec98a..55be058ba49 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/savings_programs/msp_cost.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/savings_programs/msp_cost.yaml @@ -11,8 +11,8 @@ base_part_b_premium: 2_434.8 output: # Part B premium: $202.90 * 12 = $2,434.80. - # QMB cost sharing: $14,500 * 20% = $2,900. - msp_cost: 5_334.8 + # QMB cost sharing: $18,983 * 20% = $3,796.60. + msp_cost: 6_231.4 - name: Case 2, SLMB MSP-only beneficiary receives Part B premium value. period: 2026 diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/savings_programs/msp_federal_and_state_cost.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/savings_programs/msp_federal_and_state_cost.yaml index da73487521b..0c526fe9c29 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/savings_programs/msp_federal_and_state_cost.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/savings_programs/msp_federal_and_state_cost.yaml @@ -10,9 +10,9 @@ base_part_a_premium: 0 base_part_b_premium: 2_434.8 output: - # CA regular FMAP is 50%; total MSP cost is $5,334.80. - msp_federal_cost: 2_667.4 - msp_state_cost: 2_667.4 + # CA regular FMAP is 50%; total MSP cost is $6,231.40. + msp_federal_cost: 3_115.7 + msp_state_cost: 3_115.7 - name: Case 2, QI cost is federally financed within allocation. period: 2026 diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/savings_programs/qmb_cost_sharing.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/savings_programs/qmb_cost_sharing.yaml index 4a812377fd3..1fa5134a84f 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/savings_programs/qmb_cost_sharing.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/savings_programs/qmb_cost_sharing.yaml @@ -4,8 +4,8 @@ input: msp_category: QMB output: - # $14,500 annual Medicare per-capita cost / 12 * 20%. - qmb_cost_sharing: 241.67 + # $18,983 annual Medicare spending per enrollee (2026) / 12 * 20%. + qmb_cost_sharing: 316.38 - name: Case 2, non-QMB MSP categories do not receive QMB cost sharing. period: 2026-01 diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/test_part_b_msp_offset.py b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/test_part_b_msp_offset.py index 611c0bf7592..29ecb083de7 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/test_part_b_msp_offset.py +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/test_part_b_msp_offset.py @@ -87,7 +87,8 @@ def test_medicare_cost_uses_gross_part_b_before_msp_offset(): ) assert sim.calculate("medicare_part_b_premium", PERIOD)[0] == pytest.approx(0) - assert sim.calculate("medicare_cost", PERIOD)[0] == pytest.approx(12_280) + # $17,751 CMS Medicare spending per enrollee (2025) - $2,220 gross Part B. + assert sim.calculate("medicare_cost", PERIOD)[0] == pytest.approx(15_531) def test_medicare_part_b_premium_is_zero_when_not_enrolled(): @@ -343,7 +344,8 @@ def test_gross_medicare_part_b_premium_if_enrolled_preserves_irmaa(): assert sim.calculate("gross_medicare_part_b_premium_if_enrolled", PERIOD)[ 0 ] == pytest.approx(4_440) - assert sim.calculate("medicare_cost", PERIOD)[0] == pytest.approx(10_060) + # $17,751 CMS Medicare spending per enrollee (2025) - $4,440 gross Part B. + assert sim.calculate("medicare_cost", PERIOD)[0] == pytest.approx(13_311) def test_medicare_irmaa_magi_two_years_prior_falls_back_to_lagged_income(): diff --git a/policyengine_us/tests/policy/baseline/household/income/household/cbo_household_income.yaml b/policyengine_us/tests/policy/baseline/household/income/household/cbo_household_income.yaml index 275f2797e57..07d9f4f1d8e 100644 --- a/policyengine_us/tests/policy/baseline/household/income/household/cbo_household_income.yaml +++ b/policyengine_us/tests/policy/baseline/household/income/household/cbo_household_income.yaml @@ -33,10 +33,12 @@ workers_compensation: 1_000 output: cbo_household_market_income: 49_102 - medicare_gross_cost: 14_500 - cbo_household_social_insurance_benefits: 29_500 - cbo_household_income_before_transfers_and_taxes: 78_602 - cbo_household_income: 78_602 + # CMS Medicare spending per enrollee, 2025. + medicare_gross_cost: 17_751 + # $12,000 + $17,751 + $2,000 + $1,000. + cbo_household_social_insurance_benefits: 32_751 + cbo_household_income_before_transfers_and_taxes: 81_853 + cbo_household_income: 81_853 - name: CBO means-tested transfers include only the listed programs period: 2026 diff --git a/policyengine_us/tests/policy/baseline/parameters/test_uprating_extensions.py b/policyengine_us/tests/policy/baseline/parameters/test_uprating_extensions.py index e50fffb6cf2..901e665cd28 100644 --- a/policyengine_us/tests/policy/baseline/parameters/test_uprating_extensions.py +++ b/policyengine_us/tests/policy/baseline/parameters/test_uprating_extensions.py @@ -39,6 +39,11 @@ def test_all_uprating_factors_extend_to_2100(): ("CPI-U", parameters.gov.bls.cpi.cpi_u, "-02-01"), ("Chained CPI-U", parameters.gov.bls.cpi.c_cpi_u, "-02-01"), ("CPI-W", parameters.gov.bls.cpi.cpi_w, "-02-01"), + ( + "CMS Medicare spending per enrollee", + parameters.calibration.gov.hhs.medicare.per_capita_cost, + "-01-01", + ), ] for name, param, date_suffix in uprating_params: From 33a94b4172f459d3e803c37bfae472f8d3e7e65d Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 11 Oct 2026 13:30:10 -0400 Subject: [PATCH 03/35] Update the QMB federal and state benefit cost test to the CMS series Co-Authored-By: Claude Opus 5.5 --- .../income/person/federal_and_state_benefit_cost.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/policyengine_us/tests/policy/baseline/household/income/person/federal_and_state_benefit_cost.yaml b/policyengine_us/tests/policy/baseline/household/income/person/federal_and_state_benefit_cost.yaml index cdc30cc0523..11dedad24db 100644 --- a/policyengine_us/tests/policy/baseline/household/income/person/federal_and_state_benefit_cost.yaml +++ b/policyengine_us/tests/policy/baseline/household/income/person/federal_and_state_benefit_cost.yaml @@ -84,5 +84,7 @@ base_part_a_premium: 0 base_part_b_premium: 2_434.8 output: - federal_benefit_cost: 2_667.4 - state_benefit_cost: 2_667.4 + # MSP cost: $2,434.80 Part B premium + 20% of $18,983 CMS Medicare + # spending per enrollee (2026) = $6,231.40, split at CA's 50% FMAP. + federal_benefit_cost: 3_115.7 + state_benefit_cost: 3_115.7 From 712abd368a2466948d7a829d6ecb95883c5d1b53 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 11 Oct 2026 14:54:06 -0400 Subject: [PATCH 04/35] Subtract the expected Part D premium from medicare_cost CMS Medicare spending per enrollee (calibration.gov.hhs.medicare.per_capita_cost, PolicyEngine/policyengine-us#10107) includes Part D, which enrollee premiums partly finance, but medicare_cost subtracted only Part A and Part B premiums. It now also subtracts the Part D enrollment share times (Part D premiums per Part D enrollee + the person's Part D IRMAA), both new calibration series from the 2026 Medicare Trustees Report (Tables III.D3, V.E4 and V.B3). Co-Authored-By: Claude Opus 5.5 --- .../medicare-cost-part-d-premiums.fixed.md | 1 + .../hhs/medicare/part_d/enrollment_share.yaml | 53 +++++++++++ .../part_d/premiums_per_enrollee.yaml | 73 +++++++++++++++ .../parameters/uprating_extensions.py | 14 +++ .../core/test_medicare_per_capita_cost.py | 17 ++-- .../gov/hhs/medicare/costs/medicare_cost.yaml | 90 +++++++++++++++++-- .../hhs/medicare/test_part_b_msp_offset.py | 10 ++- .../gov/hhs/medicare/costs/medicare_cost.py | 24 +++-- 8 files changed, 261 insertions(+), 21 deletions(-) create mode 100644 changelog.d/medicare-cost-part-d-premiums.fixed.md create mode 100644 policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/enrollment_share.yaml create mode 100644 policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/premiums_per_enrollee.yaml diff --git a/changelog.d/medicare-cost-part-d-premiums.fixed.md b/changelog.d/medicare-cost-part-d-premiums.fixed.md new file mode 100644 index 00000000000..b7989573aaa --- /dev/null +++ b/changelog.d/medicare-cost-part-d-premiums.fixed.md @@ -0,0 +1 @@ +Subtract the expected Medicare Part D premium, the Part D enrollment share times Part D premiums per Part D enrollee plus the person's Part D IRMAA, from `medicare_cost`, whose CMS spending per enrollee includes Part D. diff --git a/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/enrollment_share.yaml b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/enrollment_share.yaml new file mode 100644 index 00000000000..6cf55361039 --- /dev/null +++ b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/enrollment_share.yaml @@ -0,0 +1,53 @@ +description: The Medicare Trustees report and project this share of Medicare enrollees, people with Part A or Part B coverage, who are enrolled in Part D. +metadata: + unit: /1 + period: year + label: Medicare Part D enrollment share + reference: + # Table V.B3, "Medicare Enrollment": Part D enrollment over total + # enrollment, which footnote 2 defines as the "Number of beneficiaries with + # HI and/or SMI coverage". Part D enrollment includes retiree drug subsidy + # beneficiaries (it equals the total of Table IV.B7, file page 153). + # Annual through 2035, then every fifth year through 2100; each value holds + # until the next. 2026 Medicare Trustees Report, transmitted 2026-06-09, + # retrieved 2026-10-11, sha256 + # ffa56b9137006872300b0346149eae1613d09a172b6ba118aad48e66dfc48fa8. + - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table V.B3 + href: https://www.cms.gov/oact/tr/2026#page=196 +values: + # Historical. + 2015-01-01: 0.7517 + 2016-01-01: 0.7569 + 2017-01-01: 0.7579 + 2018-01-01: 0.763 + 2019-01-01: 0.7667 + 2020-01-01: 0.7743 + 2021-01-01: 0.7811 + 2022-01-01: 0.7885 + 2023-01-01: 0.7941 + 2024-01-01: 0.8117 + 2025-01-01: 0.8191 + # Trustees' intermediate estimates. + 2026-01-01: 0.8195 + 2027-01-01: 0.8255 + 2028-01-01: 0.8301 + 2029-01-01: 0.8348 + 2030-01-01: 0.8382 + 2031-01-01: 0.8414 + 2032-01-01: 0.844 + 2033-01-01: 0.8462 + 2034-01-01: 0.8476 + 2035-01-01: 0.8485 + 2040-01-01: 0.8531 + 2045-01-01: 0.8551 + 2050-01-01: 0.8543 + 2055-01-01: 0.8534 + 2060-01-01: 0.8537 + 2065-01-01: 0.8555 + 2070-01-01: 0.8566 + 2075-01-01: 0.8575 + 2080-01-01: 0.8593 + 2085-01-01: 0.8609 + 2090-01-01: 0.863 + 2095-01-01: 0.8638 + 2100-01-01: 0.8639 diff --git a/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/premiums_per_enrollee.yaml b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/premiums_per_enrollee.yaml new file mode 100644 index 00000000000..871164280c8 --- /dev/null +++ b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/premiums_per_enrollee.yaml @@ -0,0 +1,73 @@ +description: The Medicare Trustees report and project these Part D premiums from enrollees per Part D enrollee, excluding the income-related monthly adjustment amount. +metadata: + unit: currency-USD + period: year + label: Medicare Part D premiums per Part D enrollee + reference: + # Each value is (premium income - aggregate income-related premiums) / + # Part D enrollment, from the 2026 Medicare Trustees Report (transmitted + # 2026-06-09, retrieved 2026-10-11, sha256 + # ffa56b9137006872300b0346149eae1613d09a172b6ba118aad48e66dfc48fa8): + # - Premium income, Table III.D3 (file page 116), in billions. Footnote 1: + # "Premiums include both amounts withheld from Social Security benefits or + # other Federal payments, direct payments to the Federal government, and + # those paid directly to Part D plans." The table is on a cash basis, and + # footnote 6 (file page 117) credits one January's withheld premiums on + # December 31 of the year before: about $0.2 billion in 2015, $0.1 billion + # in 2020 and an estimated $0.2 billion in 2026. Those amounts are moved + # back to 2016, 2021 and 2027. + # - Income-related premiums, Table V.E4 (file page 218), "Aggregate + # premiums", the amount paid "in excess of the Part D plan premium". They + # are part of premium income: they are withheld from benefits (42 U.S.C. + # 1395w-113(c)(4)) and deposited into the Part D account (footnote 73, + # file page 151). medicare_cost subtracts each person's own adjustment + # amount instead. + # - Part D enrollment, Table V.B3 (file page 196), in thousands. It equals + # the total of Table IV.B7 (file page 153), which includes retiree drug + # subsidy beneficiaries. + # Low-income subsidy enrollees pay reduced premiums or none (file page 219); + # Medicare's low-income subsidy payments are expenditures of the Part D + # account, not enrollee premiums (file page 114). So the average is below + # the base beneficiary premium. + - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table III.D3 + href: https://www.cms.gov/oact/tr/2026#page=116 + - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table V.E4 + href: https://www.cms.gov/oact/tr/2026#page=218 + - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table V.B3 + href: https://www.cms.gov/oact/tr/2026#page=196 + - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Part D revenue and expenditures + href: https://www.cms.gov/oact/tr/2026#page=109 + - title: 42 U.S.C. § 1395w-113(c)(4) - Collection of monthly adjustment amount + href: https://www.law.cornell.edu/uscode/text/42/1395w-113#c_4 +values: + # Historical. + 2015-01-01: 277.6 + 2016-01-01: 300.94 + 2017-01-01: 321.53 + 2018-01-01: 316.61 + 2019-01-01: 298.86 + 2020-01-01: 285.44 + 2021-01-01: 306.15 + 2022-01-01: 309.42 + 2023-01-01: 304.39 + 2024-01-01: 307.7 + # 2025 premiums fell with the voluntary Part D premium demonstration for + # stand-alone prescription drug plans (file page 109). + 2025-01-01: 220.25 + # Trustees' intermediate estimates. The 2030 jump is the Inflation + # Reduction Act's reset of the base beneficiary premium percentage + # (file page 152). + 2026-01-01: 289.79 + 2027-01-01: 373.53 + 2028-01-01: 403.59 + 2029-01-01: 411.27 + 2030-01-01: 637.06 + 2031-01-01: 659.27 + 2032-01-01: 662.52 + 2033-01-01: 684.61 + 2034-01-01: 699.07 + 2035-01-01: 722.05 + # 2036 to 2100 grow at the 2034-2035 rate (722.05 / 699.07, 3.3% a year), + # near the Trustees' 3.1% growth in Part D cost per beneficiary in 2035 + # (Table V.D1, file page 210); later years hold the 2100 value. See + # set_all_uprating_parameters in uprating_extensions.py. diff --git a/policyengine_us/parameters/uprating_extensions.py b/policyengine_us/parameters/uprating_extensions.py index df50047bd66..e02e95eacc8 100644 --- a/policyengine_us/parameters/uprating_extensions.py +++ b/policyengine_us/parameters/uprating_extensions.py @@ -897,6 +897,20 @@ def set_all_uprating_parameters(parameters: ParameterNode) -> ParameterNode: growth_years=(2031, 2032), ) + # Medicare Part D premiums per Part D enrollee (January values, last + # projection year 2035), which medicare_cost reads directly. Each year + # from 2036 to 2100 grows at the 2034-2035 rate, near the Trustees' 3.1 + # percent growth in Part D cost per beneficiary in 2035 (Table V.D1, file + # page 210); later years hold the 2100 value. The Part D enrollment share + # needs no extension: the Trustees project enrollment through 2100. + extend_parameter_values( + parameters.calibration.gov.hhs.medicare.part_d.premiums_per_enrollee, + last_projected_year=2035, + end_year=END_YEAR, + period_month=1, + period_day=1, + ) + # CBO income-by-source aggregates are used directly and as anchors for # SOI-based income upraters. Extending them in the baseline path keeps # long-run nominal data aging independent of scenario-specific reforms. diff --git a/policyengine_us/tests/core/test_medicare_per_capita_cost.py b/policyengine_us/tests/core/test_medicare_per_capita_cost.py index 986236c9d7d..9e37cb5d1e3 100644 --- a/policyengine_us/tests/core/test_medicare_per_capita_cost.py +++ b/policyengine_us/tests/core/test_medicare_per_capita_cost.py @@ -12,7 +12,8 @@ lifts 2033 and 2034 growth. ``medicare_gross_cost`` returns the series for each enrolled person, -``medicare_cost`` subtracts the person's Part A and gross Part B premiums, and +``medicare_cost`` subtracts the person's Part A, gross Part B and expected +Part D premiums (tested in test_medicare_cost_part_d_premium.py), and ``qmb_cost_sharing`` pays QMB enrollees a share of it each month. Invariants: @@ -32,10 +33,11 @@ Trustees' 2034-2035 per beneficiary growth. 5. Calendar years: every date within a year reads the January 1 value. 6. Consumers: for an enrolled person, ``medicare_gross_cost`` equals the - series; ``medicare_cost`` equals the series less the Part A premium and the - gross Part B premium, floored at zero, so never exceeds - ``medicare_gross_cost``; a QMB enrollee's monthly ``qmb_cost_sharing`` is - the series over 12 times the QMB rate. A person not enrolled gets zero. + series; ``medicare_cost`` equals the series less the Part A premium, the + gross Part B premium and the expected Part D premium, floored at zero, so + never exceeds ``medicare_gross_cost``; a QMB enrollee's monthly + ``qmb_cost_sharing`` is the series over 12 times the QMB rate. A person + not enrolled gets zero. """ import pytest @@ -206,13 +208,16 @@ def test_medicare_cost_nets_premiums_from_the_series( "medicare_enrolled": {year: True}, "base_part_a_premium": {year: part_a_premium}, "gross_medicare_part_b_premium": {year: part_b_premium}, + "income_adjusted_part_d_premium_surcharge": {year: 0}, }, ) gross = simulation.calculate("medicare_gross_cost", year)[0] net = simulation.calculate("medicare_cost", year)[0] # Variables are float32, so compare to single precision. assert gross == pytest.approx(_value(year), rel=1e-6) - expected = max(_value(year) - part_a_premium - part_b_premium, 0) + part_d = system.parameters(f"{year}-01-01").calibration.gov.hhs.medicare.part_d + part_d_premium = part_d.enrollment_share * part_d.premiums_per_enrollee + expected = max(_value(year) - part_a_premium - part_b_premium - part_d_premium, 0) assert net == pytest.approx(expected, rel=1e-6, abs=0.01) assert net <= gross diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/medicare_cost.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/medicare_cost.yaml index b0fb091fce4..504cd704414 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/medicare_cost.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/medicare_cost.yaml @@ -1,5 +1,10 @@ +# The expected Part D premium is the Part D enrollment share times (Part D +# premiums per Part D enrollee + the person's Part D IRMAA). 2025: 0.8191 x +# $220.25 = $180.41 without IRMAA. + - name: unit test 1 - enrolled, premium-free Part A period: 2025 + absolute_error_margin: 0.01 input: age: 65 is_medicare_eligible: true @@ -9,10 +14,12 @@ tax_exempt_interest_income: 2023: 0 output: - medicare_cost: 15_531 # $17,751 spending - $2,220 Part B premium (2025) + # $17,751 spending - $2,220 Part B premium - $180.41 Part D (2025) + medicare_cost: 15_350.59 - name: unit test 2 - enrolled, pays full Part A premium period: 2025 + absolute_error_margin: 0.01 input: age: 65 is_medicare_eligible: true @@ -22,10 +29,12 @@ tax_exempt_interest_income: 2023: 0 output: - medicare_cost: 9_315 # $17,751 - $6,216 Part A - $2,220 Part B (2025) + # $17,751 - $6,216 Part A - $2,220 Part B - $180.41 Part D (2025) + medicare_cost: 9_134.59 - name: unit test 3 - enrolled with IRMAA period: 2025 + absolute_error_margin: 0.01 input: age: 65 is_medicare_eligible: true @@ -36,7 +45,9 @@ 2023: 0 filing_status: SINGLE output: - medicare_cost: 10_204.2 # $17,751 - $7,546.80 Part B with IRMAA (2025) + # $17,751 - $7,546.80 Part B with IRMAA - 0.8191 x ($220.25 + $85.80 x 12 + # Part D IRMAA) = $1,023.75 Part D (2025) + medicare_cost: 9_180.45 - name: unit test 4 - eligible but not enrolled period: 2025 @@ -49,6 +60,7 @@ - name: unit test 5 - 2021 data, premium-free period: 2021 + absolute_error_margin: 0.01 input: age: 70 is_medicare_eligible: true @@ -58,14 +70,82 @@ tax_exempt_interest_income: 2019: 0 output: - medicare_cost: 12_511 # $14,293 - $1,782 Part B (2021: $148.50*12) + # $14,293 - $1,782 Part B (2021: $148.50*12) - 0.7811 x $306.15 Part D + medicare_cost: 12_271.87 - name: unit test 6 - direct Part B premium input period: 2025 + absolute_error_margin: 0.01 input: age: 65 is_medicare_eligible: true medicare_quarters_of_coverage: 40 gross_medicare_part_b_premium: 3_000 output: - medicare_cost: 14_751 # $17,751 spending - $3,000 Part B premium + # $17,751 spending - $3,000 Part B premium - $180.41 Part D + medicare_cost: 14_570.59 + +- name: unit test 7 - Part D IRMAA in the 50 percent tier + period: 2025 + absolute_error_margin: 0.01 + input: + age: 65 + is_medicare_eligible: true + medicare_quarters_of_coverage: 40 + filing_status: SINGLE + adjusted_gross_income: + 2023: 150_000 # Single, $133,001 to $167,000: $35.30 a month in 2025 + tax_exempt_interest_income: + 2023: 0 + gross_medicare_part_b_premium: 2_220 + output: + income_adjusted_part_d_premium_surcharge: 423.6 + # $17,751 - $2,220 Part B - 0.8191 x ($220.25 + $423.60) = $527.38 Part D + medicare_cost: 15_003.62 + +- name: unit test 8 - projected year + period: 2027 + absolute_error_margin: 0.01 + input: + age: 67 + is_medicare_eligible: true + medicare_quarters_of_coverage: 40 + gross_medicare_part_b_premium: 2_500 + income_adjusted_part_d_premium_surcharge: 0 + output: + # $20,096 - $2,500 Part B - 0.8255 x $373.53 = $308.35 Part D (2027) + medicare_cost: 17_287.65 + +- name: unit test 9 - Inflation Reduction Act premium reset year, with IRMAA + period: 2030 + absolute_error_margin: 0.01 + input: + age: 70 + is_medicare_eligible: true + medicare_quarters_of_coverage: 40 + gross_medicare_part_b_premium: 3_000 + income_adjusted_part_d_premium_surcharge: 1_000 + output: + # $23,789 - $3,000 Part B - 0.8382 x ($637.06 + $1,000) = $1,372.18 Part D + medicare_cost: 19_416.82 + +- name: unit test 10 - premiums above spending floor the value at zero + period: 2025 + input: + age: 65 + is_medicare_eligible: true + medicare_quarters_of_coverage: 40 + gross_medicare_part_b_premium: 30_000 + output: + medicare_cost: 0 + +- name: unit test 11 - gross cost does not subtract the Part D premium + period: 2025 + input: + age: 65 + is_medicare_eligible: true + medicare_quarters_of_coverage: 40 + gross_medicare_part_b_premium: 2_220 + income_adjusted_part_d_premium_surcharge: 1_029.6 + output: + medicare_gross_cost: 17_751 diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/test_part_b_msp_offset.py b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/test_part_b_msp_offset.py index 29ecb083de7..b15943e5203 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/test_part_b_msp_offset.py +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/test_part_b_msp_offset.py @@ -87,8 +87,9 @@ def test_medicare_cost_uses_gross_part_b_before_msp_offset(): ) assert sim.calculate("medicare_part_b_premium", PERIOD)[0] == pytest.approx(0) - # $17,751 CMS Medicare spending per enrollee (2025) - $2,220 gross Part B. - assert sim.calculate("medicare_cost", PERIOD)[0] == pytest.approx(15_531) + # $17,751 CMS Medicare spending per enrollee (2025) - $2,220 gross Part B + # - 0.8191 x $220.25 expected Part D premium. + assert sim.calculate("medicare_cost", PERIOD)[0] == pytest.approx(15_350.59) def test_medicare_part_b_premium_is_zero_when_not_enrolled(): @@ -344,8 +345,9 @@ def test_gross_medicare_part_b_premium_if_enrolled_preserves_irmaa(): assert sim.calculate("gross_medicare_part_b_premium_if_enrolled", PERIOD)[ 0 ] == pytest.approx(4_440) - # $17,751 CMS Medicare spending per enrollee (2025) - $4,440 gross Part B. - assert sim.calculate("medicare_cost", PERIOD)[0] == pytest.approx(13_311) + # $17,751 CMS Medicare spending per enrollee (2025) - $4,440 gross Part B + # - 0.8191 x $220.25 expected Part D premium. + assert sim.calculate("medicare_cost", PERIOD)[0] == pytest.approx(13_130.59) def test_medicare_irmaa_magi_two_years_prior_falls_back_to_lagged_income(): diff --git a/policyengine_us/variables/gov/hhs/medicare/costs/medicare_cost.py b/policyengine_us/variables/gov/hhs/medicare/costs/medicare_cost.py index 29da4f02627..d2b7e45b123 100644 --- a/policyengine_us/variables/gov/hhs/medicare/costs/medicare_cost.py +++ b/policyengine_us/variables/gov/hhs/medicare/costs/medicare_cost.py @@ -7,26 +7,38 @@ class medicare_cost(Variable): label = "Medicare cost" documentation = ( "Annual value of Medicare benefits received. Calculated as total " - "Medicare spending on behalf of the beneficiary minus premiums paid. " + "Medicare spending on behalf of the beneficiary, which covers Parts A " + "through D, minus the premiums that finance it: the Part A premium, " + "the gross Part B premium and the expected Part D premium. " "This represents the net benefit value of Medicare coverage." ) unit = USD definition_period = YEAR - reference = "https://www.cms.gov/about-cms/what-we-do/medicare" + reference = ( + "https://www.cms.gov/about-cms/what-we-do/medicare", + "https://www.cms.gov/oact/tr/2026#page=116", + ) defined_for = "medicare_enrolled" def formula(person, period, parameters): + p = parameters(period).calibration.gov.hhs.medicare # Total Medicare spending on behalf of beneficiary - per_capita_spending = parameters( - period - ).calibration.gov.hhs.medicare.per_capita_cost + per_capita_spending = p.per_capita_cost # Premium offsets to Medicare program cost. Use the enrollment-gated # gross Part B premium before MSP offsets so MSP support does not # inflate Medicare's value. part_a_premium = person("base_part_a_premium", period) part_b_premium = person("gross_medicare_part_b_premium_if_enrolled", period) - total_premiums = part_a_premium + part_b_premium + # The spending includes Part D, which enrollee premiums partly finance. + # No variable records Part D enrollment, so subtract the expected + # Part D premium: the Part D enrollment share times the premium per + # Part D enrollee plus the person's income-related adjustment. + part_d_irmaa = person("income_adjusted_part_d_premium_surcharge", period) + part_d_premium = p.part_d.enrollment_share * ( + p.part_d.premiums_per_enrollee + part_d_irmaa + ) + total_premiums = part_a_premium + part_b_premium + part_d_premium # Net benefit = spending - premiums return max_(per_capita_spending - total_premiums, 0) From 4024d2ec08b7b970bfcea89d5873753f6773b790 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 11 Oct 2026 15:09:29 -0400 Subject: [PATCH 05/35] Test the Part D premium series and medicare_cost's Part D offset Transcription from the Trustees' cells, conservation back to Table III.D3 premium income, bounds, the 2036-2100 extension's closed form, and a Hypothesis differential test of medicare_cost against a reference implementation (0 <= net <= gross, non-increasing in Part D IRMAA). Co-Authored-By: Claude Opus 5.5 --- .../core/test_medicare_cost_part_d_premium.py | 261 ++++++++++++++++++ 1 file changed, 261 insertions(+) create mode 100644 policyengine_us/tests/core/test_medicare_cost_part_d_premium.py diff --git a/policyengine_us/tests/core/test_medicare_cost_part_d_premium.py b/policyengine_us/tests/core/test_medicare_cost_part_d_premium.py new file mode 100644 index 00000000000..a9dc443b21d --- /dev/null +++ b/policyengine_us/tests/core/test_medicare_cost_part_d_premium.py @@ -0,0 +1,261 @@ +"""The expected Part D premium that ``medicare_cost`` subtracts. + +CMS Medicare spending per enrollee (``calibration.gov.hhs.medicare. +per_capita_cost``) covers Parts A through D, gross of the premiums that +finance it. No variable records Part D enrollment, so ``medicare_cost`` +subtracts an expected Part D premium: + + enrollment_share x (premiums_per_enrollee + Part D IRMAA) + +from two series under ``calibration.gov.hhs.medicare.part_d``, both from the +2026 Medicare Trustees Report: + +- ``premiums_per_enrollee``: Table III.D3 premium income (footnote 6's + December 31 credits moved back a year) less Table V.E4's aggregate + income-related premiums, over Table V.B3's Part D enrollment. +- ``enrollment_share``: Table V.B3's Part D enrollment over its total, people + with Part A and/or Part B coverage. + +Invariants: + +1. Transcription: every value equals its formula applied to the Trustees' + published cells, rounded as stored. +2. Conservation: premiums per Part D enrollee times Part D enrollment, plus + aggregate IRMAA, returns Table III.D3's premium income in every year from + 2015 to 2035, within the tables' rounding. +3. Bounds: the share lies strictly between 0 and 1 and premiums are + positive in every year from 2015 to 2200. The monthly premium per Part D + enrollee is below the Trustees' average paid premium in 2025 and 2026, + since low-income subsidy enrollees pay less or nothing. +4. Extension: each year from 2036 to 2100 equals the 2035 value times + (722.05 / 699.07) ** (year - 2035), and later years hold the 2100 value. + That growth is within half a point of the Trustees' 2035 growth in Part D + cost per beneficiary (Table V.D1). +5. Calendar years: every date in a year reads the January 1 value; between + the Trustees' five-year enrollment points the share holds the earlier one. +6. Consumer (Hypothesis, differential): ``medicare_cost`` equals a reference + implementation, max(gross - Part A - Part B - share x (premium + IRMAA), + 0), for any year and premiums; it lies in [0, ``medicare_gross_cost``], + which does not change with the Part D premium; and it does not rise with + the person's Part D IRMAA. +""" + +import pytest +from hypothesis import given, settings +from hypothesis import strategies as st +from policyengine_core.parameters.operations.get_parameter import get_parameter + +from policyengine_us import Simulation +from policyengine_us.system import system + +PREMIUM = "calibration.gov.hhs.medicare.part_d.premiums_per_enrollee" +SHARE = "calibration.gov.hhs.medicare.part_d.enrollment_share" +FIRST_YEAR, LAST_PROJECTED_YEAR, END_YEAR = 2015, 2035, 2100 +PROJECTED_YEARS = range(FIRST_YEAR, LAST_PROJECTED_YEAR + 1) + +# 2026 Medicare Trustees Report (sha256 ffa56b91...8fa8). +# Table III.D3 (file page 116), premium income, $ billions, cash basis. +PREMIUM_INCOME = dict( + zip( + PROJECTED_YEARS, + ( + *(12.7, 13.8, 15.5, 15.9, 15.7, 15.8, 17.0, 17.6, 18.3, 19.2, 14.9), + *(20.1, 25.6, 28.8, 30.5, 51.7, 54.9, 56.4, 59.5, 62.0, 65.3), + ), + ) +) +# Footnote 6 (file page 117): premiums withheld from January benefits that +# were credited on December 31 of the year before, $ billions. +DECEMBER_31_CREDIT = {2015: 0.2, 2020: 0.1, 2026: 0.2} +# Table V.E4 (file page 218), aggregate income-related premiums, $ billions. +IRMAA_AGGREGATE = dict( + zip( + PROJECTED_YEARS, + ( + *(0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 1.8, 1.7, 2.2, 2.2, 2.4, 3.1, 3.5), + *(4.0, 4.6, 10.8, 11.9, 12.6, 13.7, 14.7, 15.9), + ), + ) +) +# Table V.B3 (file page 196), enrollment in thousands: annual through 2035, +# then every fifth year. +ENROLLMENT_YEARS = (*PROJECTED_YEARS, *range(2040, END_YEAR + 1, 5)) +PART_D_ENROLLMENT = dict( + zip( + ENROLLMENT_YEARS, + ( + *(41_786, 43_198, 44_475, 45_798, 47_179, 48_696, 49_976, 51_386), + *(52_893, 55_249, 56_754, 57_973, 59_700, 61_448, 62_975, 64_201), + *(65_224, 66_111, 66_899, 67_661, 68_416, 70_471, 71_528, 72_969), + *(75_043, 77_612, 80_085, 82_775, 85_396, 87_208, 88_382, 88_728), + *(88_845, 89_095), + ), + ) +) +TOTAL_ENROLLMENT = dict( + zip( + ENROLLMENT_YEARS, + ( + *(55_589, 57_073, 58_683, 60_020, 61_535, 62_887, 63_980, 65_166), + *(66_606, 68_066, 69_289, 70_743, 72_322, 74_026, 75_436, 76_598), + *(77_521, 78_327, 79_058, 79_827, 80_632, 82_606, 83_648, 85_413), + *(87_929, 90_916, 93_612, 96_634, 99_585, 101_485, 102_662), + *(102_816, 102_848, 103_133), + ), + ) +) +# Average paid premium per month (file page 217). +AVERAGE_PAID_PREMIUM = {2025: 23.95, 2026: 27.22} +# Table V.D1 (file page 210), Part D average per beneficiary cost. +PART_D_COST_PER_BENEFICIARY = {2034: 4_919, 2035: 5_074} + +years = st.integers(FIRST_YEAR, END_YEAR) + + +def _read(name, date): + return get_parameter(system.parameters, name)(date) + + +def _premium(year): + return _read(PREMIUM, f"{year}-01-01") + + +def _share(year): + return _read(SHARE, f"{year}-01-01") + + +def _accrual_premium_income(year): + return ( + PREMIUM_INCOME[year] + - DECEMBER_31_CREDIT.get(year, 0) + + DECEMBER_31_CREDIT.get(year - 1, 0) + ) + + +@pytest.mark.parametrize("year", PROJECTED_YEARS) +def test_premium_is_trustees_premium_income_net_of_irmaa_per_part_d_enrollee(year): + billions = _accrual_premium_income(year) - IRMAA_AGGREGATE[year] + expected = billions * 1e9 / (PART_D_ENROLLMENT[year] * 1e3) + assert _premium(year) == round(expected, 2) + + +@pytest.mark.parametrize("year", ENROLLMENT_YEARS) +def test_share_is_trustees_part_d_over_total_enrollment(year): + assert _share(year) == round(PART_D_ENROLLMENT[year] / TOTAL_ENROLLMENT[year], 4) + + +@pytest.mark.parametrize("year", PROJECTED_YEARS) +def test_premiums_and_irmaa_return_trustees_premium_income(year): + """Conservation: the series, scaled back up by enrollment, plus IRMAA + gives the published premium income, within rounding of the cells.""" + rebuilt = _premium(year) * PART_D_ENROLLMENT[year] * 1e3 / 1e9 + rebuilt += IRMAA_AGGREGATE[year] + # Each cell is rounded to $0.1 billion, the stored value to the cent. + assert rebuilt == pytest.approx(_accrual_premium_income(year), abs=1e-3) + assert abs(rebuilt - PREMIUM_INCOME[year]) <= 0.2 + 1e-3 + + +@pytest.mark.parametrize("year", sorted(AVERAGE_PAID_PREMIUM)) +def test_monthly_premium_is_below_the_average_paid_premium(year): + assert _premium(year) / 12 < AVERAGE_PAID_PREMIUM[year] + + +@given(st.integers(FIRST_YEAR, END_YEAR + 100)) +def test_share_and_premium_are_bounded(year): + assert 0 < _share(year) < 1 + assert _premium(year) > 0 + + +def test_extension_rate_follows_trustees_part_d_cost_growth(): + growth = _premium(LAST_PROJECTED_YEAR + 1) / _premium(LAST_PROJECTED_YEAR) + trustees = PART_D_COST_PER_BENEFICIARY[2035] / PART_D_COST_PER_BENEFICIARY[2034] + assert abs(growth - trustees) < 0.005 + + +@given(st.integers(LAST_PROJECTED_YEAR + 1, END_YEAR)) +def test_extension_is_the_closed_form_of_the_2034_2035_growth(year): + growth = _premium(LAST_PROJECTED_YEAR) / _premium(LAST_PROJECTED_YEAR - 1) + expected = _premium(LAST_PROJECTED_YEAR) * growth ** (year - LAST_PROJECTED_YEAR) + assert _premium(year) == pytest.approx(expected, rel=1e-9) + + +@given(st.integers(END_YEAR, END_YEAR + 100)) +def test_series_hold_the_2100_values_afterwards(year): + assert _premium(year) == _premium(END_YEAR) + assert _share(year) == _share(END_YEAR) + + +@given(years, st.integers(1, 12), st.integers(1, 28)) +def test_every_date_in_a_year_reads_the_january_value(year, month, day): + date = f"{year}-{month:02d}-{day:02d}" + assert _read(PREMIUM, date) == _premium(year) + assert _read(SHARE, date) == _share(year) + + +@given(st.integers(LAST_PROJECTED_YEAR, END_YEAR)) +def test_share_holds_the_latest_trustees_point(year): + point = max(y for y in ENROLLMENT_YEARS if y <= year) + assert _share(year) == _share(point) + + +def _simulation(year, people): + names = list(people) + return Simulation( + situation={ + "people": people, + "tax_units": {f"tax_unit_{name}": {"members": [name]} for name in names}, + "spm_units": {"spm_unit": {"members": names}}, + "families": {"family": {"members": names}}, + "marital_units": { + f"marital_unit_{name}": {"members": [name]} for name in names + }, + "households": {"household": {"members": names, "state_code": {year: "CA"}}}, + } + ) + + +def _enrollee(year, part_a, part_b, irmaa): + return { + "age": {year: 70}, + "is_medicare_eligible": {year: True}, + "medicare_enrolled": {year: True}, + "base_part_a_premium": {year: part_a}, + "gross_medicare_part_b_premium": {year: part_b}, + "income_adjusted_part_d_premium_surcharge": {year: irmaa}, + } + + +def _reference_medicare_cost(year, part_a, part_b, irmaa): + gross = _read("calibration.gov.hhs.medicare.per_capita_cost", f"{year}-01-01") + part_d = _share(year) * (_premium(year) + irmaa) + return max(gross - part_a - part_b - part_d, 0) + + +premiums = st.floats(0, 40_000, allow_nan=False) +irmaas = st.floats(0, 12_000, allow_nan=False) + + +@settings(max_examples=25, deadline=None) +@given(years, st.floats(0, 12_000, allow_nan=False), premiums, irmaas, irmaas) +def test_medicare_cost_matches_reference_and_bounds( + year, part_a, part_b, irmaa, more_irmaa +): + low, high = sorted((irmaa, irmaa + more_irmaa)) + simulation = _simulation( + year, + { + "low": _enrollee(year, part_a, part_b, low), + "high": _enrollee(year, part_a, part_b, high), + }, + ) + net = simulation.calculate("medicare_cost", year) + gross = simulation.calculate("medicare_gross_cost", year) + # Variables are float32, so compare to single precision. + for value, surcharge in zip(net, (low, high)): + expected = _reference_medicare_cost(year, part_a, part_b, surcharge) + assert value == pytest.approx(expected, rel=1e-6, abs=0.01) + assert (net >= 0).all() + assert (net <= gross).all() + # The gross cost subtracts no premium, so both people have the same one. + assert gross[0] == gross[1] + assert net[1] <= net[0] From c5ab5b5d70166c4cf483b7e8ab890779529b4069 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 11 Oct 2026 15:50:17 -0400 Subject: [PATCH 06/35] Count Medicare net of premiums in CBO household income CBO's standard household income counts Medicare at the government's average cost per enrollee, net of premiums paid by enrollees, and counts the Part D low-income subsidy separately as a means-tested transfer (CBO, January 2026, publication 61910; Distribution of Household Income in 2021, Appendix A; Habib 2018, Appendix B). The default list used medicare_gross_cost, which is gross of premiums and includes the subsidy. Add cbo_medicare_benefit: Medicare spending per enrollee less per-enrollee Part A, B and D premium income and the Part D low-income subsidy per Medicare enrollee, from the 2026 Medicare Trustees Report. Every enrollee gets the same value, as CBO assigns the average. Fix the medicare_gross_cost docstring, which said gross matched CBO. Co-Authored-By: Claude Opus 5.5 --- .../cbo-medicare-net-of-premiums.fixed.md | 1 + ...art_d_low_income_subsidy_per_enrollee.yaml | 54 +++++++++++++++++ .../premium_income_per_enrollee/part_a.yaml | 47 +++++++++++++++ .../premium_income_per_enrollee/part_b.yaml | 60 +++++++++++++++++++ .../premium_income_per_enrollee/part_d.yaml | 57 ++++++++++++++++++ .../cbo_social_insurance_benefits.yaml | 15 ++++- .../household/cbo_household_income.yaml | 13 ++-- .../medicare/costs/cbo_medicare_benefit.py | 36 +++++++++++ .../hhs/medicare/costs/medicare_gross_cost.py | 13 +++- ...cbo_household_social_insurance_benefits.py | 4 +- 10 files changed, 290 insertions(+), 10 deletions(-) create mode 100644 changelog.d/cbo-medicare-net-of-premiums.fixed.md create mode 100644 policyengine_us/parameters/calibration/gov/hhs/medicare/part_d_low_income_subsidy_per_enrollee.yaml create mode 100644 policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_a.yaml create mode 100644 policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_b.yaml create mode 100644 policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_d.yaml create mode 100644 policyengine_us/variables/gov/hhs/medicare/costs/cbo_medicare_benefit.py diff --git a/changelog.d/cbo-medicare-net-of-premiums.fixed.md b/changelog.d/cbo-medicare-net-of-premiums.fixed.md new file mode 100644 index 00000000000..31b17d9bb0c --- /dev/null +++ b/changelog.d/cbo-medicare-net-of-premiums.fixed.md @@ -0,0 +1 @@ +The default CBO household income now counts Medicare as CBO does, at the average cost per enrollee net of premiums and excluding the Part D low-income subsidy, through a new `cbo_medicare_benefit` variable instead of gross Medicare spending. diff --git a/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d_low_income_subsidy_per_enrollee.yaml b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d_low_income_subsidy_per_enrollee.yaml new file mode 100644 index 00000000000..6e84c8d8cac --- /dev/null +++ b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d_low_income_subsidy_per_enrollee.yaml @@ -0,0 +1,54 @@ +description: The Medicare Trustees report and project these Part D low-income subsidy payments per Medicare enrollee. +metadata: + unit: currency-USD + period: year + label: Medicare Part D low-income subsidy per enrollee + # From 2036, each value is the 2035 value times the growth in Medicare + # spending per enrollee, so the subsidy keeps its 2035 share of spending. + uprating: calibration.gov.hhs.medicare.per_capita_cost + reference: + # Each value is Table IV.B10's "Low-income subsidy" payments ($ billions, + # incurred basis) over Table V.B3's total enrollment (file page 196, + # thousands), people with Part A and/or Part B coverage, so it is per + # Medicare enrollee, not per subsidy recipient. 2016 to 2035 come from the + # 2026 report's Table IV.B10 (file page 159); 2015, which that table no + # longer shows, from the 2025 report's (file page 159). The two reports + # agree on 2016 to 2023. 2026 Medicare Trustees Report, transmitted + # 2026-06-09, retrieved 2026-10-11, sha256 + # ffa56b9137006872300b0346149eae1613d09a172b6ba118aad48e66dfc48fa8; 2025 + # report sha256 + # 1b3de7a4faeee5ad42059e10740603182b716a5fa7b53b30d360b45b9e474d95. + - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table IV.B10 + href: https://www.cms.gov/oact/tr/2026#page=159 + - title: 2025 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table IV.B10 + href: https://www.cms.gov/oact/tr/2025#page=159 + - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table V.B3 + href: https://www.cms.gov/oact/tr/2026#page=196 +values: + # Historical. + 2015-01-01: 460.52 + 2016-01-01: 462.57 + 2017-01-01: 465.21 + 2018-01-01: 474.84 + 2019-01-01: 482.65 + 2020-01-01: 524.75 + 2021-01-01: 547.05 + 2022-01-01: 604.61 + 2023-01-01: 663.6 + 2024-01-01: 605.29 + # 2025 is the first year of the full Inflation Reduction Act benefit + # redesign (file page 119). The subsidy per low-income enrollee fell from + # $2,833 to $1,226 while the direct subsidy per enrollee rose from $383 to + # $1,869 (Table IV.B9, file page 158). + 2025-01-01: 251.12 + # Trustees' intermediate estimates. + 2026-01-01: 255.86 + 2027-01-01: 283.45 + 2028-01-01: 298.54 + 2029-01-01: 324.78 + 2030-01-01: 377.29 + 2031-01-01: 396.02 + 2032-01-01: 404.71 + 2033-01-01: 409.83 + 2034-01-01: 417.15 + 2035-01-01: 431.59 diff --git a/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_a.yaml b/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_a.yaml new file mode 100644 index 00000000000..5049d213595 --- /dev/null +++ b/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_a.yaml @@ -0,0 +1,47 @@ +description: The Medicare Trustees report and project this Part A premium income per Medicare enrollee, which counts premiums paid by or on behalf of people without premium-free Part A who enroll voluntarily. +metadata: + unit: currency-USD + period: year + label: Medicare Part A premium income per enrollee + # From 2036, each value is the 2035 value times the growth in Medicare + # spending per enrollee, so premiums keep their 2035 share of spending. + uprating: calibration.gov.hhs.medicare.per_capita_cost + reference: + # Each value is Table III.B4's "Premiums from voluntary enrollees" (file + # page 64, $ billions, cash basis) over Table V.B3's total enrollment + # (file page 196, thousands), which footnote 2 defines as the "Number of + # beneficiaries with HI and/or SMI coverage". The Part A premium is paid + # "by or on behalf of" these enrollees (glossary, file page 257), so state + # Medicaid buy-in payments are included. 2026 Medicare Trustees Report, + # transmitted 2026-06-09, retrieved 2026-10-11, sha256 + # ffa56b9137006872300b0346149eae1613d09a172b6ba118aad48e66dfc48fa8. + - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table III.B4 + href: https://www.cms.gov/oact/tr/2026#page=64 + - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table V.B3 + href: https://www.cms.gov/oact/tr/2026#page=196 + - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, glossary, Part A premium + href: https://www.cms.gov/oact/tr/2026#page=257 +values: + # Historical. + 2015-01-01: 57.57 + 2016-01-01: 57.82 + 2017-01-01: 59.64 + 2018-01-01: 59.98 + 2019-01-01: 63.38 + 2020-01-01: 63.61 + 2021-01-01: 65.65 + 2022-01-01: 69.05 + 2023-01-01: 70.56 + 2024-01-01: 70.52 + 2025-01-01: 82.26 + # Trustees' intermediate estimates. + 2026-01-01: 97.54 + 2027-01-01: 102.32 + 2028-01-01: 106.72 + 2029-01-01: 112.68 + 2030-01-01: 117.5 + 2031-01-01: 125.13 + 2032-01-01: 131.5 + 2033-01-01: 140.4 + 2034-01-01: 149.07 + 2035-01-01: 156.27 diff --git a/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_b.yaml b/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_b.yaml new file mode 100644 index 00000000000..e70f8535fae --- /dev/null +++ b/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_b.yaml @@ -0,0 +1,60 @@ +description: The Medicare Trustees report and project this Part B premium income per Medicare enrollee, which counts premiums paid by or on behalf of enrollees, including income-related premiums and premiums that state Medicaid programs pay. +metadata: + unit: currency-USD + period: year + label: Medicare Part B premium income per enrollee + # From 2036, each value is the 2035 value times the growth in Medicare + # spending per enrollee, so premiums keep their 2035 share of spending. + uprating: calibration.gov.hhs.medicare.per_capita_cost + reference: + # Each value is premium income over Table V.B3's total enrollment (file + # page 196, thousands), people with Part A and/or Part B coverage. + # - 2015 to 2026: Table III.C7 (file page 102), "Premium income", $ + # millions, incurred basis. + # - 2027 to 2035: Table III.C4 (file page 96), "Premium income", $ + # billions, cash basis. Footnote 7 credits premiums withheld from the + # benefits due January 3, 2027 on December 31, 2026; their amount is + # III.C4's 2026 cash value less III.C7's 2026 incurred value (174.8 - + # 173.228 = 1.572), which is added back to 2027. Cash and incurred + # premium income agree in every year from 2017 to 2025 except 2020 and + # 2021, the other footnote 7 years. + # Premium income is "premium payments by (or on behalf of) enrollees" + # (file page 88). It includes income-related premiums: in 2019 the + # standard premium, $135.50 a month, times 56.019 million Part B enrollees + # plus Table V.E3's $8.4 billion of income-related premiums (file page + # 208) is $99.5 billion, against $99.4 billion of premium income. + # 2026 Medicare Trustees Report, transmitted 2026-06-09, retrieved + # 2026-10-11, sha256 + # ffa56b9137006872300b0346149eae1613d09a172b6ba118aad48e66dfc48fa8. + - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table III.C7 + href: https://www.cms.gov/oact/tr/2026#page=102 + - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table III.C4 + href: https://www.cms.gov/oact/tr/2026#page=96 + - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table V.B3 + href: https://www.cms.gov/oact/tr/2026#page=196 + - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Part B premium income + href: https://www.cms.gov/oact/tr/2026#page=88 +values: + # Historical. + 2015-01-01: 1_214.54 + 2016-01-01: 1_296.34 + 2017-01-01: 1_389.19 + 2018-01-01: 1_554.68 + 2019-01-01: 1_615.55 + 2020-01-01: 1_729.23 + 2021-01-01: 1_772.6 + 2022-01-01: 2_009.35 + 2023-01-01: 1_969.28 + 2024-01-01: 2_054.43 + 2025-01-01: 2_169.44 + # Trustees' intermediate estimates. + 2026-01-01: 2_448.69 + 2027-01-01: 2_549.32 + 2028-01-01: 2_755.79 + 2029-01-01: 2_946.87 + 2030-01-01: 3_178.93 + 2031-01-01: 3_409.4 + 2032-01-01: 3_662.85 + 2033-01-01: 3_985.68 + 2034-01-01: 4_334.37 + 2035-01-01: 4_652 diff --git a/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_d.yaml b/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_d.yaml new file mode 100644 index 00000000000..1c8af7fff7f --- /dev/null +++ b/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_d.yaml @@ -0,0 +1,57 @@ +description: The Medicare Trustees report and project this Part D premium income per Medicare enrollee, which counts premiums withheld from benefits, paid to the federal government or paid directly to plans, including income-related premiums. +metadata: + unit: currency-USD + period: year + label: Medicare Part D premium income per enrollee + # From 2036, each value is the 2035 value times the growth in Medicare + # spending per enrollee, so premiums keep their 2035 share of spending. + uprating: calibration.gov.hhs.medicare.per_capita_cost + reference: + # Each value is Table III.D3's "Premium income" (file page 116, $ + # billions, cash basis) over Table V.B3's total enrollment (file page 196, + # thousands), people with Part A and/or Part B coverage. Footnote 1: + # "Premiums include both amounts withheld from Social Security benefits or + # other Federal payments, direct payments to the Federal government, and + # those paid directly to Part D plans." Footnote 6 (file page 117) credits + # one January's withheld premiums on December 31 of the year before: about + # $0.2 billion in 2015, $0.1 billion in 2020 and an estimated $0.2 billion + # in 2026, which are moved to 2016, 2021 and 2027. Premium income includes + # income-related premiums, which are deposited into the Part D account + # (footnote 73, file page 151). So each value equals the Part D enrollment + # share times calibration.gov.hhs.medicare.part_d.premiums_per_enrollee, + # plus Table V.E4's aggregate income-related premiums (file page 218) per + # Medicare enrollee. 2026 Medicare Trustees Report, transmitted + # 2026-06-09, retrieved 2026-10-11, sha256 + # ffa56b9137006872300b0346149eae1613d09a172b6ba118aad48e66dfc48fa8. + - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table III.D3 + href: https://www.cms.gov/oact/tr/2026#page=116 + - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table V.B3 + href: https://www.cms.gov/oact/tr/2026#page=196 +values: + # Historical. + 2015-01-01: 224.86 + 2016-01-01: 245.3 + 2017-01-01: 264.13 + 2018-01-01: 264.91 + 2019-01-01: 255.14 + 2020-01-01: 249.65 + 2021-01-01: 267.27 + 2022-01-01: 270.08 + 2023-01-01: 274.75 + 2024-01-01: 282.08 + # 2025 premiums fell with the voluntary Part D premium demonstration for + # stand-alone prescription drug plans (file page 109). + 2025-01-01: 215.04 + # Trustees' intermediate estimates. The 2030 jump is the Inflation + # Reduction Act's reset of the base beneficiary premium percentage + # (file page 154). + 2026-01-01: 281.3 + 2027-01-01: 356.74 + 2028-01-01: 389.05 + 2029-01-01: 404.32 + 2030-01-01: 674.95 + 2031-01-01: 708.2 + 2032-01-01: 720.06 + 2033-01-01: 752.61 + 2034-01-01: 776.68 + 2035-01-01: 809.85 diff --git a/policyengine_us/parameters/gov/household/cbo_social_insurance_benefits.yaml b/policyengine_us/parameters/gov/household/cbo_social_insurance_benefits.yaml index ac597fb7156..550ea17a0f1 100644 --- a/policyengine_us/parameters/gov/household/cbo_social_insurance_benefits.yaml +++ b/policyengine_us/parameters/gov/household/cbo_social_insurance_benefits.yaml @@ -2,7 +2,7 @@ description: Social insurance benefits included in CBO household income. values: 0000-01-01: - social_security - - medicare_gross_cost + - cbo_medicare_benefit - unemployment_compensation - workers_compensation @@ -10,3 +10,16 @@ metadata: unit: list period: year label: CBO social insurance benefits + reference: + # "Social insurance benefits consist of benefits provided through Social + # Security (Old Age, Survivors, and Disability Insurance); Medicare + # (measured as the average cost to the government of providing those + # benefits, net of offsetting receipts); regular unemployment insurance + # ...; and workers' compensation." (Appendix A, note 3.) + - title: Congressional Budget Office, The Distribution of Household Income in 2021, Appendix A + href: https://www.cbo.gov/system/files/2024-09/60341-income.pdf#page=27 + # "The measure of Medicare benefits in The Distribution of Household + # Income includes the federal government's average cost per enrollee of + # providing Medicare, net of premiums paid by enrollees." + - title: Congressional Budget Office, Sensitivity of the Distribution of Household Income to the Treatment of Health Insurance From 1979 to 2021 + href: https://www.cbo.gov/publication/61910 diff --git a/policyengine_us/tests/policy/baseline/household/income/household/cbo_household_income.yaml b/policyengine_us/tests/policy/baseline/household/income/household/cbo_household_income.yaml index 07d9f4f1d8e..d52fdf17f34 100644 --- a/policyengine_us/tests/policy/baseline/household/income/household/cbo_household_income.yaml +++ b/policyengine_us/tests/policy/baseline/household/income/household/cbo_household_income.yaml @@ -14,6 +14,7 @@ - name: CBO before-tax income adds social insurance and alias matches period: 2025 + absolute_error_margin: 0.01 input: employment_income: 40_000 employer_sponsored_insurance_premiums: 6_000 @@ -35,10 +36,14 @@ cbo_household_market_income: 49_102 # CMS Medicare spending per enrollee, 2025. medicare_gross_cost: 17_751 - # $12,000 + $17,751 + $2,000 + $1,000. - cbo_household_social_insurance_benefits: 32_751 - cbo_household_income_before_transfers_and_taxes: 81_853 - cbo_household_income: 81_853 + # $17,751 less 2025 premium income per Medicare enrollee ($82.26 Part A, + # $2,169.44 Part B, $215.04 Part D) and the $251.12 Part D low-income + # subsidy per Medicare enrollee. + cbo_medicare_benefit: 15_033.14 + # $12,000 + $15,033.14 + $2,000 + $1,000. + cbo_household_social_insurance_benefits: 30_033.14 + cbo_household_income_before_transfers_and_taxes: 79_135.14 + cbo_household_income: 79_135.14 - name: CBO means-tested transfers include only the listed programs period: 2026 diff --git a/policyengine_us/variables/gov/hhs/medicare/costs/cbo_medicare_benefit.py b/policyengine_us/variables/gov/hhs/medicare/costs/cbo_medicare_benefit.py new file mode 100644 index 00000000000..1a4e1d96df5 --- /dev/null +++ b/policyengine_us/variables/gov/hhs/medicare/costs/cbo_medicare_benefit.py @@ -0,0 +1,36 @@ +from policyengine_us.model_api import * + + +class cbo_medicare_benefit(Variable): + value_type = float + entity = Person + label = "CBO Medicare benefit" + documentation = ( + "Medicare benefit as the Congressional Budget Office counts it in " + "household income: the government's average cost per enrollee of " + "providing Medicare Parts A, B and D, net of premiums paid by or on " + "behalf of enrollees. CBO assigns the same average to every " + "enrollee and counts the Part D low-income subsidy separately as a " + "means-tested transfer, so this subtracts per-enrollee averages of " + "premium income and of the low-income subsidy from Medicare " + "spending per enrollee, rather than the person's own premiums." + ) + unit = USD + definition_period = YEAR + reference = ( + "https://www.cbo.gov/publication/61910", + "https://www.cbo.gov/system/files/2024-09/60341-income.pdf#page=27", + "https://www.cbo.gov/system/files/2018-07/54234-workingpaper.pdf#page=46", + ) + defined_for = "medicare_enrolled" + + def formula(person, period, parameters): + p = parameters(period).calibration.gov.hhs.medicare + premiums = p.premium_income_per_enrollee + total_premiums = premiums.part_a + premiums.part_b + premiums.part_d + net = ( + p.per_capita_cost + - total_premiums + - p.part_d_low_income_subsidy_per_enrollee + ) + return max_(net, 0) diff --git a/policyengine_us/variables/gov/hhs/medicare/costs/medicare_gross_cost.py b/policyengine_us/variables/gov/hhs/medicare/costs/medicare_gross_cost.py index 48533e92fb4..1baeeaf188a 100644 --- a/policyengine_us/variables/gov/hhs/medicare/costs/medicare_gross_cost.py +++ b/policyengine_us/variables/gov/hhs/medicare/costs/medicare_gross_cost.py @@ -7,12 +7,19 @@ class medicare_gross_cost(Variable): label = "Gross Medicare cost" documentation = ( "Annual Medicare spending on behalf of the beneficiary before " - "subtracting beneficiary premiums. This matches the gross Medicare " - "benefit concept used in the CBO household-income framework." + "subtracting beneficiary premiums: CMS Medicare spending per " + "enrollee, which covers Parts A through D, including the Part D " + "low-income subsidy. CBO's standard household income counts " + "Medicare net of premiums instead (cbo_medicare_benefit); CBO adds " + "the premiums back only in an expanded sensitivity measure, which " + "it calls gross Medicare spending." ) unit = USD definition_period = YEAR - reference = "https://www.cms.gov/about-cms/what-we-do/medicare" + reference = ( + "https://www.cms.gov/about-cms/what-we-do/medicare", + "https://www.cbo.gov/publication/61910", + ) defined_for = "medicare_enrolled" def formula(person, period, parameters): diff --git a/policyengine_us/variables/household/income/household/cbo_household_social_insurance_benefits.py b/policyengine_us/variables/household/income/household/cbo_household_social_insurance_benefits.py index b39c09e5db5..82ecc087d38 100644 --- a/policyengine_us/variables/household/income/household/cbo_household_social_insurance_benefits.py +++ b/policyengine_us/variables/household/income/household/cbo_household_social_insurance_benefits.py @@ -7,8 +7,8 @@ class cbo_household_social_insurance_benefits(Variable): label = "CBO household social insurance benefits" documentation = ( "Social insurance benefits included in CBO household income: Social " - "Security, gross Medicare benefits, unemployment insurance, and " - "workers' compensation." + "Security, Medicare benefits net of enrollee premiums, unemployment " + "insurance, and workers' compensation." ) definition_period = YEAR unit = USD From 3d8bb6d64327a418f56ea674d1690206ad1d20cf Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 11 Oct 2026 16:15:40 -0400 Subject: [PATCH 07/35] Test cbo_medicare_benefit and its Trustees series YAML: the 2025, 2015 and 2035 values, and five people with different premiums (Part A premium, income-related premiums, under 65, not enrolled) who all get the same average. Python, parameters only: transcription and conservation against the Trustees cells, the Part D series against #10111's share x premium plus income-related premiums, Part B premium income including income-related premiums, bounds through 2200, the post-2035 extension keeping each series' share of spending, and January reads. Co-Authored-By: Claude Opus 5.5 --- .../premium_income_per_enrollee/part_b.yaml | 7 +- .../core/test_cbo_medicare_benefit_series.py | 220 ++++++++++++++++++ .../medicare/costs/cbo_medicare_benefit.yaml | 111 +++++++++ 3 files changed, 335 insertions(+), 3 deletions(-) create mode 100644 policyengine_us/tests/core/test_cbo_medicare_benefit_series.py create mode 100644 policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/cbo_medicare_benefit.yaml diff --git a/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_b.yaml b/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_b.yaml index e70f8535fae..53b67c103aa 100644 --- a/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_b.yaml +++ b/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_b.yaml @@ -20,9 +20,10 @@ metadata: # 2021, the other footnote 7 years. # Premium income is "premium payments by (or on behalf of) enrollees" # (file page 88). It includes income-related premiums: in 2019 the - # standard premium, $135.50 a month, times 56.019 million Part B enrollees - # plus Table V.E3's $8.4 billion of income-related premiums (file page - # 208) is $99.5 billion, against $99.4 billion of premium income. + # standard premium, $135.50 a month (Table III.C2, file page 89), times + # 56.019 million Part B enrollees plus Table V.E3's $8.4 billion of + # income-related premiums (file page 215) is $99.5 billion, against $99.4 + # billion of premium income. # 2026 Medicare Trustees Report, transmitted 2026-06-09, retrieved # 2026-10-11, sha256 # ffa56b9137006872300b0346149eae1613d09a172b6ba118aad48e66dfc48fa8. diff --git a/policyengine_us/tests/core/test_cbo_medicare_benefit_series.py b/policyengine_us/tests/core/test_cbo_medicare_benefit_series.py new file mode 100644 index 00000000000..c3da92714a1 --- /dev/null +++ b/policyengine_us/tests/core/test_cbo_medicare_benefit_series.py @@ -0,0 +1,220 @@ +"""The per-enrollee series that ``cbo_medicare_benefit`` subtracts. + +CBO counts Medicare in household income at the government's average cost +per enrollee, net of premiums paid by enrollees, and counts the Part D +low-income subsidy separately. ``cbo_medicare_benefit`` takes CMS Medicare +spending per enrollee (``calibration.gov.hhs.medicare.per_capita_cost``) and +subtracts four series under ``calibration.gov.hhs.medicare``, each an +aggregate from the 2026 Medicare Trustees Report over Table V.B3's total +enrollment (people with Part A and/or Part B): + +- ``premium_income_per_enrollee.part_a``: Table III.B4 premiums from + voluntary enrollees. +- ``premium_income_per_enrollee.part_b``: Table III.C7 incurred premium + income through 2026, then Table III.C4 cash premium income, with the + December 31, 2026 credit moved back to 2027. +- ``premium_income_per_enrollee.part_d``: Table III.D3 premium income with + footnote 6's December 31 credits moved back a year. +- ``part_d_low_income_subsidy_per_enrollee``: Table IV.B10 low-income + subsidy (the 2025 report for 2015). + +These tests read parameters only; the YAML tests cover the variable. + +Invariants: + +1. Transcription: every value equals its formula applied to the Trustees' + published cells, rounded as stored. +2. Conservation: each series times total enrollment returns its published + aggregate, within the cells' rounding. +3. Differential: the Part D series equals the Part D enrollment share times + ``part_d.premiums_per_enrollee`` (which excludes income-related premiums, + per Part D enrollee) plus Table V.E4's income-related premiums per + Medicare enrollee: two derivations from different cells agree. +4. Part B premium income includes income-related premiums: in 2019 the + standard premium times Part B enrollment plus Table V.E3's aggregate + income-related premiums reproduces it within 0.5 percent, while the + standard premium alone falls more than 5 percent short. +5. Bounds: every series is positive, and net Medicare spending per enrollee + stays between 0 and gross spending, in every year from 2015 to 2200. +6. Extension: from 2036 to 2100 each series grows with Medicare spending + per enrollee, so each keeps its 2035 share of spending; later years hold + the 2100 value. +7. Calendar years: every date in a year reads the January 1 value. +""" + +import pytest +from hypothesis import given +from hypothesis import strategies as st +from policyengine_core.parameters.operations.get_parameter import get_parameter + +from policyengine_us.system import system + +MEDICARE = "calibration.gov.hhs.medicare" +SERIES = { + "part_a": f"{MEDICARE}.premium_income_per_enrollee.part_a", + "part_b": f"{MEDICARE}.premium_income_per_enrollee.part_b", + "part_d": f"{MEDICARE}.premium_income_per_enrollee.part_d", + "lis": f"{MEDICARE}.part_d_low_income_subsidy_per_enrollee", +} +SPENDING = f"{MEDICARE}.per_capita_cost" +FIRST_YEAR, LAST_PROJECTED_YEAR, END_YEAR = 2015, 2035, 2100 +YEARS = range(FIRST_YEAR, LAST_PROJECTED_YEAR + 1) + + +def _cells(*values): + return dict(zip(YEARS, values)) + + +# 2026 Medicare Trustees Report (sha256 ffa56b91...8fa8), file pages. +# Table V.B3 (page 196), total enrollment, thousands. +TOTAL_ENROLLMENT = _cells( + *(55_589, 57_073, 58_683, 60_020, 61_535, 62_887, 63_980, 65_166), + *(66_606, 68_066, 69_289, 70_743, 72_322, 74_026, 75_436, 76_598), + *(77_521, 78_327, 79_058, 79_827, 80_632), +) +# Table III.B4 (page 64), premiums from voluntary enrollees, $ billions. +PART_A_PREMIUMS = _cells( + *(3.2, 3.3, 3.5, 3.6, 3.9, 4.0, 4.2, 4.5, 4.7, 4.8, 5.7), + *(6.9, 7.4, 7.9, 8.5, 9.0, 9.7, 10.3, 11.1, 11.9, 12.6), +) +# Table III.C7 (page 102), premium income, incurred basis, $ millions. +PART_B_INCURRED = dict( + zip( + range(2015, 2027), + ( + *(67_515, 73_986, 81_522, 93_312, 99_413, 108_746, 113_411), + *(130_941, 131_166, 139_837, 150_318, 173_228), + ), + ) +) +# Table III.C4 (page 96), premium income, cash basis, $ billions. +PART_B_CASH = _cells( + *(69.4, 72.1, 81.5, 93.3, 99.4, 111.2, 111.0, 130.9, 131.2, 139.8, 150.3), + *(174.8, 182.8, 204.0, 222.3, 243.5, 264.3, 286.9, 315.1, 346.0, 375.1), +) +# Table III.D3 (page 116), premium income, cash basis, $ billions, and +# footnote 6's December 31 credits (page 117). +PART_D_CASH = _cells( + *(12.7, 13.8, 15.5, 15.9, 15.7, 15.8, 17.0, 17.6, 18.3, 19.2, 14.9), + *(20.1, 25.6, 28.8, 30.5, 51.7, 54.9, 56.4, 59.5, 62.0, 65.3), +) +PART_D_DECEMBER_31_CREDIT = {2015: 0.2, 2020: 0.1, 2026: 0.2} +# Table IV.B10 (page 159), low-income subsidy, $ billions; 2015 from the +# 2025 report's Table IV.B10 (page 159). +LOW_INCOME_SUBSIDY = _cells( + *(25.6, 26.4, 27.3, 28.5, 29.7, 33.0, 35.0, 39.4, 44.2, 41.2, 17.4), + *(18.1, 20.5, 22.1, 24.5, 28.9, 30.7, 31.7, 32.4, 33.3, 34.8), +) +# Table V.E4 (page 218), Part D income-related premiums, $ billions. +PART_D_IRMAA = _cells( + *(0.9, 1.0, 1.2, 1.4, 1.6, 1.8, 1.8, 1.7, 2.2, 2.2, 2.4, 3.1, 3.5), + *(4.0, 4.6, 10.8, 11.9, 12.6, 13.7, 14.7, 15.9), +) +# 2019: Table III.C2 (page 89) standard monthly premium, Table V.B3 Part B +# enrollment (thousands), Table V.E3 (page 215) income-related premiums +# ($ billions). +STANDARD_PART_B_PREMIUM_2019 = 135.50 +PART_B_ENROLLMENT_2019 = 56_019 +PART_B_IRMAA_2019 = 8.4 + + +def _part_b_billions(year): + if year in PART_B_INCURRED: + return PART_B_INCURRED[year] / 1e3 + # III.C4 footnote 7: January 2027 withholdings credited December 31, 2026. + december_31_credit = PART_B_CASH[2026] - PART_B_INCURRED[2026] / 1e3 + return PART_B_CASH[year] + (december_31_credit if year == 2027 else 0) + + +def _part_d_billions(year): + return ( + PART_D_CASH[year] + - PART_D_DECEMBER_31_CREDIT.get(year, 0) + + PART_D_DECEMBER_31_CREDIT.get(year - 1, 0) + ) + + +AGGREGATES = { + "part_a": PART_A_PREMIUMS.get, + "part_b": _part_b_billions, + "part_d": _part_d_billions, + "lis": LOW_INCOME_SUBSIDY.get, +} + + +def _read(name, date): + return get_parameter(system.parameters, name)(date) + + +def _value(series, year): + return _read(SERIES[series], f"{year}-01-01") + + +def _spending(year): + return _read(SPENDING, f"{year}-01-01") + + +def _per_enrollee(billions, year): + return billions * 1e9 / (TOTAL_ENROLLMENT[year] * 1e3) + + +@pytest.mark.parametrize("series", SERIES) +@pytest.mark.parametrize("year", YEARS) +def test_series_is_the_trustees_aggregate_per_medicare_enrollee(series, year): + expected = _per_enrollee(AGGREGATES[series](year), year) + assert _value(series, year) == round(expected, 2) + + +@pytest.mark.parametrize("series", SERIES) +@pytest.mark.parametrize("year", YEARS) +def test_series_times_enrollment_returns_the_aggregate(series, year): + rebuilt = _value(series, year) * TOTAL_ENROLLMENT[year] * 1e3 / 1e9 + # Stored to the cent; enrollment of at most 81 million moves the + # aggregate by at most $0.0005 billion. + assert rebuilt == pytest.approx(AGGREGATES[series](year), abs=1e-3) + + +@pytest.mark.parametrize("year", YEARS) +def test_part_d_series_matches_share_times_premium_plus_irmaa(year): + share = _read(f"{MEDICARE}.part_d.enrollment_share", f"{year}-01-01") + premium = _read(f"{MEDICARE}.part_d.premiums_per_enrollee", f"{year}-01-01") + irmaa = _per_enrollee(PART_D_IRMAA[year], year) + # The share is stored to four decimals and the premium to the cent, so + # the product can be off by up to about $0.05. + assert share * premium + irmaa == pytest.approx(_value("part_d", year), abs=0.1) + + +def test_part_b_premium_income_includes_income_related_premiums(): + standard = STANDARD_PART_B_PREMIUM_2019 * 12 * PART_B_ENROLLMENT_2019 * 1e3 / 1e9 + published = _part_b_billions(2019) + assert standard + PART_B_IRMAA_2019 == pytest.approx(published, rel=0.005) + assert standard < published * 0.95 + + +@given(st.integers(FIRST_YEAR, END_YEAR + 100)) +def test_series_are_positive_and_net_spending_is_between_zero_and_gross(year): + deductions = sum(_value(series, year) for series in SERIES) + assert all(_value(series, year) > 0 for series in SERIES) + assert 0 < _spending(year) - deductions < _spending(year) + + +@pytest.mark.parametrize("series", SERIES) +def test_extension_keeps_the_2035_share_of_spending(series): + share_2035 = _value(series, LAST_PROJECTED_YEAR) / _spending(LAST_PROJECTED_YEAR) + for year in range(LAST_PROJECTED_YEAR + 1, END_YEAR + 1): + assert _value(series, year) / _spending(year) == pytest.approx( + share_2035, rel=1e-9 + ) + + +@given(st.integers(END_YEAR, END_YEAR + 100)) +def test_series_hold_the_2100_values_afterwards(year): + for series in SERIES: + assert _value(series, year) == _value(series, END_YEAR) + + +@given(st.integers(FIRST_YEAR, END_YEAR), st.integers(1, 12), st.integers(1, 28)) +def test_every_date_in_a_year_reads_the_january_value(year, month, day): + date = f"{year}-{month:02d}-{day:02d}" + for series in SERIES: + assert _read(SERIES[series], date) == _value(series, year) diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/cbo_medicare_benefit.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/cbo_medicare_benefit.yaml new file mode 100644 index 00000000000..f3e1652a12b --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/cbo_medicare_benefit.yaml @@ -0,0 +1,111 @@ +# cbo_medicare_benefit = Medicare spending per enrollee - premium income per +# Medicare enrollee (Parts A, B and D) - Part D low-income subsidy per +# Medicare enrollee, the same for every enrollee. +# 2025: $17,751 - $82.26 - $2,169.44 - $215.04 - $251.12 = $15,033.14. + +- name: Case 1, enrolled person gets the average net of premiums and the low-income subsidy. + period: 2025 + absolute_error_margin: 0.01 + input: + age: 70 + is_medicare_eligible: true + medicare_enrolled: true + output: + medicare_gross_cost: 17_751 + cbo_medicare_benefit: 15_033.14 + +# CBO assigns the average to every enrollee, so the person with 20 quarters +# of coverage (a $6,216 Part A premium in 2025) and the person paying the +# income-related premiums get the same value as the others, though each one's +# medicare_cost differs. +- name: Case 2, every enrollee gets the same value whatever premiums they pay. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + premium_free_part_a: + age: 70 + is_medicare_eligible: true + medicare_enrolled: true + medicare_quarters_of_coverage: 40 + pays_part_a_premium: + age: 70 + is_medicare_eligible: true + medicare_enrolled: true + medicare_quarters_of_coverage: 20 + pays_irmaa: + age: 70 + is_medicare_eligible: true + medicare_enrolled: true + medicare_quarters_of_coverage: 40 + disabled_under_65: + age: 50 + is_medicare_eligible: true + medicare_enrolled: true + medicare_quarters_of_coverage: 40 + not_enrolled: + age: 70 + is_medicare_eligible: true + medicare_enrolled: false + tax_units: + tax_unit: + members: [premium_free_part_a] + adjusted_gross_income: + 2023: 30_000 + tax_unit_2: + members: [pays_part_a_premium] + adjusted_gross_income: + 2023: 30_000 + tax_unit_3: + members: [pays_irmaa] + # IRMAA uses income from two years before. + adjusted_gross_income: + 2023: 1_000_000 + tax_unit_4: + members: [disabled_under_65] + tax_unit_5: + members: [not_enrolled] + households: + household: + members: + [ + premium_free_part_a, + pays_part_a_premium, + pays_irmaa, + disabled_under_65, + not_enrolled, + ] + output: + cbo_medicare_benefit: [15_033.14, 15_033.14, 15_033.14, 15_033.14, 0] + +- name: Case 3, first year of the series. + period: 2015 + absolute_error_margin: 0.01 + input: + age: 70 + is_medicare_eligible: true + medicare_enrolled: true + output: + # $11,929 - $57.57 - $1,214.54 - $224.86 - $460.52. + cbo_medicare_benefit: 9_971.51 + +- name: Case 4, last Trustees projection year. + period: 2035 + absolute_error_margin: 0.01 + input: + age: 70 + is_medicare_eligible: true + medicare_enrolled: true + output: + # $31,764.35 (the 2034 CMS value grown at the 2031-2032 rate) - $156.27 + # - $4,652 - $809.85 - $431.59. + cbo_medicare_benefit: 25_714.64 + +- name: Case 5, not enrolled. + period: 2025 + input: + age: 70 + is_medicare_eligible: true + medicare_enrolled: false + output: + cbo_medicare_benefit: 0 From b2f74b4d24a175c97c33b7847b1300f69cfc4cbe Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 11 Oct 2026 16:57:03 -0400 Subject: [PATCH 08/35] Model the Medicare Part D low-income subsidy and count it as a CBO means-tested transfer Adds statutory eligibility for the Part D low-income subsidy (Extra Help): countable income below 150% of the poverty guideline for the family size, countable resources within the CPI-indexed limit plus the burial funds exclusion, and deemed eligibility for Medicaid enrollees, SSI recipients and Medicare Savings Program enrollees. The subsidy is valued at the Medicare Trustees' average payment per subsidy enrollee (Table IV.B9), as CBO assigns it, and joins gov.household.cbo_means_tested_transfers. Co-Authored-By: Claude Opus 5.5 --- changelog.d/medicare-part-d-lis.added.md | 1 + .../low_income_subsidy_per_recipient.yaml | 51 ++++++++++++ .../eligibility/income_limit.yaml | 15 ++++ .../eligibility/ineligible_jurisdictions.yaml | 25 ++++++ .../resources/burial_exclusion.yaml | 18 +++++ .../eligibility/resources/limit/couple.yaml | 40 ++++++++++ .../resources/limit/individual.yaml | 40 ++++++++++ .../eligibility/resources/sources.yaml | 20 +++++ .../income/excluded_sources.yaml | 15 ++++ .../household/cbo_means_tested_transfers.yaml | 5 ++ policyengine_us/programs.yaml | 17 ++++ .../part_d_lis_countable_income.yaml | 79 +++++++++++++++++++ .../part_d_lis_family_size.yaml | 57 +++++++++++++ .../part_d_lis_income_eligible.yaml | 62 +++++++++++++++ .../part_d_lis_resource_eligible.yaml | 63 +++++++++++++++ .../part_d/low_income_subsidy/part_d_lis.py | 28 +++++++ .../part_d_lis_countable_income.py | 40 ++++++++++ .../part_d_lis_deemed_eligible.py | 24 ++++++ .../low_income_subsidy/part_d_lis_eligible.py | 30 +++++++ .../low_income_subsidy/part_d_lis_enrolled.py | 25 ++++++ .../part_d_lis_family_size.py | 24 ++++++ .../part_d_lis_income_eligible.py | 23 ++++++ .../part_d_lis_resource_eligible.py | 29 +++++++ .../takes_up_part_d_lis_if_eligible.py | 18 +++++ 24 files changed, 749 insertions(+) create mode 100644 changelog.d/medicare-part-d-lis.added.md create mode 100644 policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/low_income_subsidy_per_recipient.yaml create mode 100644 policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/income_limit.yaml create mode 100644 policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/ineligible_jurisdictions.yaml create mode 100644 policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/burial_exclusion.yaml create mode 100644 policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/limit/couple.yaml create mode 100644 policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/limit/individual.yaml create mode 100644 policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/sources.yaml create mode 100644 policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/income/excluded_sources.yaml create mode 100644 policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_income.yaml create mode 100644 policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_family_size.yaml create mode 100644 policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_income_eligible.yaml create mode 100644 policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.yaml create mode 100644 policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis.py create mode 100644 policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_income.py create mode 100644 policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_deemed_eligible.py create mode 100644 policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_eligible.py create mode 100644 policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.py create mode 100644 policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_family_size.py create mode 100644 policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_income_eligible.py create mode 100644 policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.py create mode 100644 policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/takes_up_part_d_lis_if_eligible.py diff --git a/changelog.d/medicare-part-d-lis.added.md b/changelog.d/medicare-part-d-lis.added.md new file mode 100644 index 00000000000..b37702d66bd --- /dev/null +++ b/changelog.d/medicare-part-d-lis.added.md @@ -0,0 +1 @@ +Model the Medicare Part D low-income subsidy (Extra Help): statutory eligibility valued at the Trustees' average subsidy per enrollee, and count it as a CBO means-tested transfer. diff --git a/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/low_income_subsidy_per_recipient.yaml b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/low_income_subsidy_per_recipient.yaml new file mode 100644 index 00000000000..a5732d624e8 --- /dev/null +++ b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/low_income_subsidy_per_recipient.yaml @@ -0,0 +1,51 @@ +description: The Medicare Trustees report and project these Part D low-income subsidy payments per low-income subsidy enrollee. +metadata: + unit: currency-USD + period: year + label: Medicare Part D low-income subsidy per recipient + # From 2036, each value is the 2035 value times the growth in Medicare + # spending per enrollee, as for the per-enrollee series beside it. + uprating: calibration.gov.hhs.medicare.per_capita_cost + reference: + # Table IV.B9, "Low-income subsidy", "Subsidy amount": incurred payments + # per low-income subsidy enrollee, beside the subsidy's enrollment (in + # millions). Enrollment times the amount gives Table IV.B10's "Low-income + # subsidy" payments, e.g. 14.4 million x $1,254 = $18.1 billion in 2026. + # 2016 to 2035 come from the 2026 report (file page 158); 2015, which that + # table no longer shows, from the 2025 report (file page 158). The two + # reports differ by $1 to $2 in 2021 to 2023 (revised data). 2026 Medicare + # Trustees Report, transmitted 2026-06-09, retrieved 2026-10-11, sha256 + # ffa56b9137006872300b0346149eae1613d09a172b6ba118aad48e66dfc48fa8; 2025 + # report sha256 + # 1b3de7a4faeee5ad42059e10740603182b716a5fa7b53b30d360b45b9e474d95. + - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table IV.B9 + href: https://www.cms.gov/oact/tr/2026#page=158 + - title: 2025 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table IV.B9 + href: https://www.cms.gov/oact/tr/2025#page=158 +values: + # Historical. + 2015-01-01: 2_112 + 2016-01-01: 2_126 + 2017-01-01: 2_156 + 2018-01-01: 2_204 + 2019-01-01: 2_273 + 2020-01-01: 2_507 + 2021-01-01: 2_646 + 2022-01-01: 2_873 + 2023-01-01: 3_092 + 2024-01-01: 2_833 + # 2025 is the first year of the full Inflation Reduction Act benefit + # redesign (2026 report, file page 119), which moved spending from the + # subsidy to the direct subsidy (Table IV.B9). + 2025-01-01: 1_226 + # Trustees' intermediate estimates. + 2026-01-01: 1_254 + 2027-01-01: 1_384 + 2028-01-01: 1_459 + 2029-01-01: 1_579 + 2030-01-01: 1_833 + 2031-01-01: 1_922 + 2032-01-01: 1_956 + 2033-01-01: 1_982 + 2034-01-01: 2_014 + 2035-01-01: 2_076 diff --git a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/income_limit.yaml b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/income_limit.yaml new file mode 100644 index 00000000000..7aa3fcd667a --- /dev/null +++ b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/income_limit.yaml @@ -0,0 +1,15 @@ +description: Medicare limits the Part D low-income subsidy to people whose countable income is below this share of the federal poverty guideline for their family size. +values: + 2006-01-01: 1.5 + +metadata: + unit: /1 + period: year + label: Medicare Part D low-income subsidy income limit + reference: + - title: 42 U.S.C. § 1395w-114(a)(3)(A)(ii) - Subsidy eligible individual defined + href: https://www.law.cornell.edu/uscode/text/42/1395w-114#a_3_A_ii + - title: 42 CFR § 423.773(a)(1) - Subsidy eligible individual + href: https://www.ecfr.gov/current/title-42/chapter-IV/subchapter-B/part-423/subpart-P/section-423.773#p-423.773(a)(1) + - title: SSA POMS HI 03020.055 - Income Limits for Subsidy Eligibility + href: https://secure.ssa.gov/poms.nsf/lnx/0603020055 diff --git a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/ineligible_jurisdictions.yaml b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/ineligible_jurisdictions.yaml new file mode 100644 index 00000000000..150028aac86 --- /dev/null +++ b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/ineligible_jurisdictions.yaml @@ -0,0 +1,25 @@ +description: Medicare limits the Part D low-income subsidy to residents of the 50 states and the District of Columbia, so residents of these other jurisdictions are ineligible. +values: + 2006-01-01: + # Territories and freely associated states. + - GU + - MP + - PR + - PW + - VI + # Armed Forces mail codes, which are addresses abroad. + - AA + - AE + - AP + +metadata: + unit: list + period: year + label: Medicare Part D low-income subsidy ineligible jurisdictions + reference: + - title: 42 U.S.C. § 1395w-114(a)(3)(F) - Treatment of territorial residents + href: https://www.law.cornell.edu/uscode/text/42/1395w-114#a_3_F + - title: 42 CFR § 423.772 - Definitions (State) + href: https://www.ecfr.gov/current/title-42/chapter-IV/subchapter-B/part-423/subpart-P/section-423.772 + - title: 20 CFR § 418.3010(b)(11) - Definitions (State) + href: https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-A/section-418.3010#p-418.3010(b)(11) diff --git a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/burial_exclusion.yaml b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/burial_exclusion.yaml new file mode 100644 index 00000000000..d6a04e3f272 --- /dev/null +++ b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/burial_exclusion.yaml @@ -0,0 +1,18 @@ +description: Medicare excludes this amount per person, for the applicant and a spouse living with them, from countable resources as funds expected to be used for burial under the Part D low-income subsidy. +values: + 2006-01-01: 1_500 + +metadata: + unit: currency-USD + period: year + label: Medicare Part D low-income subsidy burial funds exclusion + reference: + # SSA applies the exclusion unless the applicant says none of the + # resources will go to funeral or burial expenses, without asking for the + # funds' value or designation (POMS HI 03030.020 and HI 03030.025). + - title: 20 CFR § 418.3425(j) - Burial funds resource exclusion + href: https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3425#p-418.3425(j) + - title: SSA POMS HI 03030.020 - Resource Exclusions + href: https://secure.ssa.gov/poms.nsf/lnx/0603030020 + - title: SSA POMS HI 03030.025 - Resource Limits for Subsidy Eligibility + href: https://secure.ssa.gov/poms.nsf/lnx/0603030025 diff --git a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/limit/couple.yaml b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/limit/couple.yaml new file mode 100644 index 00000000000..fd07ec6bf55 --- /dev/null +++ b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/limit/couple.yaml @@ -0,0 +1,40 @@ +description: Medicare limits the Part D low-income subsidy to married people living with their spouse whose combined countable resources do not exceed this amount, before the burial funds exclusion. +values: + 2006-01-01: 20_000 + 2007-01-01: 20_410 + 2008-01-01: 20_970 + 2009-01-01: 22_010 + 2011-01-01: 22_260 + 2012-01-01: 23_120 + 2013-01-01: 23_580 + 2014-01-01: 23_860 + 2015-01-01: 24_250 + 2017-01-01: 24_600 + 2018-01-01: 25_150 + 2019-01-01: 25_720 + 2020-01-01: 26_160 + 2021-01-01: 26_520 + 2022-01-01: 27_950 + 2023-01-01: 30_240 + 2024-01-01: 31_360 + 2025-01-01: 32_130 + 2026-01-01: 33_100 + +metadata: + unit: currency-USD + period: year + label: Medicare Part D low-income subsidy couple resource limit + reference: + # The statute's alternative resource standard: $20,000 in 2006, raised + # each year by the September CPI-U and rounded to $10. Before 2024 it was + # the limit for the partial subsidy (the full subsidy had a lower limit); + # from 2024 it is the limit for the full subsidy, the only one left. SSA's + # table lists both pre-2024 limits; these are the higher ones. SSA's table + # excludes the $3,000 couple burial funds exclusion, which is a separate + # parameter. + - title: 42 U.S.C. § 1395w-114(a)(3)(E)(i) - Alternative resource standard + href: https://www.law.cornell.edu/uscode/text/42/1395w-114#a_3_E_i + - title: 42 CFR § 423.773(b)(2)(iii) and (d)(2) - Resource thresholds + href: https://www.ecfr.gov/current/title-42/chapter-IV/subchapter-B/part-423/subpart-P/section-423.773#p-423.773(d)(2) + - title: SSA POMS HI 03030.025 - Resource Limits for Subsidy Eligibility + href: https://secure.ssa.gov/poms.nsf/lnx/0603030025 diff --git a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/limit/individual.yaml b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/limit/individual.yaml new file mode 100644 index 00000000000..54fc4010afd --- /dev/null +++ b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/limit/individual.yaml @@ -0,0 +1,40 @@ +description: Medicare limits the Part D low-income subsidy to unmarried people whose countable resources do not exceed this amount, before the burial funds exclusion. +values: + 2006-01-01: 10_000 + 2007-01-01: 10_210 + 2008-01-01: 10_490 + 2009-01-01: 11_010 + 2011-01-01: 11_140 + 2012-01-01: 11_570 + 2013-01-01: 11_800 + 2014-01-01: 11_940 + 2015-01-01: 12_140 + 2017-01-01: 12_320 + 2018-01-01: 12_600 + 2019-01-01: 12_890 + 2020-01-01: 13_110 + 2021-01-01: 13_290 + 2022-01-01: 14_010 + 2023-01-01: 15_160 + 2024-01-01: 15_720 + 2025-01-01: 16_100 + 2026-01-01: 16_590 + +metadata: + unit: currency-USD + period: year + label: Medicare Part D low-income subsidy individual resource limit + reference: + # The statute's alternative resource standard: $10,000 in 2006, raised + # each year by the September CPI-U and rounded to $10. Before 2024 it was + # the limit for the partial subsidy (the full subsidy had a lower limit); + # from 2024 it is the limit for the full subsidy, the only one left. SSA's + # table lists both pre-2024 limits; these are the higher ones. SSA's table + # excludes the $1,500 burial funds exclusion, which is a separate + # parameter. + - title: 42 U.S.C. § 1395w-114(a)(3)(E)(i) - Alternative resource standard + href: https://www.law.cornell.edu/uscode/text/42/1395w-114#a_3_E_i + - title: 42 CFR § 423.773(b)(2)(iii) and (d)(2) - Resource thresholds + href: https://www.ecfr.gov/current/title-42/chapter-IV/subchapter-B/part-423/subpart-P/section-423.773#p-423.773(d)(2) + - title: SSA POMS HI 03030.025 - Resource Limits for Subsidy Eligibility + href: https://secure.ssa.gov/poms.nsf/lnx/0603030025 diff --git a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/sources.yaml b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/sources.yaml new file mode 100644 index 00000000000..e85f02bcbf8 --- /dev/null +++ b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/sources.yaml @@ -0,0 +1,20 @@ +description: Medicare counts these assets as resources under the Part D low-income subsidy. +values: + 2006-01-01: + - bank_account_assets + - stock_assets + - bond_assets + +metadata: + unit: list + period: year + label: Medicare Part D low-income subsidy countable resource sources + reference: + # SSA counts liquid resources (cash, financial accounts, stocks, bonds, + # mutual funds, retirement accounts and similar) and equity in real + # property other than the home. The model has no retirement account or + # non-home real property inputs. + - title: 20 CFR § 418.3405 - What types of resources do we count? + href: https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3405 + - title: 42 CFR § 423.772 - Definitions (resources) + href: https://www.ecfr.gov/current/title-42/chapter-IV/subchapter-B/part-423/subpart-P/section-423.772 diff --git a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/income/excluded_sources.yaml b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/income/excluded_sources.yaml new file mode 100644 index 00000000000..18053652968 --- /dev/null +++ b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/income/excluded_sources.yaml @@ -0,0 +1,15 @@ +description: Medicare excludes these Supplemental Security Income unearned income sources from countable income under the Part D low-income subsidy. +values: + 2006-01-01: + - dividend_income + - interest_income + +metadata: + unit: list + period: year + label: Medicare Part D low-income subsidy excluded income sources + reference: + - title: 20 CFR § 418.3350(d) - What types of unearned income do we not count? + href: https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3350#p-418.3350(d) + - title: SSA POMS HI 03020.050 - Unearned Income Exclusions + href: https://secure.ssa.gov/poms.nsf/lnx/0603020050 diff --git a/policyengine_us/parameters/gov/household/cbo_means_tested_transfers.yaml b/policyengine_us/parameters/gov/household/cbo_means_tested_transfers.yaml index f8081bc5a9d..b32ee470846 100644 --- a/policyengine_us/parameters/gov/household/cbo_means_tested_transfers.yaml +++ b/policyengine_us/parameters/gov/household/cbo_means_tested_transfers.yaml @@ -11,6 +11,7 @@ values: - reduced_price_school_meals - spm_unit_energy_subsidy - general_assistance + - part_d_lis metadata: unit: list @@ -19,3 +20,7 @@ metadata: reference: - title: Congressional Budget Office, Reconciling the Official Poverty Measure and CBO’s Distributional Analysis of Household Income, Including In-Kind Transfers href: https://www.cbo.gov/publication/61157 + # CBO counts the Medicare Part D low-income subsidy as a means-tested + # transfer, not as Medicare (see cbo_medicare_benefit). + - title: Congressional Budget Office, Sensitivity of the Distribution of Household Income to the Treatment of Health Insurance From 1979 to 2021 (January 2026) + href: https://www.cbo.gov/publication/61910 diff --git a/policyengine_us/programs.yaml b/policyengine_us/programs.yaml index 05cb1d13747..8df4779c589 100644 --- a/policyengine_us/programs.yaml +++ b/policyengine_us/programs.yaml @@ -1117,6 +1117,23 @@ programs: adjustments; gross Part B premium calibration should use the enrollment-gated gross_medicare_part_b_premium_if_enrolled variable. + - id: medicare_part_d_lis + name: Medicare Part D Extra Help + full_name: Medicare Part D Low-Income Subsidy (Extra Help) + category: Healthcare + agency: HHS + status: partial + coverage: US + variable: part_d_lis + parameter_prefix: gov.hhs.medicare.part_d.low_income_subsidy + verified_start_year: 2015 + notes: >- + Models eligibility (countable income below 150% of the poverty guideline, + resource limits, and deemed eligibility for Medicaid and SSI recipients + and Medicare Savings Program enrollees) and values the subsidy at the + Medicare Trustees' average payment per subsidy enrollee, as CBO does; + the premium and cost-sharing subsidies are not computed per person. + # --- HUD programs --- - id: section_8 name: Section 8 diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_income.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_income.yaml new file mode 100644 index 00000000000..f21127b4dbf --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_income.yaml @@ -0,0 +1,79 @@ +# Countable income: SSI income of the person and a spouse living with them, +# without interest and dividends; the $20 general exclusion and the $65 and +# one-half earned income exclusions apply once to the couple's income +# (20 CFR 418.3310, 418.3325, 418.3350). + +- name: Single person, Social Security and interest; interest excluded. + period: 2026 + input: + people: + person: + age: 70 + social_security: 18_000 + interest_income: 1_000 + dividend_income: 600 + output: + # Unearned 18,000 + 1,000 + 600 - 1,600 excluded = 18,000 a year, + # 1,500 a month; less the $20 general exclusion = 1,480 a month. + # 1,480 x 12 = 17,760. + part_d_lis_countable_income: 17_760 + +- name: Married couple, exclusions applied once to combined income. + period: 2026 + input: + people: + spouse1: + age: 70 + employment_income: 12_000 + spouse2: + age: 67 + social_security: 6_000 + dividend_income: 500 + marital_units: + marital_unit: + members: [spouse1, spouse2] + output: + # Combined unearned 6,000 a year = 500 a month, less $20 = 480. + # Combined earned 12,000 a year = 1,000 a month, less $65 = 935, half + # excluded = 467.50. Monthly 947.50 x 12 = 11,370 for each spouse. + part_d_lis_countable_income: [11_370, 11_370] + +- name: Spouse's income counts even when only one spouse is a Medicare enrollee. + period: 2026 + input: + people: + spouse1: + age: 70 + medicare_enrolled: true + social_security: 12_000 + spouse2: + age: 60 + medicare_enrolled: false + employment_income: 30_000 + marital_units: + marital_unit: + members: [spouse1, spouse2] + output: + # Unearned 1,000 a month less $20 = 980. Earned 2,500 a month less $65 = + # 2,435, half = 1,217.50. Monthly 2,197.50 x 12 = 26,370. + part_d_lis_countable_income: [26_370, 26_370] + +- name: Earned income only; the unused $20 general exclusion applies to earnings. + period: 2026 + input: + people: + person: + age: 66 + employment_income: 6_000 + output: + # 500 a month less $20 less $65 = 415, half = 207.50; x 12 = 2,490. + part_d_lis_countable_income: 2_490 + +- name: No income. + period: 2026 + input: + people: + person: + age: 66 + output: + part_d_lis_countable_income: 0 diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_family_size.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_family_size.yaml new file mode 100644 index 00000000000..d0bcd98f082 --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_family_size.yaml @@ -0,0 +1,57 @@ +# Family size: the person, a spouse living with them, and relatives who +# depend on them for at least half of their support (42 CFR 423.772). + +- name: Single person living alone. + period: 2026 + input: + people: + person: + age: 70 + output: + part_d_lis_family_size: 1 + +- name: Married couple supporting a grandchild. + period: 2026 + input: + people: + head: + age: 70 + spouse: + age: 68 + grandchild: + age: 12 + is_tax_unit_dependent: true + marital_units: + couple: + members: [head, spouse] + grandchild_unit: + members: [grandchild] + tax_units: + tax_unit: + members: [head, spouse, grandchild] + output: + # The couple's family is 3. The grandchild is not a head or spouse, so + # its own family size is 1. + part_d_lis_family_size: [3, 3, 1] + +- name: Parent who is a dependent of an adult child. + period: 2026 + input: + people: + child: + age: 45 + parent: + age: 80 + is_tax_unit_dependent: true + marital_units: + child_unit: + members: [child] + parent_unit: + members: [parent] + tax_units: + tax_unit: + members: [child, parent] + output: + # The parent depends on the child, so the parent's family is just the + # parent; the child's family includes the dependent parent. + part_d_lis_family_size: [2, 1] diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_income_eligible.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_income_eligible.yaml new file mode 100644 index 00000000000..44769a1e266 --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_income_eligible.yaml @@ -0,0 +1,62 @@ +# Countable income must be below 150% of the poverty guideline for the +# family size (42 U.S.C. 1395w-114(a)(3)(A)(ii)). 2026 guidelines: $15,960 +# for one person in the contiguous states plus $5,680 per additional person; +# Alaska $19,950 plus $7,100. + +- name: Single person just below 150% of the guideline. + period: 2026 + input: + people: + person: + part_d_lis_countable_income: 23_939 + part_d_lis_family_size: 1 + output: + # 1.5 x 15,960 = 23,940. + part_d_lis_income_eligible: true + +- name: Single person exactly at 150% of the guideline is not below it. + period: 2026 + input: + people: + person: + part_d_lis_countable_income: 23_940 + part_d_lis_family_size: 1 + output: + part_d_lis_income_eligible: false + +- name: Family of three uses the three-person guideline. + period: 2026 + input: + people: + person: + part_d_lis_countable_income: 40_000 + part_d_lis_family_size: 3 + output: + # 1.5 x (15,960 + 2 x 5,680) = 1.5 x 27,320 = 40,980. + part_d_lis_income_eligible: true + +- name: Alaska uses its own guideline. + period: 2026 + input: + people: + person: + part_d_lis_countable_income: 29_000 + part_d_lis_family_size: 1 + households: + household: + members: [person] + state_code: AK + output: + # 1.5 x 19,950 = 29,925; the contiguous-state limit would be 23,940. + part_d_lis_income_eligible: true + +- name: 2023, income from 135% to 150% of the guideline qualified for the partial subsidy. + period: 2023 + input: + people: + person: + part_d_lis_countable_income: 21_000 + part_d_lis_family_size: 1 + output: + # 2023: 1.35 x 14,580 = 19,683 < 21,000 < 1.5 x 14,580 = 21,870. + part_d_lis_income_eligible: true diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.yaml new file mode 100644 index 00000000000..c12e0858819 --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.yaml @@ -0,0 +1,63 @@ +# Countable resources of the person and a spouse living with them must not +# exceed the limit plus $1,500 per person for burial funds (POMS HI +# 03030.025, 20 CFR 418.3425(j)). + +- name: Single person at the 2026 limit with the burial exclusion. + period: 2026 + input: + people: + person: + bank_account_assets: 18_090 + output: + # 16,590 + 1,500 = 18,090. + part_d_lis_resource_eligible: true + +- name: Single person one dollar over the 2026 limit. + period: 2026 + input: + people: + person: + bank_account_assets: 18_091 + output: + part_d_lis_resource_eligible: false + +- name: Married couple at the 2026 couple limit, resources combined. + period: 2026 + input: + people: + spouse1: + bank_account_assets: 20_000 + spouse2: + stock_assets: 10_100 + bond_assets: 6_000 + marital_units: + marital_unit: + members: [spouse1, spouse2] + output: + # 20,000 + 10,100 + 6,000 = 36,100 = 33,100 + 2 x 1,500. + part_d_lis_resource_eligible: [true, true] + +- name: Married couple one dollar over the 2026 couple limit. + period: 2026 + input: + people: + spouse1: + bank_account_assets: 20_001 + spouse2: + stock_assets: 16_100 + marital_units: + marital_unit: + members: [spouse1, spouse2] + output: + part_d_lis_resource_eligible: [false, false] + +- name: 2023 uses the higher (partial subsidy) limit. + period: 2023 + input: + people: + person: + bank_account_assets: 16_660 + output: + # 15,160 + 1,500 = 16,660, CMS's published 2023 partial subsidy limit. + # The 2023 full subsidy limit was 9,090 + 1,500 = 10,590. + part_d_lis_resource_eligible: true diff --git a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis.py b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis.py new file mode 100644 index 00000000000..aa3d928ddea --- /dev/null +++ b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis.py @@ -0,0 +1,28 @@ +from policyengine_us.model_api import * + + +class part_d_lis(Variable): + value_type = float + entity = Person + label = "Medicare Part D low-income subsidy" + documentation = ( + "Value of the Part D low-income subsidy (Extra Help) as the " + "Congressional Budget Office counts it: the Medicare Trustees' " + "average subsidy payment per subsidy enrollee, the same for every " + "enrollee. Most of the subsidy pays cost sharing, which depends on " + "each enrollee's drug use, which the model does not have." + ) + unit = USD + definition_period = YEAR + reference = ( + "https://www.law.cornell.edu/uscode/text/42/1395w-114", + "https://www.cbo.gov/publication/61910", + "https://www.cbo.gov/system/files/2018-07/54234-workingpaper.pdf#page=46", + "https://www.cms.gov/oact/tr/2026#page=158", + ) + defined_for = "part_d_lis_enrolled" + + def formula(person, period, parameters): + p = parameters(period).calibration.gov.hhs.medicare.part_d + enrolled = person("part_d_lis_enrolled", period) + return enrolled * p.low_income_subsidy_per_recipient diff --git a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_income.py b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_income.py new file mode 100644 index 00000000000..686665bd8a5 --- /dev/null +++ b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_income.py @@ -0,0 +1,40 @@ +from policyengine_us.model_api import * +from policyengine_us.variables.gov.ssa.ssi.eligibility.income._apply_ssi_exclusions import ( + _apply_ssi_exclusions, +) + + +class part_d_lis_countable_income(Variable): + value_type = float + entity = Person + label = "Medicare Part D low-income subsidy countable income" + documentation = ( + "Annual countable income for the Part D low-income subsidy: the " + "Supplemental Security Income definition of income, for the person " + "and a spouse living with them, without in-kind support and " + "maintenance or interest and dividends. The $20 general, $65 earned " + "and one-half earned income exclusions apply once to the combined " + "income." + ) + unit = USD + definition_period = YEAR + reference = ( + "https://www.law.cornell.edu/uscode/text/42/1395w-114#a_3_C", + "https://www.ecfr.gov/current/title-42/chapter-IV/subchapter-B/part-423/subpart-P/section-423.772", + "https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3310", + "https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3325", + "https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3350", + "https://secure.ssa.gov/poms.nsf/lnx/0603020050", + ) + + def formula(person, period, parameters): + p = parameters(period).gov.hhs.medicare.part_d.low_income_subsidy.income + earned = person("ssi_earned_income", period) + unearned = person("ssi_unearned_income", period) - add( + person, period, p.excluded_sources + ) + # A spouse's income counts whether or not the spouse applies or is + # eligible, and the exclusions apply once to the couple's income. + couple_earned = person.marital_unit.sum(earned) + couple_unearned = max_(person.marital_unit.sum(unearned), 0) + return _apply_ssi_exclusions(couple_earned, couple_unearned, parameters, period) diff --git a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_deemed_eligible.py b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_deemed_eligible.py new file mode 100644 index 00000000000..2dfdc01bafd --- /dev/null +++ b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_deemed_eligible.py @@ -0,0 +1,24 @@ +from policyengine_us.model_api import * + + +class part_d_lis_deemed_eligible(Variable): + value_type = bool + entity = Person + label = "Deemed eligible for the Medicare Part D low-income subsidy" + documentation = ( + "Treated as eligible for the full subsidy without an income or " + "resource test: full-benefit dual eligibles (Medicaid enrollees), " + "Supplemental Security Income recipients, and people eligible for a " + "Medicare Savings Program (QMB, SLMB or QI)." + ) + definition_period = YEAR + reference = ( + "https://www.law.cornell.edu/uscode/text/42/1395w-114#a_3_B_v", + "https://www.ecfr.gov/current/title-42/chapter-IV/subchapter-B/part-423/subpart-P/section-423.773#p-423.773(c)", + ) + + def formula(person, period, parameters): + medicaid = person("medicaid_enrolled", period) + ssi = add(person, period, ["ssi"]) > 0 + msp = add(person, period, ["msp_eligible"]) > 0 + return medicaid | ssi | msp diff --git a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_eligible.py b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_eligible.py new file mode 100644 index 00000000000..7e07fb76b40 --- /dev/null +++ b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_eligible.py @@ -0,0 +1,30 @@ +from policyengine_us.model_api import * + + +class part_d_lis_eligible(Variable): + value_type = bool + entity = Person + label = "Eligible for the Medicare Part D low-income subsidy" + documentation = ( + "A Medicare enrollee living in the 50 states or the District of " + "Columbia who is deemed eligible or meets the income and resource " + "tests. Before 2024 people with income from 135% to 150% of the " + "poverty guideline, or resources between the lower and higher " + "limits, got a partial subsidy; this covers both." + ) + definition_period = YEAR + reference = ( + "https://www.law.cornell.edu/uscode/text/42/1395w-114#a_3", + "https://www.ecfr.gov/current/title-42/chapter-IV/subchapter-B/part-423/subpart-P/section-423.773", + "https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3101", + ) + defined_for = "medicare_enrolled" + + def formula(person, period, parameters): + p = parameters(period).gov.hhs.medicare.part_d.low_income_subsidy.eligibility + state_code = person.household("state_code_str", period) + in_state = ~np.isin(state_code, p.ineligible_jurisdictions) + deemed = person("part_d_lis_deemed_eligible", period) + income_eligible = person("part_d_lis_income_eligible", period) + resource_eligible = person("part_d_lis_resource_eligible", period) + return in_state & (deemed | (income_eligible & resource_eligible)) diff --git a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.py b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.py new file mode 100644 index 00000000000..a1cadfb0488 --- /dev/null +++ b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.py @@ -0,0 +1,25 @@ +from policyengine_us.model_api import * + + +class part_d_lis_enrolled(Variable): + value_type = bool + entity = Person + label = "Enrolled in the Medicare Part D low-income subsidy" + documentation = ( + "Medicare enrolls Medicaid enrollees and Supplemental Security Income " + "recipients in a Part D plan with the subsidy without an application. " + "Other eligible people receive it if they take it up." + ) + definition_period = YEAR + reference = ( + "https://www.ecfr.gov/current/title-42/chapter-IV/subchapter-B/part-423/subpart-P/section-423.773#p-423.773(c)(2)", + "https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3101", + "https://www.ecfr.gov/current/title-42/chapter-IV/subchapter-B/part-423/subpart-B/section-423.34", + ) + defined_for = "part_d_lis_eligible" + + def formula(person, period, parameters): + medicaid = person("medicaid_enrolled", period) + ssi = add(person, period, ["ssi"]) > 0 + takes_up = person("takes_up_part_d_lis_if_eligible", period) + return medicaid | ssi | takes_up diff --git a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_family_size.py b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_family_size.py new file mode 100644 index 00000000000..9e5a9bf72b8 --- /dev/null +++ b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_family_size.py @@ -0,0 +1,24 @@ +from policyengine_us.model_api import * + + +class part_d_lis_family_size(Variable): + value_type = int + entity = Person + label = "Medicare Part D low-income subsidy family size" + documentation = ( + "The person, a spouse living with them, and relatives living with " + "them who depend on the person or spouse for at least half of their " + "support, approximated by the dependents of the tax unit the person " + "heads or is the spouse in." + ) + definition_period = YEAR + reference = ( + "https://www.ecfr.gov/current/title-42/chapter-IV/subchapter-B/part-423/subpart-P/section-423.772", + "https://secure.ssa.gov/poms.nsf/lnx/0603020055", + ) + + def formula(person, period, parameters): + couple_size = person.marital_unit.nb_persons() + head_or_spouse = person("is_tax_unit_head_or_spouse", period) + dependents = person.tax_unit("tax_unit_dependents", period) + return couple_size + where(head_or_spouse, dependents, 0) diff --git a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_income_eligible.py b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_income_eligible.py new file mode 100644 index 00000000000..37e1475241a --- /dev/null +++ b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_income_eligible.py @@ -0,0 +1,23 @@ +from policyengine_us.model_api import * +from policyengine_us.variables.gov.hhs.tax_unit_fpg import fpg + + +class part_d_lis_income_eligible(Variable): + value_type = bool + entity = Person + label = "Income eligible for the Medicare Part D low-income subsidy" + definition_period = YEAR + reference = ( + "https://www.law.cornell.edu/uscode/text/42/1395w-114#a_3_A_ii", + "https://www.ecfr.gov/current/title-42/chapter-IV/subchapter-B/part-423/subpart-P/section-423.773#p-423.773(a)(1)", + "https://secure.ssa.gov/poms.nsf/lnx/0603020055", + ) + + def formula(person, period, parameters): + p = parameters(period).gov.hhs.medicare.part_d.low_income_subsidy.eligibility + family_size = person("part_d_lis_family_size", period) + state_group = person.household("state_group_str", period) + income_limit = p.income_limit * fpg( + family_size, state_group, period, parameters + ) + return person("part_d_lis_countable_income", period) < income_limit diff --git a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.py b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.py new file mode 100644 index 00000000000..fe7e0580493 --- /dev/null +++ b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.py @@ -0,0 +1,29 @@ +from policyengine_us.model_api import * + + +class part_d_lis_resource_eligible(Variable): + value_type = bool + entity = Person + label = "Resource eligible for the Medicare Part D low-income subsidy" + documentation = ( + "Countable resources of the person and a spouse living with them do " + "not exceed the individual or couple limit plus the burial funds " + "exclusion for each of them." + ) + definition_period = YEAR + reference = ( + "https://www.law.cornell.edu/uscode/text/42/1395w-114#a_3_E", + "https://www.ecfr.gov/current/title-42/chapter-IV/subchapter-B/part-423/subpart-P/section-423.773#p-423.773(d)(2)", + "https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3410", + "https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3425", + "https://secure.ssa.gov/poms.nsf/lnx/0603030025", + ) + + def formula(person, period, parameters): + p = parameters( + period + ).gov.hhs.medicare.part_d.low_income_subsidy.eligibility.resources + resources = person.marital_unit.sum(add(person, period, p.sources)) + couple_size = person.marital_unit.nb_persons() + limit = where(couple_size == 2, p.limit.couple, p.limit.individual) + return resources <= limit + p.burial_exclusion * couple_size diff --git a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/takes_up_part_d_lis_if_eligible.py b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/takes_up_part_d_lis_if_eligible.py new file mode 100644 index 00000000000..f1a359189e5 --- /dev/null +++ b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/takes_up_part_d_lis_if_eligible.py @@ -0,0 +1,18 @@ +from policyengine_us.model_api import * + + +class takes_up_part_d_lis_if_eligible(Variable): + value_type = bool + entity = Person + label = ( + "Whether an eligible person enrolls in the Medicare Part D low-income subsidy" + ) + documentation = ( + "Whether an eligible person who is neither a Medicaid enrollee nor a " + "Supplemental Security Income recipient applies for the subsidy and " + "enrolls in a Part D plan. Medicare Savings Program enrollees are " + "deemed eligible, but the model has Medicare Savings Program " + "eligibility, not enrollment, so this flag covers them too." + ) + definition_period = YEAR + default_value = True From e7bec1ea01d011c8cac8ea095822bc19fabdcca9 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 11 Oct 2026 17:26:58 -0400 Subject: [PATCH 09/35] Test the Part D low-income subsidy: YAML cases and invariants YAML tests for every new variable, households computed from their inputs (Medicare Savings Program deeming, the subsidy's own tests, the pre-2024 partial range, take-up), and the CBO means-tested list. Python invariants: IV.B9 transcription, IV.B10 conservation, agreement with the per-enrollee series cbo_medicare_benefit subtracts, the CPI rule behind the resource limits, Hypothesis bounds, restated eligibility rules over a seeded sample with income, interest and asset variants, and a differential test against msp_countable_income. Co-Authored-By: Claude Opus 5.5 --- policyengine_us/tests/core/test_part_d_lis.py | 444 ++++++++++++++++++ .../low_income_subsidy/integration.yaml | 187 ++++++++ .../part_d/low_income_subsidy/part_d_lis.yaml | 60 +++ .../part_d_lis_deemed_eligible.yaml | 47 ++ .../part_d_lis_eligible.yaml | 82 ++++ .../part_d_lis_enrolled.yaml | 61 +++ .../household/cbo_household_income.yaml | 33 +- 7 files changed, 913 insertions(+), 1 deletion(-) create mode 100644 policyengine_us/tests/core/test_part_d_lis.py create mode 100644 policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/integration.yaml create mode 100644 policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis.yaml create mode 100644 policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_deemed_eligible.yaml create mode 100644 policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_eligible.yaml create mode 100644 policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.yaml diff --git a/policyengine_us/tests/core/test_part_d_lis.py b/policyengine_us/tests/core/test_part_d_lis.py new file mode 100644 index 00000000000..632dacf8660 --- /dev/null +++ b/policyengine_us/tests/core/test_part_d_lis.py @@ -0,0 +1,444 @@ +"""Invariants of the Medicare Part D low-income subsidy (``part_d_lis``). + +The subsidy goes to Medicare enrollees in the 50 states and DC who are deemed +eligible (Medicaid enrollees, SSI recipients, Medicare Savings Program +enrollees) or whose countable income is below 150% of the poverty guideline +for their family size and whose countable resources are within the limit +plus $1,500 per person for burial funds (42 U.S.C. 1395w-114(a)(3); 42 CFR +423.773; 20 CFR 418 subpart D). Each enrollee is valued at the Medicare +Trustees' average subsidy per subsidy enrollee, as CBO does. + +Parameters: + +1. Transcription: ``low_income_subsidy_per_recipient`` equals Table IV.B9's + "Subsidy amount" (2026 report; the 2025 report for 2015). +2. Conservation: IV.B9 enrollment times the amount returns Table IV.B10's + low-income subsidy payments, within the cells' rounding. +3. Differential: the same payments over Table V.B3's total enrollment equal + ``part_d_low_income_subsidy_per_enrollee``, the series + ``cbo_medicare_benefit`` subtracts, built from different cells. +4. Indexing: each resource limit is the previous year's limit raised by the + September-to-September change in the CPI-U (not seasonally adjusted), + never lowered, and rounded to the nearest $10, from the statute's 2006 + amounts. SSA's published 2015 couple limit is $10 below the rule; the + parameter keeps the published amount (an intended exception). +5. Bounds (Hypothesis): the amount per recipient is positive and below + Medicare spending per enrollee, and the limits never fall, in every year + from 2015 to 2100. + +Households (a seeded sample in one shared simulation, each household also +run with more Social Security, more interest and more assets): + +6. Countable income equals the rule restated here: the couple's SSI + income without interest and dividends, less $20 a month from unearned + income (the rest from earnings), $65 a month of earnings and half the + remaining earnings. +7. Interest and dividends never change countable income or eligibility. +8. More Social Security never lowers countable income or makes an income + ineligible person income eligible; more assets never make a resource + ineligible person resource eligible. +9. Eligibility equals the restated rule, and the benefit is either zero or + the year's amount per recipient, positive exactly for enrollees, who + are all eligible. +10. Spouses get the same countable income, family size and test results. +11. Differential: for people without interest or dividends, countable income + equals 12 times ``msp_countable_income``, which applies the same SSI + exclusions through a separate formula (single people, and couples where + both spouses are Medicare eligible). +""" + +import numpy as np +import pytest +from hypothesis import given +from hypothesis import strategies as st + +from policyengine_us import Simulation +from policyengine_us.system import system + +P = system.parameters +PER_RECIPIENT = "calibration.gov.hhs.medicare.part_d.low_income_subsidy_per_recipient" +LIS = P.gov.hhs.medicare.part_d.low_income_subsidy + +# 2026 Medicare Trustees Report (sha256 ffa56b91...8fa8), Table IV.B9 (file +# page 158): low-income subsidy enrollment (millions) and subsidy amount ($). +# 2015 from the 2025 report (sha256 1b3de7a4...4d95), Table IV.B9 (page 158). +IV_B9 = { + 2015: (12.1, 2_112), + 2016: (12.4, 2_126), + 2017: (12.7, 2_156), + 2018: (12.9, 2_204), + 2019: (13.1, 2_273), + 2020: (13.1, 2_507), + 2021: (13.2, 2_646), + 2022: (13.7, 2_873), + 2023: (14.3, 3_092), + 2024: (14.5, 2_833), + 2025: (14.2, 1_226), + 2026: (14.4, 1_254), + 2027: (14.8, 1_384), + 2028: (15.2, 1_459), + 2029: (15.5, 1_579), + 2030: (15.8, 1_833), + 2031: (16.0, 1_922), + 2032: (16.2, 1_956), + 2033: (16.4, 1_982), + 2034: (16.6, 2_014), + 2035: (16.7, 2_076), +} +# Table IV.B10 (file page 159), low-income subsidy, $ billions, incurred; +# 2015 from the 2025 report's Table IV.B10 (page 159). +IV_B10 = { + **{2015: 25.6, 2016: 26.4, 2017: 27.3, 2018: 28.5, 2019: 29.7, 2020: 33.0}, + **{2021: 35.0, 2022: 39.4, 2023: 44.2, 2024: 41.2, 2025: 17.4, 2026: 18.1}, + **{2027: 20.5, 2028: 22.1, 2029: 24.5, 2030: 28.9, 2031: 30.7, 2032: 31.7}, + **{2033: 32.4, 2034: 33.3, 2035: 34.8}, +} +# Table V.B3 (file page 196), total enrollment (HI and/or SMI), thousands. +V_B3_TOTAL = dict( + zip( + range(2015, 2036), + (55_589, 57_073, 58_683, 60_020, 61_535, 62_887, 63_980, 65_166) + + (66_606, 68_066, 69_289, 70_743, 72_322, 74_026, 75_436, 76_598) + + (77_521, 78_327, 79_058, 79_827, 80_632), + ) +) +# BLS CPI-U, U.S. city average, all items, not seasonally adjusted +# (CUUR0000SA0), September of each year, retrieved 2026-10-11 from the BLS +# public API. (pe-us's gov.bls.cpi.cpi_u holds seasonally adjusted values +# from 2024, so it is not used here.) +CPI_U_SEPTEMBER = { + **{2004: 189.9, 2005: 198.8, 2006: 202.9, 2007: 208.490, 2008: 218.783}, + **{2009: 215.969, 2010: 218.439, 2011: 226.889, 2012: 231.407}, + **{2013: 234.149, 2014: 238.031, 2015: 237.945, 2016: 241.428}, + **{2017: 246.819, 2018: 252.439, 2019: 256.759, 2020: 260.280}, + **{2021: 274.310, 2022: 296.808, 2023: 307.789, 2024: 315.301}, + **{2025: 324.800}, +} +STATUTE_2006 = {"individual": 10_000, "couple": 20_000} +PUBLISHED_EXCEPTIONS = {("couple", 2015): 24_250} # the rule gives 24,260 + + +def _per_recipient(year): + return P.calibration.gov.hhs.medicare.part_d.low_income_subsidy_per_recipient( + f"{year}-01-01" + ) + + +@pytest.mark.parametrize("year", sorted(IV_B9)) +def test_per_recipient_transcribes_table_iv_b9(year): + assert _per_recipient(year) == IV_B9[year][1] + + +@pytest.mark.parametrize("year", sorted(IV_B9)) +def test_enrollment_times_amount_returns_table_iv_b10(year): + enrollment, amount = IV_B9[year] + rebuilt = enrollment * 1e6 * _per_recipient(year) / 1e9 + # Rounding: total to $0.05B, enrollment to 0.05M x amount, amount to $0.5. + tolerance = 0.05 + 0.05e6 * amount / 1e9 + 0.5 * enrollment * 1e6 / 1e9 + assert abs(rebuilt - IV_B10[year]) <= tolerance + + +@pytest.mark.parametrize("year", sorted(IV_B9)) +def test_recipients_times_amount_matches_per_enrollee_series(year): + per_enrollee = ( + P.calibration.gov.hhs.medicare.part_d_low_income_subsidy_per_enrollee( + f"{year}-01-01" + ) + ) + enrollment, _ = IV_B9[year] + rebuilt = enrollment * 1e6 * _per_recipient(year) / (V_B3_TOTAL[year] * 1e3) + # Enrollment rounded to 0.1 million is at worst 0.42% off (2015, 12.1). + assert rebuilt == pytest.approx(per_enrollee, rel=0.005) + + +def _round_to_10(x): + return int(np.floor(x / 10 + 0.5)) * 10 + + +@pytest.mark.parametrize("kind", ["individual", "couple"]) +def test_resource_limits_follow_the_cpi_rule(kind): + limit = getattr(LIS.eligibility.resources.limit, kind) + assert limit("2006-01-01") == STATUTE_2006[kind] + for year in range(2007, 2027): + growth = CPI_U_SEPTEMBER[year - 1] / CPI_U_SEPTEMBER[year - 2] + expected = _round_to_10(limit(f"{year - 1}-01-01") * max(growth, 1)) + expected = PUBLISHED_EXCEPTIONS.get((kind, year), expected) + assert limit(f"{year}-01-01") == expected, year + + +@given(st.integers(2015, 2100)) +def test_amount_positive_and_below_spending(year): + amount = _per_recipient(year) + spending = P.calibration.gov.hhs.medicare.per_capita_cost(f"{year}-01-01") + assert 0 < amount < spending + + +@given(st.integers(2007, 2100)) +def test_resource_limits_never_fall(year): + for kind in ["individual", "couple"]: + limit = getattr(LIS.eligibility.resources.limit, kind) + assert limit(f"{year}-01-01") >= limit(f"{year - 1}-01-01") + + +# Households. +YEAR = 2026 +N = 300 +SEED = 20261011 +STATES = ["TX", "CA", "NY", "AK", "HI", "FL", "PR", "DC"] +VARIANTS = ["base", "more_ss", "more_interest", "more_assets"] + + +def _households(): + rng = np.random.default_rng(SEED) + out = [] + for _ in range(N): + married = bool(rng.random() < 0.5) + + def person(): + return dict( + social_security=int(rng.choice([0, 6_000, 12_000, 18_000, 26_000])), + employment_income=int(rng.choice([0, 0, 0, 4_000, 15_000])), + interest_income=int(rng.choice([0, 0, 300, 4_000])), + dividend_income=int(rng.choice([0, 0, 1_000])), + bank_account_assets=int(rng.choice([0, 3_000, 9_000, 16_000, 40_000])), + stock_assets=int(rng.choice([0, 0, 5_000])), + medicare_enrolled=bool(rng.random() < 0.9), + medicaid_enrolled=bool(rng.random() < 0.15), + ssi=int(rng.choice([0, 0, 0, 0, 2_400])), + msp_eligible=bool(rng.random() < 0.15), + takes_up_part_d_lis_if_eligible=bool(rng.random() < 0.7), + ) + + out.append( + dict( + state=str(rng.choice(STATES)), + dependents=int(rng.choice([0, 0, 0, 1, 2])), + members=[person()] + ([person()] if married else []), + ) + ) + return out + + +HOUSEHOLDS = _households() + + +def _variant(member, variant, is_head): + member = dict(member) + if is_head and variant == "more_ss": + member["social_security"] += 3_000 + if is_head and variant == "more_interest": + member["interest_income"] += 5_000 + member["dividend_income"] += 2_000 + if is_head and variant == "more_assets": + member["bank_account_assets"] += 5_000 + return member + + +def _situation(households, variants, inputs=True): + people, marital_units, tax_units, spm_units, units = {}, {}, {}, {}, {} + rows = [] # (household index, variant, member index, person name) + for v in variants: + for i, h in enumerate(households): + names = [] + for j, member in enumerate(h["members"]): + name = f"{v}_{i}_{j}" + record = _variant(member, v, j == 0) + if not inputs: + record = { + k: record[k] + for k in ( + "social_security", + "employment_income", + "interest_income", + "dividend_income", + ) + } + people[name] = { + "age": {YEAR: 70}, + **{k: {YEAR: val} for k, val in record.items()}, + } + names.append(name) + rows.append((i, v, j, name)) + spouses = list(names) + dependents = [] + for k in range(h["dependents"]): + name = f"{v}_{i}_d{k}" + people[name] = { + "age": {YEAR: 10}, + "is_tax_unit_dependent": {YEAR: True}, + } + marital_units[f"mu_{name}"] = {"members": [name]} + dependents.append(name) + marital_units[f"mu_{v}_{i}"] = {"members": spouses} + members = spouses + dependents + tax_units[f"tu_{v}_{i}"] = {"members": members} + spm_units[f"spm_{v}_{i}"] = {"members": members} + units[f"hh_{v}_{i}"] = { + "members": members, + "state_code": {YEAR: h["state"]}, + } + situation = { + "people": people, + "marital_units": marital_units, + "tax_units": tax_units, + "spm_units": spm_units, + "households": units, + } + return situation, rows + + +@pytest.fixture(scope="module") +def sample(): + situation, rows = _situation(HOUSEHOLDS, VARIANTS) + sim = Simulation(situation=situation) + names = list(situation["people"]) + index = {name: k for k, name in enumerate(names)} + variables = [ + "part_d_lis", + "part_d_lis_enrolled", + "part_d_lis_eligible", + "part_d_lis_deemed_eligible", + "part_d_lis_income_eligible", + "part_d_lis_resource_eligible", + "part_d_lis_countable_income", + "part_d_lis_family_size", + ] + values = {v: sim.calculate(v, YEAR) for v in variables} + return rows, index, values + + +def _restated_countable(members): + earned = sum(m["employment_income"] for m in members) / 12 + unearned = sum(m["social_security"] for m in members) / 12 + general = min(20, unearned) + countable_unearned = unearned - general + countable_earned = max(earned - 65 - (20 - general), 0) / 2 + return 12 * (countable_unearned + countable_earned) + + +def _fpg(state, size): + fpg = P.gov.hhs.fpg(f"{YEAR}-01-01") + group = state if state in ("AK", "HI", "PR") else "CONTIGUOUS_US" + return fpg.first_person[group] + fpg.additional_person[group] * (size - 1) + + +def _value(values, index, variable, name): + return values[variable][index[name]] + + +def test_countable_income_matches_restated_rule(sample): + rows, index, values = sample + for i, v, _, name in rows: + members = [ + _variant(m, v, j == 0) for j, m in enumerate(HOUSEHOLDS[i]["members"]) + ] + expected = _restated_countable(members) + actual = _value(values, index, "part_d_lis_countable_income", name) + assert actual == pytest.approx(expected, abs=0.01), (i, v) + + +def test_interest_and_dividends_change_nothing(sample): + rows, index, values = sample + for i, v, j, name in rows: + if v != "more_interest": + continue + base = f"base_{i}_{j}" + for variable in [ + "part_d_lis_countable_income", + "part_d_lis_income_eligible", + "part_d_lis_eligible", + "part_d_lis", + ]: + assert _value(values, index, variable, name) == _value( + values, index, variable, base + ), (i, variable) + + +def test_more_income_or_assets_never_helps(sample): + rows, index, values = sample + for i, v, j, name in rows: + base = f"base_{i}_{j}" + if v == "more_ss": + assert _value(values, index, "part_d_lis_countable_income", name) >= ( + _value(values, index, "part_d_lis_countable_income", base) + ) + if _value(values, index, "part_d_lis_income_eligible", name): + assert _value(values, index, "part_d_lis_income_eligible", base), i + if v == "more_assets": + if _value(values, index, "part_d_lis_resource_eligible", name): + assert _value(values, index, "part_d_lis_resource_eligible", base), i + + +def test_eligibility_and_benefit_match_restated_rules(sample): + rows, index, values = sample + amount = _per_recipient(YEAR) + excluded = list(LIS.eligibility.ineligible_jurisdictions(f"{YEAR}-01-01")) + limits = LIS.eligibility.resources(f"{YEAR}-01-01") + for i, v, j, name in rows: + h = HOUSEHOLDS[i] + members = [_variant(m, v, k == 0) for k, m in enumerate(h["members"])] + me = members[j] + couple = len(members) + size = couple + h["dependents"] + assert _value(values, index, "part_d_lis_family_size", name) == size + income_ok = _restated_countable(members) < 1.5 * _fpg(h["state"], size) + resources = sum(m["bank_account_assets"] + m["stock_assets"] for m in members) + limit = limits.limit.couple if couple == 2 else limits.limit.individual + resource_ok = resources <= limit + limits.burial_exclusion * couple + deemed = me["medicaid_enrolled"] or me["ssi"] > 0 or me["msp_eligible"] + eligible = ( + me["medicare_enrolled"] + and h["state"] not in excluded + and (deemed or (income_ok and resource_ok)) + ) + automatic = me["medicaid_enrolled"] or me["ssi"] > 0 + enrolled = eligible and (automatic or me["takes_up_part_d_lis_if_eligible"]) + assert _value(values, index, "part_d_lis_income_eligible", name) == income_ok + assert _value(values, index, "part_d_lis_resource_eligible", name) == ( + resource_ok + ) + assert _value(values, index, "part_d_lis_eligible", name) == eligible, i + assert _value(values, index, "part_d_lis_enrolled", name) == enrolled, i + benefit = _value(values, index, "part_d_lis", name) + assert benefit == (amount if enrolled else 0), i + + +def test_spouses_agree(sample): + rows, index, values = sample + for i, v, j, name in rows: + if j != 1: + continue + head = f"{v}_{i}_0" + for variable in [ + "part_d_lis_countable_income", + "part_d_lis_family_size", + "part_d_lis_income_eligible", + "part_d_lis_resource_eligible", + ]: + assert _value(values, index, variable, name) == _value( + values, index, variable, head + ), (i, variable) + + +def test_countable_income_matches_msp_countable_income(): + # No interest or dividends, everyone 70 and so Medicare eligible: the + # MSP formula then counts the same income the same way, through its + # couple branch for married couples and its personal branch otherwise. + households = [ + { + **h, + "members": [ + {**m, "interest_income": 0, "dividend_income": 0} for m in h["members"] + ], + } + for h in HOUSEHOLDS + ] + situation, rows = _situation(households, ["base"], inputs=False) + sim = Simulation(situation=situation) + names = list(situation["people"]) + lis = sim.calculate("part_d_lis_countable_income", YEAR) + msp = sim.calculate("msp_countable_income", f"{YEAR}-01") + medicare_eligible = sim.calculate("is_medicare_eligible", YEAR) + adults = np.array([not name.split("_")[-1].startswith("d") for name in names]) + assert medicare_eligible[adults].all() + np.testing.assert_allclose(lis[adults], 12 * msp[adults], atol=0.01) diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/integration.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/integration.yaml new file mode 100644 index 00000000000..a424e9ad85a --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/integration.yaml @@ -0,0 +1,187 @@ +# Households computed from their inputs, through the Medicare Savings +# Program and the subsidy's own income and resource tests. 2026 guidelines: +# $15,960 for one person and $21,640 for two (contiguous states); the +# subsidy limit is 150% of them: $23,940 and $32,460. Medicare Savings +# Program QI limit: 135%, $21,546 for one person and $29,214 for two. + +- name: Single retiree deemed eligible through a Medicare Savings Program. + period: 2026 + input: + people: + person: + age: 70 + social_security: 20_000 + bank_account_assets: 5_000 + households: + household: + members: [person] + state_code: TX + output: + # Medicare Savings Program countable income (20,000 / 12 - 20) x 12 = + # 19,760 is above the SLMB limit (120%, 19,152) and below the QI limit, + # with resources under the $9,950 limit. + msp_eligible: true + part_d_lis_deemed_eligible: true + part_d_lis_countable_income: 19_760 + part_d_lis_income_eligible: true + part_d_lis_resource_eligible: true + part_d_lis_eligible: true + part_d_lis_enrolled: true + part_d_lis: 1_254 + +- name: Interest is excluded for the subsidy but not for the Medicare Savings Program. + period: 2026 + input: + people: + person: + age: 70 + social_security: 20_000 + interest_income: 5_000 + bank_account_assets: 15_000 + households: + household: + members: [person] + state_code: TX + output: + # Medicare Savings Program countable income (25,000 / 12 - 20) x 12 = + # 24,760 is over the QI limit, and $15,000 is over its $9,950 resource + # limit. The subsidy excludes interest: 19,760 < 23,940, and $15,000 <= + # 16,590 + 1,500. + msp_eligible: false + part_d_lis_deemed_eligible: false + part_d_lis_countable_income: 19_760 + part_d_lis_eligible: true + part_d_lis: 1_254 + +- name: Single retiree with resources over the limit is not eligible. + period: 2026 + input: + people: + person: + age: 68 + social_security: 22_000 + bank_account_assets: 50_000 + households: + household: + members: [person] + state_code: TX + output: + # Countable income (22,000 / 12 - 20) x 12 = 21,760 is under 23,940, but + # $50,000 is over $18,090. + part_d_lis_income_eligible: true + part_d_lis_resource_eligible: false + part_d_lis_deemed_eligible: false + part_d_lis_eligible: false + part_d_lis: 0 + +- name: Married couple eligible through the income and resource tests. + period: 2026 + input: + people: + spouse1: + age: 70 + social_security: 18_000 + bank_account_assets: 20_000 + spouse2: + age: 70 + social_security: 12_000 + bank_account_assets: 10_000 + marital_units: + marital_unit: + members: [spouse1, spouse2] + tax_units: + tax_unit: + members: [spouse1, spouse2] + spm_units: + spm_unit: + members: [spouse1, spouse2] + households: + household: + members: [spouse1, spouse2] + state_code: TX + output: + # Combined countable income (30,000 / 12 - 20) x 12 = 29,760 is over the + # couple QI limit (29,214) but under 32,460; combined resources $30,000 + # are under 33,100 + 3,000 = 36,100. + msp_eligible: [false, false] + part_d_lis_family_size: [2, 2] + part_d_lis_countable_income: [29_760, 29_760] + part_d_lis_income_eligible: [true, true] + part_d_lis_resource_eligible: [true, true] + part_d_lis_eligible: [true, true] + part_d_lis: [1_254, 1_254] + +- name: Not taking it up leaves an applicant-path eligible person without it. + period: 2026 + input: + people: + person: + age: 70 + social_security: 20_000 + interest_income: 5_000 + bank_account_assets: 15_000 + takes_up_part_d_lis_if_eligible: false + households: + household: + members: [person] + state_code: TX + output: + part_d_lis_eligible: true + part_d_lis_enrolled: false + part_d_lis: 0 + +- name: 2023, a person in the former partial-subsidy range gets the average. + period: 2023 + input: + people: + person: + age: 70 + social_security: 20_500 + bank_account_assets: 12_000 + households: + household: + members: [person] + state_code: TX + output: + # Countable income (20,500 / 12 - 20) x 12 = 20,260: above 135% (19,683) + # and below 150% (21,870) of the 2023 guideline ($14,580). Resources + # $12,000 are above the 2023 full-subsidy limit (9,090 + 1,500 = 10,590) + # and within the partial limit (15,160 + 1,500 = 16,660). + part_d_lis_countable_income: 20_260 + part_d_lis_eligible: true + part_d_lis: 3_092 + +- name: Under-65 Medicare enrollee with a disability on SSI. + period: 2026 + input: + people: + person: + age: 50 + is_disabled: true + medicare_enrolled: true + ssi: 6_000 + bank_account_assets: 1_000 + households: + household: + members: [person] + state_code: TX + output: + part_d_lis_deemed_eligible: true + part_d_lis_enrolled: true + part_d_lis: 1_254 + +- name: Person aged 70 not enrolled in Medicare gets nothing. + period: 2026 + input: + people: + person: + age: 70 + medicare_enrolled: false + social_security: 10_000 + households: + household: + members: [person] + state_code: TX + output: + part_d_lis_eligible: false + part_d_lis: 0 diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis.yaml new file mode 100644 index 00000000000..6b00b321bd7 --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis.yaml @@ -0,0 +1,60 @@ +# Each enrollee gets the Trustees' average subsidy per low-income subsidy +# enrollee (2026 report, Table IV.B9; 2015 from the 2025 report). + +- name: Enrollee in 2026. + period: 2026 + input: + people: + person: + part_d_lis_enrolled: true + output: + part_d_lis: 1_254 + +- name: Enrollee in 2015. + period: 2015 + input: + people: + person: + part_d_lis_enrolled: true + output: + part_d_lis: 2_112 + +- name: Enrollee in 2024, before the Inflation Reduction Act redesign. + period: 2024 + input: + people: + person: + part_d_lis_enrolled: true + output: + part_d_lis: 2_833 + +- name: Enrollee in 2035, the last Trustees year. + period: 2035 + input: + people: + person: + part_d_lis_enrolled: true + output: + part_d_lis: 2_076 + +- name: Not enrolled. + period: 2026 + input: + people: + person: + part_d_lis_enrolled: false + output: + part_d_lis: 0 + +- name: Two enrollees in one household get the same average. + period: 2026 + input: + people: + spouse1: + part_d_lis_enrolled: true + spouse2: + part_d_lis_enrolled: true + child: + part_d_lis_enrolled: false + output: + part_d_lis: [1_254, 1_254, 0] diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_deemed_eligible.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_deemed_eligible.yaml new file mode 100644 index 00000000000..9f76a8f12ab --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_deemed_eligible.yaml @@ -0,0 +1,47 @@ +# Full-benefit dual eligibles, SSI recipients and Medicare Savings Program +# enrollees are treated as eligible for the full subsidy (42 CFR +# 423.773(c)(1)). + +- name: Medicaid enrollee is deemed eligible. + period: 2026 + input: + people: + person: + medicaid_enrolled: true + ssi: 0 + msp_eligible: false + output: + part_d_lis_deemed_eligible: true + +- name: SSI recipient is deemed eligible. + period: 2026 + input: + people: + person: + medicaid_enrolled: false + ssi: 1_200 + msp_eligible: false + output: + part_d_lis_deemed_eligible: true + +- name: Medicare Savings Program eligible person is deemed eligible. + period: 2026 + input: + people: + person: + medicaid_enrolled: false + ssi: 0 + msp_eligible: true + output: + part_d_lis_deemed_eligible: true + +- name: None of the three is not deemed eligible. + period: 2026 + input: + people: + person: + medicaid_enrolled: false + ssi: 0 + msp_eligible: false + output: + part_d_lis_deemed_eligible: false diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_eligible.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_eligible.yaml new file mode 100644 index 00000000000..aa46e6d9793 --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_eligible.yaml @@ -0,0 +1,82 @@ +# Eligible: a Medicare enrollee in the 50 states or DC who is deemed eligible +# or meets both the income and resource tests (42 U.S.C. 1395w-114(a)(3)). + +- name: Meets the income and resource tests. + period: 2026 + input: + people: + person: + medicare_enrolled: true + part_d_lis_deemed_eligible: false + part_d_lis_income_eligible: true + part_d_lis_resource_eligible: true + output: + part_d_lis_eligible: true + +- name: Income eligible but resources over the limit. + period: 2026 + input: + people: + person: + medicare_enrolled: true + part_d_lis_deemed_eligible: false + part_d_lis_income_eligible: true + part_d_lis_resource_eligible: false + output: + part_d_lis_eligible: false + +- name: Deemed eligible with income and resources over the limits. + period: 2026 + input: + people: + person: + medicare_enrolled: true + part_d_lis_deemed_eligible: true + part_d_lis_income_eligible: false + part_d_lis_resource_eligible: false + output: + part_d_lis_eligible: true + +- name: Not enrolled in Medicare. + period: 2026 + input: + people: + person: + medicare_enrolled: false + part_d_lis_deemed_eligible: true + part_d_lis_income_eligible: true + part_d_lis_resource_eligible: true + output: + part_d_lis_eligible: false + +- name: Puerto Rico residents are not eligible. + period: 2026 + input: + people: + person: + medicare_enrolled: true + part_d_lis_deemed_eligible: true + part_d_lis_income_eligible: true + part_d_lis_resource_eligible: true + households: + household: + members: [person] + state_code: PR + output: + part_d_lis_eligible: false + +- name: District of Columbia residents are eligible. + period: 2026 + input: + people: + person: + medicare_enrolled: true + part_d_lis_deemed_eligible: false + part_d_lis_income_eligible: true + part_d_lis_resource_eligible: true + households: + household: + members: [person] + state_code: DC + output: + part_d_lis_eligible: true diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.yaml new file mode 100644 index 00000000000..e86f88cc3d6 --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.yaml @@ -0,0 +1,61 @@ +# Medicaid enrollees and SSI recipients are enrolled without an application; +# other eligible people are enrolled if they take up the subsidy. + +- name: Medicaid enrollee who would not apply is enrolled anyway. + period: 2026 + input: + people: + person: + part_d_lis_eligible: true + medicaid_enrolled: true + ssi: 0 + takes_up_part_d_lis_if_eligible: false + output: + part_d_lis_enrolled: true + +- name: SSI recipient who would not apply is enrolled anyway. + period: 2026 + input: + people: + person: + part_d_lis_eligible: true + medicaid_enrolled: false + ssi: 1_200 + takes_up_part_d_lis_if_eligible: false + output: + part_d_lis_enrolled: true + +- name: Other eligible person who does not take it up. + period: 2026 + input: + people: + person: + part_d_lis_eligible: true + medicaid_enrolled: false + ssi: 0 + takes_up_part_d_lis_if_eligible: false + output: + part_d_lis_enrolled: false + +- name: Other eligible person who takes it up. + period: 2026 + input: + people: + person: + part_d_lis_eligible: true + medicaid_enrolled: false + ssi: 0 + takes_up_part_d_lis_if_eligible: true + output: + part_d_lis_enrolled: true + +- name: Medicaid enrollee who is not eligible (not in Medicare) is not enrolled. + period: 2026 + input: + people: + person: + part_d_lis_eligible: false + medicaid_enrolled: true + ssi: 0 + output: + part_d_lis_enrolled: false diff --git a/policyengine_us/tests/policy/baseline/household/income/household/cbo_household_income.yaml b/policyengine_us/tests/policy/baseline/household/income/household/cbo_household_income.yaml index d52fdf17f34..19c6830df95 100644 --- a/policyengine_us/tests/policy/baseline/household/income/household/cbo_household_income.yaml +++ b/policyengine_us/tests/policy/baseline/household/income/household/cbo_household_income.yaml @@ -59,6 +59,8 @@ reduced_price_school_meals: 1 spm_unit_energy_subsidy: 9 general_assistance: 6 + part_d_lis: 11 + msp: 100 wic: 100 head_start: 100 early_head_start: 100 @@ -66,7 +68,9 @@ household_state_benefits: 100 household_health_benefits: 100 output: - cbo_household_means_tested_transfers: 55 + # The Medicare Part D low-income subsidy counts; Medicare Savings + # Programs do not. + cbo_household_means_tested_transfers: 66 - name: CBO after-tax income uses federal taxes only and keeps negative income tax period: 2025 @@ -95,3 +99,30 @@ cbo_household_means_tested_transfers: 11_000 cbo_household_federal_taxes: 3_252 cbo_household_income_after_transfers_and_taxes: 45_085 + +- name: CBO income after transfers adds the Part D low-income subsidy + period: 2026 + input: + age: 70 + medicare_enrolled: true + social_security: 20_000 + interest_income: 5_000 + bank_account_assets: 15_000 + state_code: TX + medicaid: 0 + chip: 0 + snap: 0 + housing_assistance: 0 + ssi: 0 + tanf: 0 + free_school_meals: 0 + reduced_price_school_meals: 0 + spm_unit_energy_subsidy: 0 + general_assistance: 0 + output: + # Eligible through the subsidy's own tests (countable income 19,760 < + # 23,940, resources 15,000 <= 18,090), valued at the 2026 Trustees + # average of $1,254 per subsidy enrollee, the only means-tested + # transfer here. + part_d_lis: 1_254 + cbo_household_means_tested_transfers: 1_254 From 9a04c2025dfca20c25afa68a56f28cdc73727ce4 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 11 Oct 2026 17:33:50 -0400 Subject: [PATCH 10/35] Note CBO's institutional adjustment beside the Part D low-income subsidy average Co-Authored-By: Claude Opus 5.5 --- .../medicare/part_d/low_income_subsidy_per_recipient.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/low_income_subsidy_per_recipient.yaml b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/low_income_subsidy_per_recipient.yaml index a5732d624e8..5e9211e701e 100644 --- a/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/low_income_subsidy_per_recipient.yaml +++ b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/low_income_subsidy_per_recipient.yaml @@ -18,10 +18,18 @@ metadata: # ffa56b9137006872300b0346149eae1613d09a172b6ba118aad48e66dfc48fa8; 2025 # report sha256 # 1b3de7a4faeee5ad42059e10740603182b716a5fa7b53b30d360b45b9e474d95. + # The average includes enrollees in institutions, whom CBO removes along + # with their benefits (Habib 2018, file page 52). CBO's adjusted 2015 + # totals, $22.6 billion for 10.7 million recipients (file page 51), give + # $2,112 per recipient, the same as this table's 2015 average; for 2016 + # CBO's $26.5 billion (from its own baseline) for 11.1 million gives + # $2,387 against $2,126 here. - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table IV.B9 href: https://www.cms.gov/oact/tr/2026#page=158 - title: 2025 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table IV.B9 href: https://www.cms.gov/oact/tr/2025#page=158 + - title: Habib, How CBO Adjusts for Survey Underreporting of Transfer Income in Its Distributional Analyses, CBO Working Paper 2018-07, Appendix C + href: https://www.cbo.gov/system/files/2018-07/54234-workingpaper.pdf#page=51 values: # Historical. 2015-01-01: 2_112 From 1d7e9f97f5fbd21336c9702b5f4793ac00376dd4 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 00:01:41 +0000 Subject: [PATCH 11/35] Subtract the person's Part D IRMAA from medicare_cost in full #10115 made income_adjusted_part_d_premium_surcharge zero for anyone not enrolled in Part D (medicare_part_d_enrolled). Multiplying it by the Part D enrollment share then counted non-enrollment twice once take-up is modeled, and charged an enrolled person only 82 percent of the adjustment they pay. The share now scales only the average Part D premium, which matches spending per enrollee averaged over every Medicare enrollee; the person's own adjustment amount is subtracted as computed, as the Part B one is. Co-Authored-By: Claude Opus 5.5 --- .../medicare-cost-part-d-premiums.fixed.md | 2 +- .../core/test_medicare_cost_part_d_premium.py | 35 ++++++++++----- .../gov/hhs/medicare/costs/medicare_cost.yaml | 44 ++++++++++++++----- .../gov/hhs/medicare/costs/medicare_cost.py | 27 ++++++++---- 4 files changed, 76 insertions(+), 32 deletions(-) diff --git a/changelog.d/medicare-cost-part-d-premiums.fixed.md b/changelog.d/medicare-cost-part-d-premiums.fixed.md index b7989573aaa..958f4bf71d5 100644 --- a/changelog.d/medicare-cost-part-d-premiums.fixed.md +++ b/changelog.d/medicare-cost-part-d-premiums.fixed.md @@ -1 +1 @@ -Subtract the expected Medicare Part D premium, the Part D enrollment share times Part D premiums per Part D enrollee plus the person's Part D IRMAA, from `medicare_cost`, whose CMS spending per enrollee includes Part D. +Subtract Medicare Part D premiums from `medicare_cost`, whose CMS spending per enrollee includes Part D: the average Part D premium per Medicare enrollee from the 2026 Medicare Trustees Report, plus the person's own Part D income-related monthly adjustment amount. diff --git a/policyengine_us/tests/core/test_medicare_cost_part_d_premium.py b/policyengine_us/tests/core/test_medicare_cost_part_d_premium.py index a9dc443b21d..527a3e85644 100644 --- a/policyengine_us/tests/core/test_medicare_cost_part_d_premium.py +++ b/policyengine_us/tests/core/test_medicare_cost_part_d_premium.py @@ -1,14 +1,18 @@ -"""The expected Part D premium that ``medicare_cost`` subtracts. +"""The Part D premium that ``medicare_cost`` subtracts. CMS Medicare spending per enrollee (``calibration.gov.hhs.medicare. -per_capita_cost``) covers Parts A through D, gross of the premiums that -finance it. No variable records Part D enrollment, so ``medicare_cost`` -subtracts an expected Part D premium: +per_capita_cost``) covers Parts A through D, averaged over every Medicare +enrollee, gross of the premiums that finance it. ``medicare_cost`` subtracts +the Part D premium averaged the same way, plus the person's own +income-related monthly adjustment amount (IRMAA): - enrollment_share x (premiums_per_enrollee + Part D IRMAA) + enrollment_share x premiums_per_enrollee + Part D IRMAA -from two series under ``calibration.gov.hhs.medicare.part_d``, both from the -2026 Medicare Trustees Report: +The IRMAA is subtracted in full: ``income_adjusted_part_d_premium_surcharge`` +is already zero for anyone not enrolled in Part D, so scaling it by the share +would count non-enrollment twice. The two series are under +``calibration.gov.hhs.medicare.part_d``, both from the 2026 Medicare Trustees +Report: - ``premiums_per_enrollee``: Table III.D3 premium income (footnote 6's December 31 credits moved back a year) less Table V.E4's aggregate @@ -34,10 +38,12 @@ 5. Calendar years: every date in a year reads the January 1 value; between the Trustees' five-year enrollment points the share holds the earlier one. 6. Consumer (Hypothesis, differential): ``medicare_cost`` equals a reference - implementation, max(gross - Part A - Part B - share x (premium + IRMAA), - 0), for any year and premiums; it lies in [0, ``medicare_gross_cost``], - which does not change with the Part D premium; and it does not rise with - the person's Part D IRMAA. + implementation, max(gross - Part A - Part B - share x premium - IRMAA, 0), + for any year and premiums; it lies in [0, ``medicare_gross_cost``], which + does not change with the Part D premium. +7. Accounting (Hypothesis): the person's Part D IRMAA lowers + ``medicare_cost`` dollar for dollar until the zero floor, as it raises + what the person pays; the enrollment share does not scale it. """ import pytest @@ -227,7 +233,7 @@ def _enrollee(year, part_a, part_b, irmaa): def _reference_medicare_cost(year, part_a, part_b, irmaa): gross = _read("calibration.gov.hhs.medicare.per_capita_cost", f"{year}-01-01") - part_d = _share(year) * (_premium(year) + irmaa) + part_d = _share(year) * _premium(year) + irmaa return max(gross - part_a - part_b - part_d, 0) @@ -259,3 +265,8 @@ def test_medicare_cost_matches_reference_and_bounds( # The gross cost subtracts no premium, so both people have the same one. assert gross[0] == gross[1] assert net[1] <= net[0] + # Accounting: above the zero floor, more IRMAA lowers the value dollar for + # dollar, so the enrollment share does not scale it. Float32 values near + # the 2100 spending level carry about 0.1 of rounding. + if net[1] > 0: + assert net[0] - net[1] == pytest.approx(high - low, abs=0.02 + 1e-6 * gross[0]) diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/medicare_cost.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/medicare_cost.yaml index 504cd704414..52d793f2cd9 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/medicare_cost.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/medicare_cost.yaml @@ -1,6 +1,7 @@ -# The expected Part D premium is the Part D enrollment share times (Part D -# premiums per Part D enrollee + the person's Part D IRMAA). 2025: 0.8191 x -# $220.25 = $180.41 without IRMAA. +# The Part D premium is the average per Medicare enrollee, the Part D +# enrollment share times Part D premiums per Part D enrollee (2025: 0.8191 x +# $220.25 = $180.41), plus the person's own Part D IRMAA. Sources: 2026 +# Medicare Trustees Report, Tables III.D3, V.B3 and V.E4. - name: unit test 1 - enrolled, premium-free Part A period: 2025 @@ -45,9 +46,9 @@ 2023: 0 filing_status: SINGLE output: - # $17,751 - $7,546.80 Part B with IRMAA - 0.8191 x ($220.25 + $85.80 x 12 - # Part D IRMAA) = $1,023.75 Part D (2025) - medicare_cost: 9_180.45 + # $17,751 - $7,546.80 Part B with IRMAA - $180.41 Part D - $85.80 x 12 + # = $1,029.60 Part D IRMAA (2025) + medicare_cost: 8_994.19 - name: unit test 4 - eligible but not enrolled period: 2025 @@ -100,8 +101,8 @@ gross_medicare_part_b_premium: 2_220 output: income_adjusted_part_d_premium_surcharge: 423.6 - # $17,751 - $2,220 Part B - 0.8191 x ($220.25 + $423.60) = $527.38 Part D - medicare_cost: 15_003.62 + # $17,751 - $2,220 Part B - $180.41 Part D - $423.60 Part D IRMAA + medicare_cost: 14_926.99 - name: unit test 8 - projected year period: 2027 @@ -126,8 +127,9 @@ gross_medicare_part_b_premium: 3_000 income_adjusted_part_d_premium_surcharge: 1_000 output: - # $23,789 - $3,000 Part B - 0.8382 x ($637.06 + $1,000) = $1,372.18 Part D - medicare_cost: 19_416.82 + # $23,789 - $3,000 Part B - 0.8382 x $637.06 = $533.98 Part D - $1,000 + # Part D IRMAA (2030) + medicare_cost: 19_255.02 - name: unit test 10 - premiums above spending floor the value at zero period: 2025 @@ -149,3 +151,25 @@ income_adjusted_part_d_premium_surcharge: 1_029.6 output: medicare_gross_cost: 17_751 + +# A Medicare enrollee whose drug coverage is not Part D owes no Part D IRMAA +# (income_adjusted_part_d_premium_surcharge is defined for +# medicare_part_d_enrolled), but still has the average Part D premium +# subtracted, because the spending averages Part D over every enrollee. +- name: unit test 12 - high income, not enrolled in Part D + period: 2025 + absolute_error_margin: 0.01 + input: + age: 65 + is_medicare_eligible: true + medicare_quarters_of_coverage: 40 + takes_up_medicare_part_d_if_eligible: false + adjusted_gross_income: + 2023: 500_000 # IRMAA uses income from 2 years prior + tax_exempt_interest_income: + 2023: 0 + filing_status: SINGLE + output: + income_adjusted_part_d_premium_surcharge: 0 + # $17,751 - $7,546.80 Part B with IRMAA - $180.41 Part D (2025) + medicare_cost: 10_023.79 diff --git a/policyengine_us/variables/gov/hhs/medicare/costs/medicare_cost.py b/policyengine_us/variables/gov/hhs/medicare/costs/medicare_cost.py index d2b7e45b123..ed734b03c9a 100644 --- a/policyengine_us/variables/gov/hhs/medicare/costs/medicare_cost.py +++ b/policyengine_us/variables/gov/hhs/medicare/costs/medicare_cost.py @@ -9,8 +9,10 @@ class medicare_cost(Variable): "Annual value of Medicare benefits received. Calculated as total " "Medicare spending on behalf of the beneficiary, which covers Parts A " "through D, minus the premiums that finance it: the Part A premium, " - "the gross Part B premium and the expected Part D premium. " - "This represents the net benefit value of Medicare coverage." + "the gross Part B premium, the average Part D premium per Medicare " + "enrollee, and the person's own Part D income-related monthly " + "adjustment amount. This represents the net benefit value of " + "Medicare coverage." ) unit = USD definition_period = YEAR @@ -30,15 +32,22 @@ def formula(person, period, parameters): # inflate Medicare's value. part_a_premium = person("base_part_a_premium", period) part_b_premium = person("gross_medicare_part_b_premium_if_enrolled", period) - # The spending includes Part D, which enrollee premiums partly finance. - # No variable records Part D enrollment, so subtract the expected - # Part D premium: the Part D enrollment share times the premium per - # Part D enrollee plus the person's income-related adjustment. + # The spending includes Part D averaged over every Medicare enrollee, + # and enrollee premiums finance part of it. Subtract the Part D + # premium averaged the same way: the Part D enrollment share times + # premiums per Part D enrollee, which exclude the income-related + # monthly adjustment amount. + average_part_d_premium = ( + p.part_d.enrollment_share * p.part_d.premiums_per_enrollee + ) + # The adjustment amount is the person's own, and is zero for anyone + # not enrolled in Part D (medicare_part_d_enrolled), so it is + # subtracted in full: scaling it by the enrollment share would count + # non-enrollment twice. part_d_irmaa = person("income_adjusted_part_d_premium_surcharge", period) - part_d_premium = p.part_d.enrollment_share * ( - p.part_d.premiums_per_enrollee + part_d_irmaa + total_premiums = ( + part_a_premium + part_b_premium + average_part_d_premium + part_d_irmaa ) - total_premiums = part_a_premium + part_b_premium + part_d_premium # Net benefit = spending - premiums return max_(per_capita_spending - total_premiums, 0) From 437e8e59930bf19617915ba6710f9b6aa308817c Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 00:06:43 +0000 Subject: [PATCH 12/35] Cite the 2026 Trustees Report once per file and fix a page cite The Part D series listed the report in several reference entries that differed only by #page=; CLAUDE.md asks for one entry per source with the pages in its title. The 2030 base beneficiary premium reset is on file page 154, not 152, and file page 219 says low-income subsidy enrollees pay substantially reduced premiums, not none. The December 31 credits move to the following year, not back a year. Co-Authored-By: Claude Opus 5.5 --- .../hhs/medicare/part_d/enrollment_share.yaml | 6 +++--- .../medicare/part_d/premiums_per_enrollee.yaml | 17 ++++++----------- .../core/test_medicare_cost_part_d_premium.py | 2 +- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/enrollment_share.yaml b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/enrollment_share.yaml index 6cf55361039..510c5097b88 100644 --- a/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/enrollment_share.yaml +++ b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/enrollment_share.yaml @@ -1,4 +1,4 @@ -description: The Medicare Trustees report and project this share of Medicare enrollees, people with Part A or Part B coverage, who are enrolled in Part D. +description: The Medicare Trustees' reported and projected enrollment gives this share of Medicare enrollees, people with Part A or Part B coverage, who are enrolled in Part D. metadata: unit: /1 period: year @@ -12,8 +12,8 @@ metadata: # until the next. 2026 Medicare Trustees Report, transmitted 2026-06-09, # retrieved 2026-10-11, sha256 # ffa56b9137006872300b0346149eae1613d09a172b6ba118aad48e66dfc48fa8. - - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table V.B3 - href: https://www.cms.gov/oact/tr/2026#page=196 + - title: "2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Tables IV.B7 and V.B3 #page 153,196" + href: https://www.cms.gov/oact/tr/2026#page=153 values: # Historical. 2015-01-01: 0.7517 diff --git a/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/premiums_per_enrollee.yaml b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/premiums_per_enrollee.yaml index 871164280c8..88d0d93b5b5 100644 --- a/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/premiums_per_enrollee.yaml +++ b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/premiums_per_enrollee.yaml @@ -1,4 +1,4 @@ -description: The Medicare Trustees report and project these Part D premiums from enrollees per Part D enrollee, excluding the income-related monthly adjustment amount. +description: The Medicare Trustees' reported and projected Part D premium income and enrollment give these Part D premiums from enrollees per Part D enrollee, excluding the income-related monthly adjustment amount. metadata: unit: currency-USD period: year @@ -15,7 +15,7 @@ metadata: # footnote 6 (file page 117) credits one January's withheld premiums on # December 31 of the year before: about $0.2 billion in 2015, $0.1 billion # in 2020 and an estimated $0.2 billion in 2026. Those amounts are moved - # back to 2016, 2021 and 2027. + # to the following year: 2016, 2021 and 2027. # - Income-related premiums, Table V.E4 (file page 218), "Aggregate # premiums", the amount paid "in excess of the Part D plan premium". They # are part of premium income: they are withheld from benefits (42 U.S.C. @@ -25,17 +25,12 @@ metadata: # - Part D enrollment, Table V.B3 (file page 196), in thousands. It equals # the total of Table IV.B7 (file page 153), which includes retiree drug # subsidy beneficiaries. - # Low-income subsidy enrollees pay reduced premiums or none (file page 219); + # Low-income subsidy enrollees pay substantially reduced premiums (file + # page 219); # Medicare's low-income subsidy payments are expenditures of the Part D # account, not enrollee premiums (file page 114). So the average is below # the base beneficiary premium. - - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table III.D3 - href: https://www.cms.gov/oact/tr/2026#page=116 - - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table V.E4 - href: https://www.cms.gov/oact/tr/2026#page=218 - - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table V.B3 - href: https://www.cms.gov/oact/tr/2026#page=196 - - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Part D revenue and expenditures + - title: "2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Tables III.D1, III.D3, V.B3, V.D1 and V.E4 #page 109,114,116-117,151,154,196,210,218-219" href: https://www.cms.gov/oact/tr/2026#page=109 - title: 42 U.S.C. § 1395w-113(c)(4) - Collection of monthly adjustment amount href: https://www.law.cornell.edu/uscode/text/42/1395w-113#c_4 @@ -56,7 +51,7 @@ values: 2025-01-01: 220.25 # Trustees' intermediate estimates. The 2030 jump is the Inflation # Reduction Act's reset of the base beneficiary premium percentage - # (file page 152). + # (file page 154). 2026-01-01: 289.79 2027-01-01: 373.53 2028-01-01: 403.59 diff --git a/policyengine_us/tests/core/test_medicare_cost_part_d_premium.py b/policyengine_us/tests/core/test_medicare_cost_part_d_premium.py index 527a3e85644..6c2379bcd05 100644 --- a/policyengine_us/tests/core/test_medicare_cost_part_d_premium.py +++ b/policyengine_us/tests/core/test_medicare_cost_part_d_premium.py @@ -15,7 +15,7 @@ Report: - ``premiums_per_enrollee``: Table III.D3 premium income (footnote 6's - December 31 credits moved back a year) less Table V.E4's aggregate + December 31 credits moved to the following year) less Table V.E4's aggregate income-related premiums, over Table V.B3's Part D enrollment. - ``enrollment_share``: Table V.B3's Part D enrollment over its total, people with Part A and/or Part B coverage. From b553a6782f22daebb162291e1e1ce07ee8e2faec Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 23:06:15 +0000 Subject: [PATCH 13/35] Merge duplicate references to one entry per source document CLAUDE.md asks for one reference entry per document with the page list in the title. The four Trustees calibration series listed the 2026 report two to four times with hrefs that differed only by #page=; each now has one entry naming every table and PDF page its comments cite (and the LIS series keeps a separate entry for the 2025 report). The CBO social-insurance list now cites Appendix D (PDF page 39) of the 2021 report alongside note 3, and the 2026 report's PDF page, and cbo_medicare_benefit notes the extra PDF pages of its 2021 and 2018 CBO references. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01LwQq6HHj8EHZr9hwABoKJk --- .../part_d_low_income_subsidy_per_enrollee.yaml | 8 +++----- .../medicare/premium_income_per_enrollee/part_a.yaml | 6 +----- .../medicare/premium_income_per_enrollee/part_b.yaml | 8 +------- .../medicare/premium_income_per_enrollee/part_d.yaml | 6 ++---- .../gov/household/cbo_social_insurance_benefits.yaml | 12 +++++++++--- .../gov/hhs/medicare/costs/cbo_medicare_benefit.py | 2 ++ 6 files changed, 18 insertions(+), 24 deletions(-) diff --git a/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d_low_income_subsidy_per_enrollee.yaml b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d_low_income_subsidy_per_enrollee.yaml index 6e84c8d8cac..283b1c21244 100644 --- a/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d_low_income_subsidy_per_enrollee.yaml +++ b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d_low_income_subsidy_per_enrollee.yaml @@ -18,12 +18,10 @@ metadata: # ffa56b9137006872300b0346149eae1613d09a172b6ba118aad48e66dfc48fa8; 2025 # report sha256 # 1b3de7a4faeee5ad42059e10740603182b716a5fa7b53b30d360b45b9e474d95. - - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table IV.B10 - href: https://www.cms.gov/oact/tr/2026#page=159 - - title: 2025 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table IV.B10 + - title: "2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Tables IV.B9, IV.B10 and V.B3 #page 119,158-159,196" + href: https://www.cms.gov/oact/tr/2026#page=119 + - title: "2025 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table IV.B10" href: https://www.cms.gov/oact/tr/2025#page=159 - - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table V.B3 - href: https://www.cms.gov/oact/tr/2026#page=196 values: # Historical. 2015-01-01: 460.52 diff --git a/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_a.yaml b/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_a.yaml index 5049d213595..83d19fa398b 100644 --- a/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_a.yaml +++ b/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_a.yaml @@ -15,12 +15,8 @@ metadata: # Medicaid buy-in payments are included. 2026 Medicare Trustees Report, # transmitted 2026-06-09, retrieved 2026-10-11, sha256 # ffa56b9137006872300b0346149eae1613d09a172b6ba118aad48e66dfc48fa8. - - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table III.B4 + - title: "2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Tables III.B4 and V.B3 and glossary #page 64,196,257" href: https://www.cms.gov/oact/tr/2026#page=64 - - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table V.B3 - href: https://www.cms.gov/oact/tr/2026#page=196 - - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, glossary, Part A premium - href: https://www.cms.gov/oact/tr/2026#page=257 values: # Historical. 2015-01-01: 57.57 diff --git a/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_b.yaml b/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_b.yaml index 53b67c103aa..8816f80ea85 100644 --- a/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_b.yaml +++ b/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_b.yaml @@ -27,13 +27,7 @@ metadata: # 2026 Medicare Trustees Report, transmitted 2026-06-09, retrieved # 2026-10-11, sha256 # ffa56b9137006872300b0346149eae1613d09a172b6ba118aad48e66dfc48fa8. - - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table III.C7 - href: https://www.cms.gov/oact/tr/2026#page=102 - - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table III.C4 - href: https://www.cms.gov/oact/tr/2026#page=96 - - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table V.B3 - href: https://www.cms.gov/oact/tr/2026#page=196 - - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Part B premium income + - title: "2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Tables III.C2, III.C4, III.C7, V.B3 and V.E3 #page 88-89,96,102,196,215" href: https://www.cms.gov/oact/tr/2026#page=88 values: # Historical. diff --git a/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_d.yaml b/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_d.yaml index 1c8af7fff7f..5c6c965ea3c 100644 --- a/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_d.yaml +++ b/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_d.yaml @@ -23,10 +23,8 @@ metadata: # Medicare enrollee. 2026 Medicare Trustees Report, transmitted # 2026-06-09, retrieved 2026-10-11, sha256 # ffa56b9137006872300b0346149eae1613d09a172b6ba118aad48e66dfc48fa8. - - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table III.D3 - href: https://www.cms.gov/oact/tr/2026#page=116 - - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table V.B3 - href: https://www.cms.gov/oact/tr/2026#page=196 + - title: "2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Tables III.D3, V.B3 and V.E4 #page 109,116-117,151,154,196,218" + href: https://www.cms.gov/oact/tr/2026#page=109 values: # Historical. 2015-01-01: 224.86 diff --git a/policyengine_us/parameters/gov/household/cbo_social_insurance_benefits.yaml b/policyengine_us/parameters/gov/household/cbo_social_insurance_benefits.yaml index 0114e084d1d..4228013adb3 100644 --- a/policyengine_us/parameters/gov/household/cbo_social_insurance_benefits.yaml +++ b/policyengine_us/parameters/gov/household/cbo_social_insurance_benefits.yaml @@ -15,11 +15,17 @@ metadata: # Security (Old Age, Survivors, and Disability Insurance); Medicare # (measured as the average cost to the government of providing those # benefits, net of offsetting receipts); regular unemployment insurance - # ...; and workers' compensation." (Appendix A, note 3.) - - title: Congressional Budget Office, The Distribution of Household Income in 2021, Appendix A + # ...; and workers' compensation." (Appendix A, note 3, PDF page 27.) + # Appendix D (PDF page 39) defines Medicare as "measured by the average + # cost to the government of providing those benefits", with no netting + # clause. + - title: "Congressional Budget Office, The Distribution of Household Income in 2021, Appendixes A and D #page 27,39" href: https://www.cbo.gov/system/files/2024-09/60341-income.pdf#page=27 # "The measure of Medicare benefits in The Distribution of Household # Income includes the federal government's average cost per enrollee of - # providing Medicare, net of premiums paid by enrollees." + # providing Medicare, net of premiums paid by enrollees." (Report PDF, + # 61910-DOHI-health.pdf, page 27; the same report lists "Medicare (net + # of premiums paid by enrollees)" on PDF pages 5 and 37.) CBO calls that + # measure plus enrollee premiums "gross Medicare spending". - title: Congressional Budget Office, Sensitivity of the Distribution of Household Income to the Treatment of Health Insurance From 1979 to 2021 href: https://www.cbo.gov/publication/61910 diff --git a/policyengine_us/variables/gov/hhs/medicare/costs/cbo_medicare_benefit.py b/policyengine_us/variables/gov/hhs/medicare/costs/cbo_medicare_benefit.py index 1a4e1d96df5..b3be036092e 100644 --- a/policyengine_us/variables/gov/hhs/medicare/costs/cbo_medicare_benefit.py +++ b/policyengine_us/variables/gov/hhs/medicare/costs/cbo_medicare_benefit.py @@ -19,7 +19,9 @@ class cbo_medicare_benefit(Variable): definition_period = YEAR reference = ( "https://www.cbo.gov/publication/61910", + # PDF pages 27, 39 "https://www.cbo.gov/system/files/2024-09/60341-income.pdf#page=27", + # PDF pages 46, 52 "https://www.cbo.gov/system/files/2018-07/54234-workingpaper.pdf#page=46", ) defined_for = "medicare_enrolled" From 1934f23840a3348b063f1fc96459f5c61e0c20a9 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 5 Nov 2026 03:33:04 +0000 Subject: [PATCH 14/35] Extend the four Medicare per-enrollee series back to 2013 cbo_medicare_benefit subtracts these series from calibration.gov.hhs.medicare.per_capita_cost, which starts in 2013, but each series started in 2015. So cbo_household_income raised ParameterNotFoundError in 2013 and 2014 for any household with a Medicare enrollee, where main returns a value. The 2022 to 2026 Trustees Reports drop 2013 and 2014 from Tables III.B4, III.C7 and V.B3, so Part A, Part B and enrollment come from the 2021 report. Part D premium income comes from the 2026 report's Table III.D3, whose footnote 6 lists no December 31 credit in either year, and the low-income subsidy from the 2023 report's Table IV.B10, the newest that shows both years. Each value is the aggregate over Table V.B3's total enrollment, rounded to the cent. The 2021 report reproduces every stored 2015 and 2016 value to the cent. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01H3DAwxuFHxBaZvWgnqNt1E --- ...art_d_low_income_subsidy_per_enrollee.yaml | 19 ++++++++++++--- .../premium_income_per_enrollee/part_a.yaml | 23 +++++++++++++------ .../premium_income_per_enrollee/part_b.yaml | 14 +++++++++-- .../premium_income_per_enrollee/part_d.yaml | 16 ++++++++++--- 4 files changed, 57 insertions(+), 15 deletions(-) diff --git a/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d_low_income_subsidy_per_enrollee.yaml b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d_low_income_subsidy_per_enrollee.yaml index 283b1c21244..13b64f885af 100644 --- a/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d_low_income_subsidy_per_enrollee.yaml +++ b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d_low_income_subsidy_per_enrollee.yaml @@ -7,9 +7,9 @@ metadata: # spending per enrollee, so the subsidy keeps its 2035 share of spending. uprating: calibration.gov.hhs.medicare.per_capita_cost reference: - # Each value is Table IV.B10's "Low-income subsidy" payments ($ billions, - # incurred basis) over Table V.B3's total enrollment (file page 196, - # thousands), people with Part A and/or Part B coverage, so it is per + # From 2015, each value is Table IV.B10's "Low-income subsidy" payments ($ + # billions, incurred basis) over Table V.B3's total enrollment (file page + # 196, thousands), people with Part A and/or Part B coverage, so it is per # Medicare enrollee, not per subsidy recipient. 2016 to 2035 come from the # 2026 report's Table IV.B10 (file page 159); 2015, which that table no # longer shows, from the 2025 report's (file page 159). The two reports @@ -22,8 +22,21 @@ metadata: href: https://www.cms.gov/oact/tr/2026#page=119 - title: "2025 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table IV.B10" href: https://www.cms.gov/oact/tr/2025#page=159 + # 2013 and 2014: the 2023 report's Table IV.B10 (file page 159), + # "Low-income subsidy", $ billions, incurred basis, over the 2021 + # report's Table V.B3 total enrollment (file page 199, thousands). Both + # retrieved 2026-11-04; 2023 report sha256 + # 89daaf2909ae18648783f652c05114d007c5f902cc5fa5fad0f76d43f6ccfa67, + # 2021 report sha256 + # ef3d1fa77e99362c460f45b3d0ff0734181340e617675e21fde99276a520fc8e. + - title: "2023 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table IV.B10 #page 159" + href: https://www.cms.gov/oact/tr/2023#page=159 + - title: "2021 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table V.B3 #page 199" + href: https://www.cms.gov/files/document/2021-medicare-trustees-report.pdf#page=199 values: # Historical. + 2013-01-01: 441.87 + 2014-01-01: 449.04 2015-01-01: 460.52 2016-01-01: 462.57 2017-01-01: 465.21 diff --git a/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_a.yaml b/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_a.yaml index 83d19fa398b..00979049564 100644 --- a/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_a.yaml +++ b/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_a.yaml @@ -7,18 +7,27 @@ metadata: # spending per enrollee, so premiums keep their 2035 share of spending. uprating: calibration.gov.hhs.medicare.per_capita_cost reference: - # Each value is Table III.B4's "Premiums from voluntary enrollees" (file - # page 64, $ billions, cash basis) over Table V.B3's total enrollment - # (file page 196, thousands), which footnote 2 defines as the "Number of - # beneficiaries with HI and/or SMI coverage". The Part A premium is paid - # "by or on behalf of" these enrollees (glossary, file page 257), so state - # Medicaid buy-in payments are included. 2026 Medicare Trustees Report, - # transmitted 2026-06-09, retrieved 2026-10-11, sha256 + # From 2015, each value is Table III.B4's "Premiums from voluntary + # enrollees" (file page 64, $ billions, cash basis) over Table V.B3's + # total enrollment (file page 196, thousands), which footnote 2 defines as + # the "Number of beneficiaries with HI and/or SMI coverage". The Part A + # premium is paid "by or on behalf of" these enrollees (glossary, file + # page 257), so state Medicaid buy-in payments are included. 2026 Medicare + # Trustees Report, transmitted 2026-06-09, retrieved 2026-10-11, sha256 # ffa56b9137006872300b0346149eae1613d09a172b6ba118aad48e66dfc48fa8. - title: "2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Tables III.B4 and V.B3 and glossary #page 64,196,257" href: https://www.cms.gov/oact/tr/2026#page=64 + # 2013 and 2014: the 2021 report's Table III.B4 (file page 62), + # "Premiums from voluntary enrollees", $ billions, cash basis, over its + # Table V.B3 total enrollment (file page 199, thousands). 2021 report + # retrieved 2026-11-04, sha256 + # ef3d1fa77e99362c460f45b3d0ff0734181340e617675e21fde99276a520fc8e. + - title: "2021 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Tables III.B4 and V.B3 #page 62,199" + href: https://www.cms.gov/files/document/2021-medicare-trustees-report.pdf#page=62 values: # Historical. + 2013-01-01: 64.76 + 2014-01-01: 60.98 2015-01-01: 57.57 2016-01-01: 57.82 2017-01-01: 59.64 diff --git a/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_b.yaml b/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_b.yaml index 8816f80ea85..31a541d5142 100644 --- a/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_b.yaml +++ b/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_b.yaml @@ -7,8 +7,9 @@ metadata: # spending per enrollee, so premiums keep their 2035 share of spending. uprating: calibration.gov.hhs.medicare.per_capita_cost reference: - # Each value is premium income over Table V.B3's total enrollment (file - # page 196, thousands), people with Part A and/or Part B coverage. + # From 2015, each value is premium income over Table V.B3's total + # enrollment (file page 196, thousands), people with Part A and/or Part B + # coverage. # - 2015 to 2026: Table III.C7 (file page 102), "Premium income", $ # millions, incurred basis. # - 2027 to 2035: Table III.C4 (file page 96), "Premium income", $ @@ -29,8 +30,17 @@ metadata: # ffa56b9137006872300b0346149eae1613d09a172b6ba118aad48e66dfc48fa8. - title: "2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Tables III.C2, III.C4, III.C7, V.B3 and V.E3 #page 88-89,96,102,196,215" href: https://www.cms.gov/oact/tr/2026#page=88 + # 2013 and 2014: the 2021 report's Table III.C7 (file page 104), + # "Premium income", $ millions, incurred basis, over its Table V.B3 + # total enrollment (file page 199, thousands). Incurred premium income + # needs no cash timing adjustment. 2021 report retrieved 2026-11-04, + # sha256 ef3d1fa77e99362c460f45b3d0ff0734181340e617675e21fde99276a520fc8e. + - title: "2021 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Tables III.C7 and V.B3 #page 104,199" + href: https://www.cms.gov/files/document/2021-medicare-trustees-report.pdf#page=104 values: # Historical. + 2013-01-01: 1_201.53 + 2014-01-01: 1_213.05 2015-01-01: 1_214.54 2016-01-01: 1_296.34 2017-01-01: 1_389.19 diff --git a/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_d.yaml b/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_d.yaml index 5c6c965ea3c..87f69b20c84 100644 --- a/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_d.yaml +++ b/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_d.yaml @@ -7,9 +7,9 @@ metadata: # spending per enrollee, so premiums keep their 2035 share of spending. uprating: calibration.gov.hhs.medicare.per_capita_cost reference: - # Each value is Table III.D3's "Premium income" (file page 116, $ - # billions, cash basis) over Table V.B3's total enrollment (file page 196, - # thousands), people with Part A and/or Part B coverage. Footnote 1: + # From 2015, each value is Table III.D3's "Premium income" (file page 116, + # $ billions, cash basis) over Table V.B3's total enrollment (file page + # 196, thousands), people with Part A and/or Part B coverage. Footnote 1: # "Premiums include both amounts withheld from Social Security benefits or # other Federal payments, direct payments to the Federal government, and # those paid directly to Part D plans." Footnote 6 (file page 117) credits @@ -25,8 +25,18 @@ metadata: # ffa56b9137006872300b0346149eae1613d09a172b6ba118aad48e66dfc48fa8. - title: "2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Tables III.D3, V.B3 and V.E4 #page 109,116-117,151,154,196,218" href: https://www.cms.gov/oact/tr/2026#page=109 + # 2013 and 2014: the 2026 report's Table III.D3 (file page 116), + # "Premium income", $ billions, cash basis, over the 2021 report's + # Table V.B3 total enrollment (file page 199, thousands). Footnote 6 + # (2026 report, file page 117) lists no December 31 credit in 2013 or + # 2014, so neither year moves. 2021 report retrieved 2026-11-04, sha256 + # ef3d1fa77e99362c460f45b3d0ff0734181340e617675e21fde99276a520fc8e. + - title: "2021 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table V.B3 #page 199" + href: https://www.cms.gov/files/document/2021-medicare-trustees-report.pdf#page=199 values: # Historical. + 2013-01-01: 188.56 + 2014-01-01: 210.66 2015-01-01: 224.86 2016-01-01: 245.3 2017-01-01: 264.13 From fdee6880dfcf133733e7effcb07fed3244698514 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 5 Nov 2026 03:45:53 +0000 Subject: [PATCH 15/35] Test the 2013 and 2014 Medicare per-enrollee values Nothing tested a year before 2015: the Hypothesis bounds test started at 2015 and every YAML case was 2015 or later, so the 2013 and 2014 crash in cbo_household_income went unseen. - cbo_medicare_benefit.yaml: Cases 6 and 7 assert the 2013 and 2014 net values. Case 3 is renamed, since 2015 is no longer the series' first year. - cbo_household_income.yaml: the review's 2014 witness, an enrollee with $10,000 of earnings, asserts the net benefit and total income. - test_cbo_medicare_benefit_series.py: a transcription test recomputes each 2013 and 2014 value from the Trustees cells, and the bounds test now starts at 2013 and always tries 2013. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01H3DAwxuFHxBaZvWgnqNt1E --- .../core/test_cbo_medicare_benefit_series.py | 42 ++++++++++++++++--- .../medicare/costs/cbo_medicare_benefit.yaml | 24 ++++++++++- .../household/cbo_household_income.yaml | 15 +++++++ 3 files changed, 75 insertions(+), 6 deletions(-) diff --git a/policyengine_us/tests/core/test_cbo_medicare_benefit_series.py b/policyengine_us/tests/core/test_cbo_medicare_benefit_series.py index c3da92714a1..c567ed0e5c1 100644 --- a/policyengine_us/tests/core/test_cbo_medicare_benefit_series.py +++ b/policyengine_us/tests/core/test_cbo_medicare_benefit_series.py @@ -5,8 +5,9 @@ low-income subsidy separately. ``cbo_medicare_benefit`` takes CMS Medicare spending per enrollee (``calibration.gov.hhs.medicare.per_capita_cost``) and subtracts four series under ``calibration.gov.hhs.medicare``, each an -aggregate from the 2026 Medicare Trustees Report over Table V.B3's total -enrollment (people with Part A and/or Part B): +aggregate from the Medicare Trustees Reports over Table V.B3's total +enrollment (people with Part A and/or Part B). From 2015 they come from the +2026 report: - ``premium_income_per_enrollee.part_a``: Table III.B4 premiums from voluntary enrollees. @@ -18,6 +19,11 @@ - ``part_d_low_income_subsidy_per_enrollee``: Table IV.B10 low-income subsidy (the 2025 report for 2015). +2013 and 2014 take enrollment from the 2021 report and each numerator from +the newest report that still shows both years: the 2021 report for Parts A +and B, the 2026 report for Part D and the 2023 report for the low-income +subsidy. + These tests read parameters only; the YAML tests cover the variable. Invariants: @@ -35,7 +41,7 @@ income-related premiums reproduces it within 0.5 percent, while the standard premium alone falls more than 5 percent short. 5. Bounds: every series is positive, and net Medicare spending per enrollee - stays between 0 and gross spending, in every year from 2015 to 2200. + stays between 0 and gross spending, in every year from 2013 to 2200. 6. Extension: from 2036 to 2100 each series grows with Medicare spending per enrollee, so each keeps its 2035 share of spending; later years hold the 2100 value. @@ -43,7 +49,7 @@ """ import pytest -from hypothesis import given +from hypothesis import example, given from hypothesis import strategies as st from policyengine_core.parameters.operations.get_parameter import get_parameter @@ -117,6 +123,23 @@ def _cells(*values): PART_B_ENROLLMENT_2019 = 56_019 PART_B_IRMAA_2019 = 8.4 +# 2013 and 2014: Table V.B3 of the 2021 report (page 199) for enrollment, +# and each numerator from the newest report that still shows both years. +# Footnote 6 to Table III.D3 (2026 report, page 117) lists no December 31 +# credit in either year. +BACKFILL_YEARS = (2013, 2014) +BACKFILL_ENROLLMENT = {2013: 52_504, 2014: 54_115} +BACKFILL_BILLIONS = { + # 2021 report, Table III.B4 (page 62), cash basis. + "part_a": {2013: 3.4, 2014: 3.3}, + # 2021 report, Table III.C7 (page 104), incurred basis, $ millions. + "part_b": {2013: 63_085 / 1e3, 2014: 65_644 / 1e3}, + # 2026 report, Table III.D3 (page 116), cash basis. + "part_d": {2013: 9.9, 2014: 11.4}, + # 2023 report, Table IV.B10 (page 159), incurred basis. + "lis": {2013: 23.2, 2014: 24.3}, +} + def _part_b_billions(year): if year in PART_B_INCURRED: @@ -174,6 +197,14 @@ def test_series_times_enrollment_returns_the_aggregate(series, year): assert rebuilt == pytest.approx(AGGREGATES[series](year), abs=1e-3) +@pytest.mark.parametrize("series", SERIES) +@pytest.mark.parametrize("year", BACKFILL_YEARS) +def test_2013_and_2014_are_the_trustees_aggregate_per_medicare_enrollee(series, year): + billions = BACKFILL_BILLIONS[series][year] + expected = billions * 1e9 / (BACKFILL_ENROLLMENT[year] * 1e3) + assert _value(series, year) == round(expected, 2) + + @pytest.mark.parametrize("year", YEARS) def test_part_d_series_matches_share_times_premium_plus_irmaa(year): share = _read(f"{MEDICARE}.part_d.enrollment_share", f"{year}-01-01") @@ -191,7 +222,8 @@ def test_part_b_premium_income_includes_income_related_premiums(): assert standard < published * 0.95 -@given(st.integers(FIRST_YEAR, END_YEAR + 100)) +@given(st.integers(BACKFILL_YEARS[0], END_YEAR + 100)) +@example(BACKFILL_YEARS[0]) def test_series_are_positive_and_net_spending_is_between_zero_and_gross(year): deductions = sum(_value(series, year) for series in SERIES) assert all(_value(series, year) > 0 for series in SERIES) diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/cbo_medicare_benefit.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/cbo_medicare_benefit.yaml index f3e1652a12b..f767fa56302 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/cbo_medicare_benefit.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/cbo_medicare_benefit.yaml @@ -78,7 +78,7 @@ output: cbo_medicare_benefit: [15_033.14, 15_033.14, 15_033.14, 15_033.14, 0] -- name: Case 3, first year of the series. +- name: Case 3, first year with enrollment from the 2026 Trustees Report. period: 2015 absolute_error_margin: 0.01 input: @@ -109,3 +109,25 @@ medicare_enrolled: false output: cbo_medicare_benefit: 0 + +- name: Case 6, first year of CMS spending per enrollee. + period: 2013 + absolute_error_margin: 0.01 + input: + age: 70 + is_medicare_eligible: true + medicare_enrolled: true + output: + # $11,483 - $64.76 - $1,201.53 - $188.56 - $441.87. + cbo_medicare_benefit: 9_586.28 + +- name: Case 7, second year of CMS spending per enrollee. + period: 2014 + absolute_error_margin: 0.01 + input: + age: 70 + is_medicare_eligible: true + medicare_enrolled: true + output: + # $11,683 - $60.98 - $1,213.05 - $210.66 - $449.04. + cbo_medicare_benefit: 9_749.27 diff --git a/policyengine_us/tests/policy/baseline/household/income/household/cbo_household_income.yaml b/policyengine_us/tests/policy/baseline/household/income/household/cbo_household_income.yaml index d52fdf17f34..642eb31834d 100644 --- a/policyengine_us/tests/policy/baseline/household/income/household/cbo_household_income.yaml +++ b/policyengine_us/tests/policy/baseline/household/income/household/cbo_household_income.yaml @@ -45,6 +45,21 @@ cbo_household_income_before_transfers_and_taxes: 79_135.14 cbo_household_income: 79_135.14 +- name: CBO income counts a Medicare enrollee net of premiums in 2014 + period: 2014 + absolute_error_margin: 0.01 + input: + age: 70 + medicare_enrolled: true + employment_income: 10_000 + output: + # $11,683 - $60.98 - $1,213.05 - $210.66 - $449.04. + cbo_medicare_benefit: 9_749.27 + # $10,891, the same household's CBO income without an enrollee, plus + # $9,749.27. Counting gross Medicare spending per enrollee ($11,683) + # instead gives $10,891 + $11,683 = $22,574. + cbo_household_income: 20_640.27 + - name: CBO means-tested transfers include only the listed programs period: 2026 input: From b779c4156b8e9be8b7dda0d643fb2a4616f0c5ba Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 5 Nov 2026 03:50:38 +0000 Subject: [PATCH 16/35] Say what cbo_medicare_benefit nets as premium income The documentation said "net of premiums paid by or on behalf of enrollees", stating as fact a reading CBO's own wording ("premiums paid by enrollees") leaves open. Say instead that the series net premium income as the Medicare Trustees count it, which includes premiums state Medicaid programs pay, and that PolicyEngine counts those in Medicaid: medicaid_cost_if_enrolled spreads state totals whose MACPAC (2021-2022) and KFF sources include Medicaid's payments of Medicare premiums. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01H3DAwxuFHxBaZvWgnqNt1E --- .../hhs/medicare/costs/cbo_medicare_benefit.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/policyengine_us/variables/gov/hhs/medicare/costs/cbo_medicare_benefit.py b/policyengine_us/variables/gov/hhs/medicare/costs/cbo_medicare_benefit.py index b3be036092e..a2b0c748dd2 100644 --- a/policyengine_us/variables/gov/hhs/medicare/costs/cbo_medicare_benefit.py +++ b/policyengine_us/variables/gov/hhs/medicare/costs/cbo_medicare_benefit.py @@ -8,12 +8,15 @@ class cbo_medicare_benefit(Variable): documentation = ( "Medicare benefit as the Congressional Budget Office counts it in " "household income: the government's average cost per enrollee of " - "providing Medicare Parts A, B and D, net of premiums paid by or on " - "behalf of enrollees. CBO assigns the same average to every " - "enrollee and counts the Part D low-income subsidy separately as a " - "means-tested transfer, so this subtracts per-enrollee averages of " - "premium income and of the low-income subsidy from Medicare " - "spending per enrollee, rather than the person's own premiums." + "providing Medicare Parts A, B and D, net of premium income " + "(premiums paid by or on behalf of enrollees, as the Medicare " + "Trustees count it; this includes premiums state Medicaid programs " + "pay, which PolicyEngine counts in Medicaid). CBO assigns the same " + "average to every enrollee and counts the Part D low-income subsidy " + "separately as a means-tested transfer, so this subtracts " + "per-enrollee averages of premium income and of the low-income " + "subsidy from Medicare spending per enrollee, rather than the " + "person's own premiums." ) unit = USD definition_period = YEAR From c9dfbc2bdaefe635cc674aba4ea2bfcc112862a9 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Thu, 5 Nov 2026 00:12:02 -0500 Subject: [PATCH 17/35] Start the Medicare series date test at 2013 and drop single pages from titles The date test now draws from 2013 and pins December 28, 2013, so a mid-year entry under a 2013 value fails it. Three reference titles drop the one page they cite; each href keeps it. Co-Authored-By: Claude Opus 5.5 --- .../hhs/medicare/part_d_low_income_subsidy_per_enrollee.yaml | 4 ++-- .../gov/hhs/medicare/premium_income_per_enrollee/part_d.yaml | 2 +- .../tests/core/test_cbo_medicare_benefit_series.py | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d_low_income_subsidy_per_enrollee.yaml b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d_low_income_subsidy_per_enrollee.yaml index 13b64f885af..10d1046d1d9 100644 --- a/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d_low_income_subsidy_per_enrollee.yaml +++ b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d_low_income_subsidy_per_enrollee.yaml @@ -29,9 +29,9 @@ metadata: # 89daaf2909ae18648783f652c05114d007c5f902cc5fa5fad0f76d43f6ccfa67, # 2021 report sha256 # ef3d1fa77e99362c460f45b3d0ff0734181340e617675e21fde99276a520fc8e. - - title: "2023 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table IV.B10 #page 159" + - title: "2023 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table IV.B10" href: https://www.cms.gov/oact/tr/2023#page=159 - - title: "2021 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table V.B3 #page 199" + - title: "2021 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table V.B3" href: https://www.cms.gov/files/document/2021-medicare-trustees-report.pdf#page=199 values: # Historical. diff --git a/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_d.yaml b/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_d.yaml index 87f69b20c84..f2b346c0f37 100644 --- a/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_d.yaml +++ b/policyengine_us/parameters/calibration/gov/hhs/medicare/premium_income_per_enrollee/part_d.yaml @@ -31,7 +31,7 @@ metadata: # (2026 report, file page 117) lists no December 31 credit in 2013 or # 2014, so neither year moves. 2021 report retrieved 2026-11-04, sha256 # ef3d1fa77e99362c460f45b3d0ff0734181340e617675e21fde99276a520fc8e. - - title: "2021 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table V.B3 #page 199" + - title: "2021 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table V.B3" href: https://www.cms.gov/files/document/2021-medicare-trustees-report.pdf#page=199 values: # Historical. diff --git a/policyengine_us/tests/core/test_cbo_medicare_benefit_series.py b/policyengine_us/tests/core/test_cbo_medicare_benefit_series.py index c567ed0e5c1..c9b916752ce 100644 --- a/policyengine_us/tests/core/test_cbo_medicare_benefit_series.py +++ b/policyengine_us/tests/core/test_cbo_medicare_benefit_series.py @@ -245,7 +245,8 @@ def test_series_hold_the_2100_values_afterwards(year): assert _value(series, year) == _value(series, END_YEAR) -@given(st.integers(FIRST_YEAR, END_YEAR), st.integers(1, 12), st.integers(1, 28)) +@given(st.integers(BACKFILL_YEARS[0], END_YEAR), st.integers(1, 12), st.integers(1, 28)) +@example(BACKFILL_YEARS[0], 12, 28) def test_every_date_in_a_year_reads_the_january_value(year, month, day): date = f"{year}-{month:02d}-{day:02d}" for series in SERIES: From 1b77458c7ac4ee43765696ab7db1d16be871ff82 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Thu, 5 Nov 2026 11:29:51 -0500 Subject: [PATCH 18/35] Name the Part D average's limits and pin its extension - Say in `medicare_cost`'s documentation that every enrollee nets the same average premium. - Name retiree drug subsidy beneficiaries in both labels, and add page 153 to the premium reference. - Drop the test's reference equality, keeping the bounds and the IRMAA slope. - Add a 2036 case that pins where the premium's extension starts. Co-Authored-By: Claude Opus 5.5 --- .../hhs/medicare/part_d/enrollment_share.yaml | 2 +- .../medicare/part_d/premiums_per_enrollee.yaml | 4 ++-- .../core/test_medicare_cost_part_d_premium.py | 14 +------------- .../gov/hhs/medicare/costs/medicare_cost.yaml | 17 +++++++++++++++++ .../gov/hhs/medicare/costs/medicare_cost.py | 5 ++++- 5 files changed, 25 insertions(+), 17 deletions(-) diff --git a/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/enrollment_share.yaml b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/enrollment_share.yaml index 510c5097b88..f9d3062bdbb 100644 --- a/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/enrollment_share.yaml +++ b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/enrollment_share.yaml @@ -2,7 +2,7 @@ description: The Medicare Trustees' reported and projected enrollment gives this metadata: unit: /1 period: year - label: Medicare Part D enrollment share + label: Medicare Part D enrollment share, including retiree drug subsidy beneficiaries reference: # Table V.B3, "Medicare Enrollment": Part D enrollment over total # enrollment, which footnote 2 defines as the "Number of beneficiaries with diff --git a/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/premiums_per_enrollee.yaml b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/premiums_per_enrollee.yaml index 88d0d93b5b5..dea0b330731 100644 --- a/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/premiums_per_enrollee.yaml +++ b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/premiums_per_enrollee.yaml @@ -2,7 +2,7 @@ description: The Medicare Trustees' reported and projected Part D premium income metadata: unit: currency-USD period: year - label: Medicare Part D premiums per Part D enrollee + label: Medicare Part D premiums per Part D enrollee, counting retiree drug subsidy beneficiaries as enrollees reference: # Each value is (premium income - aggregate income-related premiums) / # Part D enrollment, from the 2026 Medicare Trustees Report (transmitted @@ -30,7 +30,7 @@ metadata: # Medicare's low-income subsidy payments are expenditures of the Part D # account, not enrollee premiums (file page 114). So the average is below # the base beneficiary premium. - - title: "2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Tables III.D1, III.D3, V.B3, V.D1 and V.E4 #page 109,114,116-117,151,154,196,210,218-219" + - title: "2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Tables III.D1, III.D3, IV.B7, V.B3, V.D1 and V.E4 #page 109,114,116-117,151,153,154,196,210,218-219" href: https://www.cms.gov/oact/tr/2026#page=109 - title: 42 U.S.C. § 1395w-113(c)(4) - Collection of monthly adjustment amount href: https://www.law.cornell.edu/uscode/text/42/1395w-113#c_4 diff --git a/policyengine_us/tests/core/test_medicare_cost_part_d_premium.py b/policyengine_us/tests/core/test_medicare_cost_part_d_premium.py index 6c2379bcd05..f20823b4b4d 100644 --- a/policyengine_us/tests/core/test_medicare_cost_part_d_premium.py +++ b/policyengine_us/tests/core/test_medicare_cost_part_d_premium.py @@ -231,21 +231,13 @@ def _enrollee(year, part_a, part_b, irmaa): } -def _reference_medicare_cost(year, part_a, part_b, irmaa): - gross = _read("calibration.gov.hhs.medicare.per_capita_cost", f"{year}-01-01") - part_d = _share(year) * _premium(year) + irmaa - return max(gross - part_a - part_b - part_d, 0) - - premiums = st.floats(0, 40_000, allow_nan=False) irmaas = st.floats(0, 12_000, allow_nan=False) @settings(max_examples=25, deadline=None) @given(years, st.floats(0, 12_000, allow_nan=False), premiums, irmaas, irmaas) -def test_medicare_cost_matches_reference_and_bounds( - year, part_a, part_b, irmaa, more_irmaa -): +def test_medicare_cost_bounds_and_irmaa_slope(year, part_a, part_b, irmaa, more_irmaa): low, high = sorted((irmaa, irmaa + more_irmaa)) simulation = _simulation( year, @@ -256,10 +248,6 @@ def test_medicare_cost_matches_reference_and_bounds( ) net = simulation.calculate("medicare_cost", year) gross = simulation.calculate("medicare_gross_cost", year) - # Variables are float32, so compare to single precision. - for value, surcharge in zip(net, (low, high)): - expected = _reference_medicare_cost(year, part_a, part_b, surcharge) - assert value == pytest.approx(expected, rel=1e-6, abs=0.01) assert (net >= 0).all() assert (net <= gross).all() # The gross cost subtracts no premium, so both people have the same one. diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/medicare_cost.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/medicare_cost.yaml index 52d793f2cd9..73dceb0fd0d 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/medicare_cost.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/costs/medicare_cost.yaml @@ -152,6 +152,23 @@ output: medicare_gross_cost: 17_751 +# From 2036 the premium grows at its 2034-2035 rate, and the share holds its +# 2035 value until 2040. +- name: unit test 13 - the premium extension starts after 2035 + period: 2036 + absolute_error_margin: 0.01 + input: + age: 65 + is_medicare_eligible: true + medicare_quarters_of_coverage: 40 + gross_medicare_part_b_premium: 3_000 + income_adjusted_part_d_premium_surcharge: 0 + output: + # Premium 722.05 x 722.05 / 699.07 = 745.79, times the 2035 share 0.8485 + # gives 632.80. 33,488.47 gross - 3,000 Part B - 632.80 Part D = 29,855.67. + medicare_gross_cost: 33_488.47 + medicare_cost: 29_855.67 + # A Medicare enrollee whose drug coverage is not Part D owes no Part D IRMAA # (income_adjusted_part_d_premium_surcharge is defined for # medicare_part_d_enrolled), but still has the average Part D premium diff --git a/policyengine_us/variables/gov/hhs/medicare/costs/medicare_cost.py b/policyengine_us/variables/gov/hhs/medicare/costs/medicare_cost.py index ed734b03c9a..eb48c24cd7e 100644 --- a/policyengine_us/variables/gov/hhs/medicare/costs/medicare_cost.py +++ b/policyengine_us/variables/gov/hhs/medicare/costs/medicare_cost.py @@ -12,7 +12,10 @@ class medicare_cost(Variable): "the gross Part B premium, the average Part D premium per Medicare " "enrollee, and the person's own Part D income-related monthly " "adjustment amount. This represents the net benefit value of " - "Medicare coverage." + "Medicare coverage. Every enrollee nets the same average Part D " + "premium, including low-income subsidy enrollees and people whose " + "drug coverage isn't Part D, so that term doesn't measure what a " + "given person pays." ) unit = USD definition_period = YEAR From ba6b915857358ae050797d6f703a688b390a5b5b Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sat, 7 Nov 2026 18:02:59 -0500 Subject: [PATCH 19/35] Pay the Part D low-income subsidy only to Part D plan enrollees The subsidy pays part of a Part D plan's premium and cost sharing, so 42 U.S.C. 1395w-114(a)(3)(A)(i) defines a subsidy eligible individual as one enrolled in a prescription drug plan or MA-PD plan, and 20 CFR 418.3101(b) says an applicant "must enroll in one of these plans to actually receive a subsidy". medicare_part_d_enrolled reached main in #10115 after this branch began, so part_d_lis_enrolled now requires it, including for Medicaid enrollees and SSI recipients: Medicare enrolls them in a plan automatically (42 CFR 423.34), but they can opt out of Part D, for example for TRICARE for Life or VA drug coverage. takes_up_medicare_part_d_if_eligible defaults to true and Microcosm does not yet set it, so the microsimulation is unchanged; a household that sets it to false now gets no subsidy. The seeded household sample in test_part_d_lis.py now draws Part D enrollment and its restated rule requires it; the YAML tests add an opt-out case for each path. Co-Authored-By: Claude Opus 5.5 --- policyengine_us/tests/core/test_part_d_lis.py | 20 ++++++++++++---- .../low_income_subsidy/integration.yaml | 22 ++++++++++++++++++ .../part_d_lis_enrolled.yaml | 23 +++++++++++++++++-- .../low_income_subsidy/part_d_lis_enrolled.py | 12 ++++++---- .../takes_up_part_d_lis_if_eligible.py | 9 ++++---- 5 files changed, 71 insertions(+), 15 deletions(-) diff --git a/policyengine_us/tests/core/test_part_d_lis.py b/policyengine_us/tests/core/test_part_d_lis.py index 632dacf8660..fe4ed04cea7 100644 --- a/policyengine_us/tests/core/test_part_d_lis.py +++ b/policyengine_us/tests/core/test_part_d_lis.py @@ -37,14 +37,18 @@ 8. More Social Security never lowers countable income or makes an income ineligible person income eligible; more assets never make a resource ineligible person resource eligible. -9. Eligibility equals the restated rule, and the benefit is either zero or - the year's amount per recipient, positive exactly for enrollees, who - are all eligible. +9. Eligibility equals the restated rule; enrollees are the eligible people + in a Part D plan who are on Medicaid or SSI or take the subsidy up; and + the benefit is either zero or the year's amount per recipient, positive + exactly for enrollees. 10. Spouses get the same countable income, family size and test results. 11. Differential: for people without interest or dividends, countable income equals 12 times ``msp_countable_income``, which applies the same SSI exclusions through a separate formula (single people, and couples where - both spouses are Medicare eligible). + both spouses are Medicare eligible). The sample's states keep SSI's $20 + general exclusion for the Medicare Savings Programs; Illinois and + Mississippi exclude more under 42 U.S.C. 1396a(r)(2), which the subsidy's + income definition sets aside. """ import numpy as np @@ -207,6 +211,7 @@ def person(): ssi=int(rng.choice([0, 0, 0, 0, 2_400])), msp_eligible=bool(rng.random() < 0.15), takes_up_part_d_lis_if_eligible=bool(rng.random() < 0.7), + takes_up_medicare_part_d_if_eligible=bool(rng.random() < 0.85), ) out.append( @@ -392,7 +397,12 @@ def test_eligibility_and_benefit_match_restated_rules(sample): and (deemed or (income_ok and resource_ok)) ) automatic = me["medicaid_enrolled"] or me["ssi"] > 0 - enrolled = eligible and (automatic or me["takes_up_part_d_lis_if_eligible"]) + in_part_d = me["takes_up_medicare_part_d_if_eligible"] + enrolled = ( + eligible + and in_part_d + and (automatic or me["takes_up_part_d_lis_if_eligible"]) + ) assert _value(values, index, "part_d_lis_income_eligible", name) == income_ok assert _value(values, index, "part_d_lis_resource_eligible", name) == ( resource_ok diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/integration.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/integration.yaml index a424e9ad85a..83a388e39b9 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/integration.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/integration.yaml @@ -130,6 +130,28 @@ part_d_lis_enrolled: false part_d_lis: 0 +- name: An eligible person outside Part D gets no subsidy. + period: 2026 + input: + people: + person: + age: 70 + social_security: 20_000 + bank_account_assets: 5_000 + # For example, drug coverage from TRICARE for Life instead. + takes_up_medicare_part_d_if_eligible: false + households: + household: + members: [person] + state_code: TX + output: + # Deemed eligible through a Medicare Savings Program, as in the first + # case, but the subsidy pays only for people in a Part D plan. + part_d_lis_eligible: true + medicare_part_d_enrolled: false + part_d_lis_enrolled: false + part_d_lis: 0 + - name: 2023, a person in the former partial-subsidy range gets the average. period: 2023 input: diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.yaml index e86f88cc3d6..bbef7210439 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.yaml @@ -1,5 +1,6 @@ -# Medicaid enrollees and SSI recipients are enrolled without an application; -# other eligible people are enrolled if they take up the subsidy. +# The subsidy goes only to people in a Part D plan. Medicaid enrollees and +# SSI recipients are enrolled without an application; other eligible people +# are enrolled if they take up the subsidy. - name: Medicaid enrollee who would not apply is enrolled anyway. period: 2026 @@ -7,6 +8,7 @@ people: person: part_d_lis_eligible: true + medicare_part_d_enrolled: true medicaid_enrolled: true ssi: 0 takes_up_part_d_lis_if_eligible: false @@ -19,6 +21,7 @@ people: person: part_d_lis_eligible: true + medicare_part_d_enrolled: true medicaid_enrolled: false ssi: 1_200 takes_up_part_d_lis_if_eligible: false @@ -31,6 +34,7 @@ people: person: part_d_lis_eligible: true + medicare_part_d_enrolled: true medicaid_enrolled: false ssi: 0 takes_up_part_d_lis_if_eligible: false @@ -43,18 +47,33 @@ people: person: part_d_lis_eligible: true + medicare_part_d_enrolled: true medicaid_enrolled: false ssi: 0 takes_up_part_d_lis_if_eligible: true output: part_d_lis_enrolled: true +- name: Medicaid enrollee who opted out of Part D gets no subsidy. + period: 2026 + input: + people: + person: + part_d_lis_eligible: true + medicare_part_d_enrolled: false + medicaid_enrolled: true + ssi: 1_200 + takes_up_part_d_lis_if_eligible: true + output: + part_d_lis_enrolled: false + - name: Medicaid enrollee who is not eligible (not in Medicare) is not enrolled. period: 2026 input: people: person: part_d_lis_eligible: false + medicare_part_d_enrolled: true medicaid_enrolled: true ssi: 0 output: diff --git a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.py b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.py index a1cadfb0488..8b23b2be7e2 100644 --- a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.py +++ b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.py @@ -6,12 +6,15 @@ class part_d_lis_enrolled(Variable): entity = Person label = "Enrolled in the Medicare Part D low-income subsidy" documentation = ( - "Medicare enrolls Medicaid enrollees and Supplemental Security Income " - "recipients in a Part D plan with the subsidy without an application. " - "Other eligible people receive it if they take it up." + "Medicare pays the subsidy only for people enrolled in a Part D plan " + "(medicare_part_d_enrolled). It enrolls Medicaid enrollees and " + "Supplemental Security Income recipients in a plan with the subsidy " + "without an application, unless they opt out of Part D. Other " + "eligible people in a Part D plan receive it if they take it up." ) definition_period = YEAR reference = ( + "https://www.law.cornell.edu/uscode/text/42/1395w-114#a_3_A", "https://www.ecfr.gov/current/title-42/chapter-IV/subchapter-B/part-423/subpart-P/section-423.773#p-423.773(c)(2)", "https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3101", "https://www.ecfr.gov/current/title-42/chapter-IV/subchapter-B/part-423/subpart-B/section-423.34", @@ -19,7 +22,8 @@ class part_d_lis_enrolled(Variable): defined_for = "part_d_lis_eligible" def formula(person, period, parameters): + in_part_d = person("medicare_part_d_enrolled", period) medicaid = person("medicaid_enrolled", period) ssi = add(person, period, ["ssi"]) > 0 takes_up = person("takes_up_part_d_lis_if_eligible", period) - return medicaid | ssi | takes_up + return in_part_d & (medicaid | ssi | takes_up) diff --git a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/takes_up_part_d_lis_if_eligible.py b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/takes_up_part_d_lis_if_eligible.py index f1a359189e5..adad6dfb5a3 100644 --- a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/takes_up_part_d_lis_if_eligible.py +++ b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/takes_up_part_d_lis_if_eligible.py @@ -9,10 +9,11 @@ class takes_up_part_d_lis_if_eligible(Variable): ) documentation = ( "Whether an eligible person who is neither a Medicaid enrollee nor a " - "Supplemental Security Income recipient applies for the subsidy and " - "enrolls in a Part D plan. Medicare Savings Program enrollees are " - "deemed eligible, but the model has Medicare Savings Program " - "eligibility, not enrollment, so this flag covers them too." + "Supplemental Security Income recipient applies for the subsidy. " + "Medicare Savings Program enrollees are deemed eligible, but the " + "model has Medicare Savings Program eligibility, not enrollment, so " + "this flag covers them too. The subsidy also requires enrollment in " + "a Part D plan (medicare_part_d_enrolled)." ) definition_period = YEAR default_value = True From e4153928add0ad77aa321e850f5a7c0baeec05a1 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sat, 7 Nov 2026 18:03:09 -0500 Subject: [PATCH 20/35] Start the subsidy average in 2013, like the per-enrollee series #10118 extended calibration.gov.hhs.medicare.part_d_low_income_subsidy_ per_enrollee and the other Medicare per-enrollee series back to 2013, the first year of per_capita_cost. The per-recipient average started in 2015, so part_d_lis raised ParameterNotFoundError for a 2013 or 2014 enrollee. The 2023 Trustees Report's Table IV.B9 (file page 158), the newest that shows both years, gives $2,023 per subsidy enrollee in 2013 (11.5 million enrollees) and $2,052 in 2014 (11.8 million); its Table IV.B10 gives $23.2 billion and $24.3 billion, which the products match within rounding, and the 2021 report's Table V.B3 enrollment (52,504 and 54,115 thousand) turns them into #10118's per-enrollee values within 0.4%. The invariant tests now cover both years. Before 2015, cbo_household_means_tested_transfers still raises ParameterNotFoundError through Medicaid and SNAP parameters, as it does without this change. The 2026 report's reference now lists both cited pages (119 and 158), and the Habib reference both of its pages (51 and 52), per the repository's reference rules. Co-Authored-By: Claude Opus 5.5 --- .../low_income_subsidy_per_recipient.yaml | 22 ++++++++++----- policyengine_us/tests/core/test_part_d_lis.py | 28 +++++++++++++------ .../part_d/low_income_subsidy/part_d_lis.yaml | 21 +++++++++++++- 3 files changed, 54 insertions(+), 17 deletions(-) diff --git a/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/low_income_subsidy_per_recipient.yaml b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/low_income_subsidy_per_recipient.yaml index 5e9211e701e..8ba1270ee3d 100644 --- a/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/low_income_subsidy_per_recipient.yaml +++ b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/low_income_subsidy_per_recipient.yaml @@ -12,26 +12,34 @@ metadata: # millions). Enrollment times the amount gives Table IV.B10's "Low-income # subsidy" payments, e.g. 14.4 million x $1,254 = $18.1 billion in 2026. # 2016 to 2035 come from the 2026 report (file page 158); 2015, which that - # table no longer shows, from the 2025 report (file page 158). The two - # reports differ by $1 to $2 in 2021 to 2023 (revised data). 2026 Medicare - # Trustees Report, transmitted 2026-06-09, retrieved 2026-10-11, sha256 + # table no longer shows, from the 2025 report (file page 158); 2013 and + # 2014 from the 2023 report (file page 158), the newest that shows both, + # as for the per-enrollee series beside this one. The reports differ by $1 + # to $2 in 2021 to 2023 (revised data). 2026 Medicare Trustees Report, + # transmitted 2026-06-09, retrieved 2026-10-11, sha256 # ffa56b9137006872300b0346149eae1613d09a172b6ba118aad48e66dfc48fa8; 2025 # report sha256 - # 1b3de7a4faeee5ad42059e10740603182b716a5fa7b53b30d360b45b9e474d95. + # 1b3de7a4faeee5ad42059e10740603182b716a5fa7b53b30d360b45b9e474d95; 2023 + # report retrieved 2026-11-07, sha256 + # 89daaf2909ae18648783f652c05114d007c5f902cc5fa5fad0f76d43f6ccfa67. # The average includes enrollees in institutions, whom CBO removes along # with their benefits (Habib 2018, file page 52). CBO's adjusted 2015 # totals, $22.6 billion for 10.7 million recipients (file page 51), give # $2,112 per recipient, the same as this table's 2015 average; for 2016 # CBO's $26.5 billion (from its own baseline) for 11.1 million gives # $2,387 against $2,126 here. - - title: 2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table IV.B9 - href: https://www.cms.gov/oact/tr/2026#page=158 + - title: "2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table IV.B9 #page 119,158" + href: https://www.cms.gov/oact/tr/2026#page=119 - title: 2025 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table IV.B9 href: https://www.cms.gov/oact/tr/2025#page=158 - - title: Habib, How CBO Adjusts for Survey Underreporting of Transfer Income in Its Distributional Analyses, CBO Working Paper 2018-07, Appendix C + - title: 2023 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table IV.B9 + href: https://www.cms.gov/oact/tr/2023#page=158 + - title: "Habib, How CBO Adjusts for Survey Underreporting of Transfer Income in Its Distributional Analyses, CBO Working Paper 2018-07, Appendix C #page 51-52" href: https://www.cbo.gov/system/files/2018-07/54234-workingpaper.pdf#page=51 values: # Historical. + 2013-01-01: 2_023 + 2014-01-01: 2_052 2015-01-01: 2_112 2016-01-01: 2_126 2017-01-01: 2_156 diff --git a/policyengine_us/tests/core/test_part_d_lis.py b/policyengine_us/tests/core/test_part_d_lis.py index fe4ed04cea7..3625a75940d 100644 --- a/policyengine_us/tests/core/test_part_d_lis.py +++ b/policyengine_us/tests/core/test_part_d_lis.py @@ -11,7 +11,8 @@ Parameters: 1. Transcription: ``low_income_subsidy_per_recipient`` equals Table IV.B9's - "Subsidy amount" (2026 report; the 2025 report for 2015). + "Subsidy amount" (2026 report; the 2025 report for 2015; the 2023 report + for 2013 and 2014). 2. Conservation: IV.B9 enrollment times the amount returns Table IV.B10's low-income subsidy payments, within the cells' rounding. 3. Differential: the same payments over Table V.B3's total enrollment equal @@ -23,8 +24,8 @@ amounts. SSA's published 2015 couple limit is $10 below the rule; the parameter keeps the published amount (an intended exception). 5. Bounds (Hypothesis): the amount per recipient is positive and below - Medicare spending per enrollee, and the limits never fall, in every year - from 2015 to 2100. + Medicare spending per enrollee in every year from 2013, the spending + series' first, to 2100, and the limits never fall. Households (a seeded sample in one shared simulation, each household also run with more Social Security, more interest and more assets): @@ -65,8 +66,12 @@ # 2026 Medicare Trustees Report (sha256 ffa56b91...8fa8), Table IV.B9 (file # page 158): low-income subsidy enrollment (millions) and subsidy amount ($). -# 2015 from the 2025 report (sha256 1b3de7a4...4d95), Table IV.B9 (page 158). +# 2015 from the 2025 report (sha256 1b3de7a4...4d95), Table IV.B9 (page 158); +# 2013 and 2014 from the 2023 report (sha256 89daaf29...fa67), Table IV.B9 +# (page 158). IV_B9 = { + 2013: (11.5, 2_023), + 2014: (11.8, 2_052), 2015: (12.1, 2_112), 2016: (12.4, 2_126), 2017: (12.7, 2_156), @@ -90,18 +95,23 @@ 2035: (16.7, 2_076), } # Table IV.B10 (file page 159), low-income subsidy, $ billions, incurred; -# 2015 from the 2025 report's Table IV.B10 (page 159). +# 2015 from the 2025 report's Table IV.B10 (page 159), 2013 and 2014 from the +# 2023 report's (page 159). IV_B10 = { + **{2013: 23.2, 2014: 24.3}, **{2015: 25.6, 2016: 26.4, 2017: 27.3, 2018: 28.5, 2019: 29.7, 2020: 33.0}, **{2021: 35.0, 2022: 39.4, 2023: 44.2, 2024: 41.2, 2025: 17.4, 2026: 18.1}, **{2027: 20.5, 2028: 22.1, 2029: 24.5, 2030: 28.9, 2031: 30.7, 2032: 31.7}, **{2033: 32.4, 2034: 33.3, 2035: 34.8}, } -# Table V.B3 (file page 196), total enrollment (HI and/or SMI), thousands. +# Table V.B3 (file page 196), total enrollment (HI and/or SMI), thousands; +# 2013 and 2014 from the 2021 report's Table V.B3 (sha256 ef3d1fa7...c8e, +# page 199), which the 2022 to 2026 reports drop. V_B3_TOTAL = dict( zip( - range(2015, 2036), - (55_589, 57_073, 58_683, 60_020, 61_535, 62_887, 63_980, 65_166) + range(2013, 2036), + (52_504, 54_115) + + (55_589, 57_073, 58_683, 60_020, 61_535, 62_887, 63_980, 65_166) + (66_606, 68_066, 69_289, 70_743, 72_322, 74_026, 75_436, 76_598) + (77_521, 78_327, 79_058, 79_827, 80_632), ) @@ -170,7 +180,7 @@ def test_resource_limits_follow_the_cpi_rule(kind): assert limit(f"{year}-01-01") == expected, year -@given(st.integers(2015, 2100)) +@given(st.integers(2013, 2100)) def test_amount_positive_and_below_spending(year): amount = _per_recipient(year) spending = P.calibration.gov.hhs.medicare.per_capita_cost(f"{year}-01-01") diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis.yaml index 6b00b321bd7..2402f73921b 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis.yaml @@ -1,5 +1,6 @@ # Each enrollee gets the Trustees' average subsidy per low-income subsidy -# enrollee (2026 report, Table IV.B9; 2015 from the 2025 report). +# enrollee (2026 report, Table IV.B9; 2015 from the 2025 report; 2013 and +# 2014 from the 2023 report). - name: Enrollee in 2026. period: 2026 @@ -19,6 +20,24 @@ output: part_d_lis: 2_112 +- name: Enrollee in 2013, the first year of the Medicare spending series. + period: 2013 + input: + people: + person: + part_d_lis_enrolled: true + output: + part_d_lis: 2_023 + +- name: Enrollee in 2014. + period: 2014 + input: + people: + person: + part_d_lis_enrolled: true + output: + part_d_lis: 2_052 + - name: Enrollee in 2024, before the Inflation Reduction Act redesign. period: 2024 input: From ff54d4a067f6ac3054fe11d8be7e3aac0151ec38 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 8 Nov 2026 01:05:59 -0500 Subject: [PATCH 21/35] Address the r2 law and code reviews (work in progress) - Index the resource limits after 2026 by the unrounded September CPI-U ratio (42 U.S.C. 1395w-114(a)(3)(E)(i)), and add September 2026's CPI-U. - Follow the statute's chain for the couple limit from 2015, entered as a source-conflict candidate against CMS's 2015 memo. - Count non-home real estate for the household head's couple, floor each income source at zero, count both returns' dependents for spouses who file separately, and document the auto-enrollment data contract. - Fix the per-recipient and jurisdiction citations. Co-Authored-By: Claude Opus 5.5 --- .../low_income_subsidy_per_recipient.yaml | 13 ++- .../gov/bls/cpi/cpi_u_nsa_september.yaml | 3 +- .../eligibility/ineligible_jurisdictions.yaml | 2 +- .../resources/household_sources.yaml | 29 +++++ .../eligibility/resources/limit/couple.yaml | 43 +++++-- .../resources/limit/individual.yaml | 13 ++- .../eligibility/resources/sources.yaml | 5 +- .../parameters/uprating_extensions.py | 105 +++++++++++++++--- .../part_d/low_income_subsidy/part_d_lis.py | 17 +-- .../part_d_lis_countable_income.py | 36 ++++-- .../low_income_subsidy/part_d_lis_enrolled.py | 18 ++- .../part_d_lis_family_size.py | 12 +- .../part_d_lis_resource_eligible.py | 24 +++- .../takes_up_part_d_lis_if_eligible.py | 5 +- source_conflicts/candidates.yaml | 41 +++++++ 15 files changed, 303 insertions(+), 63 deletions(-) create mode 100644 policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/household_sources.yaml diff --git a/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/low_income_subsidy_per_recipient.yaml b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/low_income_subsidy_per_recipient.yaml index 8ba1270ee3d..3fa0e50fd86 100644 --- a/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/low_income_subsidy_per_recipient.yaml +++ b/policyengine_us/parameters/calibration/gov/hhs/medicare/part_d/low_income_subsidy_per_recipient.yaml @@ -14,9 +14,10 @@ metadata: # 2016 to 2035 come from the 2026 report (file page 158); 2015, which that # table no longer shows, from the 2025 report (file page 158); 2013 and # 2014 from the 2023 report (file page 158), the newest that shows both, - # as for the per-enrollee series beside this one. The reports differ by $1 - # to $2 in 2021 to 2023 (revised data). 2026 Medicare Trustees Report, - # transmitted 2026-06-09, retrieved 2026-10-11, sha256 + # as for the per-enrollee series beside this one. The 2026 report moves + # 2021 to 2023 by $1 to $2 from the 2025 report, and 2024 by $15 ($2,848 + # in the 2025 report, $2,833 in the 2026 report). 2026 Medicare Trustees + # Report, transmitted 2026-06-09, retrieved 2026-10-11, sha256 # ffa56b9137006872300b0346149eae1613d09a172b6ba118aad48e66dfc48fa8; 2025 # report sha256 # 1b3de7a4faeee5ad42059e10740603182b716a5fa7b53b30d360b45b9e474d95; 2023 @@ -28,7 +29,7 @@ metadata: # $2,112 per recipient, the same as this table's 2015 average; for 2016 # CBO's $26.5 billion (from its own baseline) for 11.1 million gives # $2,387 against $2,126 here. - - title: "2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table IV.B9 #page 119,158" + - title: "2026 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Tables IV.B9 and IV.B10 #page 119,158-159" href: https://www.cms.gov/oact/tr/2026#page=119 - title: 2025 Annual Report of the Boards of Trustees of the Federal Hospital Insurance and Federal Supplementary Medical Insurance Trust Funds, Table IV.B9 href: https://www.cms.gov/oact/tr/2025#page=158 @@ -51,8 +52,8 @@ values: 2023-01-01: 3_092 2024-01-01: 2_833 # 2025 is the first year of the full Inflation Reduction Act benefit - # redesign (2026 report, file page 119), which moved spending from the - # subsidy to the direct subsidy (Table IV.B9). + # redesign (2026 report, file page 119). The average falls from $2,833 in + # 2024 to $1,226 in 2025; the report gives no cause. 2025-01-01: 1_226 # Trustees' intermediate estimates. 2026-01-01: 1_254 diff --git a/policyengine_us/parameters/gov/bls/cpi/cpi_u_nsa_september.yaml b/policyengine_us/parameters/gov/bls/cpi/cpi_u_nsa_september.yaml index 738737b408f..555a2337d3e 100644 --- a/policyengine_us/parameters/gov/bls/cpi/cpi_u_nsa_september.yaml +++ b/policyengine_us/parameters/gov/bls/cpi/cpi_u_nsa_september.yaml @@ -1,4 +1,4 @@ -description: The Bureau of Labor Statistics publishes this September value of the Consumer Price Index for All Urban Consumers, not seasonally adjusted, from which CMS takes the September-to-September percentage change it applies to the Medicaid long-term care home equity limits. +description: The Bureau of Labor Statistics publishes this September value of the Consumer Price Index for All Urban Consumers, not seasonally adjusted, from which CMS takes the September-to-September change it applies to the Medicaid long-term care home equity limits and the Medicare Part D low-income subsidy resource limits. values: # BLS series CUUR0000SA0 (U.S. city average, all items, 1982-84=100). 2018-09-01: 252.439 @@ -9,6 +9,7 @@ values: 2023-09-01: 307.789 2024-09-01: 315.301 2025-09-01: 324.8 + 2026-09-01: 336.94 metadata: unit: currency-USD label: CPI-U, not seasonally adjusted, September diff --git a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/ineligible_jurisdictions.yaml b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/ineligible_jurisdictions.yaml index 150028aac86..5dafce4b320 100644 --- a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/ineligible_jurisdictions.yaml +++ b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/ineligible_jurisdictions.yaml @@ -22,4 +22,4 @@ metadata: - title: 42 CFR § 423.772 - Definitions (State) href: https://www.ecfr.gov/current/title-42/chapter-IV/subchapter-B/part-423/subpart-P/section-423.772 - title: 20 CFR § 418.3010(b)(11) - Definitions (State) - href: https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-A/section-418.3010#p-418.3010(b)(11) + href: https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3010#p-418.3010(b)(11) diff --git a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/household_sources.yaml b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/household_sources.yaml new file mode 100644 index 00000000000..e7320981b42 --- /dev/null +++ b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/household_sources.yaml @@ -0,0 +1,29 @@ +description: Medicare counts these household assets as resources of the household head and spouse under the Part D low-income subsidy. +values: + 2006-01-01: + - household_other_real_estate_equity + +metadata: + unit: list + period: year + label: Medicare Part D low-income subsidy countable household resource sources + reference: + # Equity in real property other than the home counts, whether or not it + # can be sold within 20 workdays. The model holds real estate equity by + # household, so the formula counts it for the household head's couple. + # Rental property equity (household_rental_property_equity) is left out: + # property essential to self-support is excluded (418.3425(c) and (d)), + # rental property used in a trade or business in full and other + # income-producing property up to $6,000 of equity when it returns 6% a + # year (POMS SI 01130.501 and SI 01130.500), and the model can't tell + # which applies. + - title: 20 CFR § 418.3405(b) - What types of resources do we count? + href: https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3405#p-418.3405(b) + - title: 20 CFR § 418.3425 - What resources do we exclude from counting? + href: https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3425 + - title: 42 CFR § 423.772 - Definitions (resources) + href: https://www.ecfr.gov/current/title-42/chapter-IV/subchapter-B/part-423/subpart-P/section-423.772 + - title: SSA POMS SI 01130.501 - Essential Property Excluded Regardless of Value or Rate of Return + href: https://secure.ssa.gov/poms.nsf/lnx/0501130501 + - title: SSA POMS SI 01130.500 - Property Essential to Self-Support - Overview + href: https://secure.ssa.gov/poms.nsf/lnx/0501130500 diff --git a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/limit/couple.yaml b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/limit/couple.yaml index fd07ec6bf55..454dfc127cb 100644 --- a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/limit/couple.yaml +++ b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/limit/couple.yaml @@ -8,22 +8,31 @@ values: 2012-01-01: 23_120 2013-01-01: 23_580 2014-01-01: 23_860 - 2015-01-01: 24_250 - 2017-01-01: 24_600 - 2018-01-01: 25_150 - 2019-01-01: 25_720 - 2020-01-01: 26_160 - 2021-01-01: 26_520 - 2022-01-01: 27_950 - 2023-01-01: 30_240 - 2024-01-01: 31_360 - 2025-01-01: 32_130 - 2026-01-01: 33_100 + # From 2015 the statute's formula, which runs $10 to $20 above SSA's + # published amounts (see the note under reference). + # Candidate: us:part-d-lis-couple-resource-limit-2015 until registered. + 2015-01-01: 24_260 + 2017-01-01: 24_620 + 2018-01-01: 25_170 + 2019-01-01: 25_740 + 2020-01-01: 26_180 + 2021-01-01: 26_540 + 2022-01-01: 27_970 + 2023-01-01: 30_260 + 2024-01-01: 31_380 + 2025-01-01: 32_150 + 2026-01-01: 33_120 metadata: unit: currency-USD period: year label: Medicare Part D low-income subsidy couple resource limit + # Years after the last value here are projected in + # parameters/uprating_extensions.py (extend_part_d_lis_resource_limits): the + # previous year's limit times the change in the not seasonally adjusted + # CPI-U from September two years before to September one year before, + # never lowered, rounded to the nearest $10, effective January 1. The + # published September 2026 index gives $34,360 for 2027. reference: # The statute's alternative resource standard: $20,000 in 2006, raised # each year by the September CPI-U and rounded to $10. Before 2024 it was @@ -32,9 +41,21 @@ metadata: # table lists both pre-2024 limits; these are the higher ones. SSA's table # excludes the $3,000 couple burial funds exclusion, which is a separate # parameter. + # + # Through 2014 these are SSA's amounts. For 2015, CMS's memo multiplies + # the 2014 limit of $23,860 by 1.01658 (238.031 / 234.149) and rounds to + # $10, which gives $24,260 ($24,255.58 unrounded), but it prints $24,250, + # and SSA has raised its own previous amount each year since. The values + # here apply the formula to the previous year's limit as the statute + # sets it, so they are $10 above SSA's in 2015 and 2016 and $20 above + # from 2017 ($33,120 against $33,100 in 2026). - title: 42 U.S.C. § 1395w-114(a)(3)(E)(i) - Alternative resource standard href: https://www.law.cornell.edu/uscode/text/42/1395w-114#a_3_E_i - title: 42 CFR § 423.773(b)(2)(iii) and (d)(2) - Resource thresholds href: https://www.ecfr.gov/current/title-42/chapter-IV/subchapter-B/part-423/subpart-P/section-423.773#p-423.773(d)(2) - title: SSA POMS HI 03030.025 - Resource Limits for Subsidy Eligibility href: https://secure.ssa.gov/poms.nsf/lnx/0603030025 + - title: CMS, 2015 Medicare Part D Low-Income Subsidy (LIS) Income and Resource Standards, Attachment 4 + href: https://www.cms.gov/files/document/2015-lis-income-and-resourcespdf#page=5 + - title: CMS, Calendar Year (CY) 2026 Resource and Cost-Sharing Limits for Low-Income Subsidy (LIS), October 31, 2025 + href: https://www.cms.gov/files/document/cy2026-lis-resource-limits-memo.pdf#page=2 diff --git a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/limit/individual.yaml b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/limit/individual.yaml index 54fc4010afd..b24f6e8167c 100644 --- a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/limit/individual.yaml +++ b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/limit/individual.yaml @@ -1,4 +1,4 @@ -description: Medicare limits the Part D low-income subsidy to unmarried people whose countable resources do not exceed this amount, before the burial funds exclusion. +description: Medicare limits the Part D low-income subsidy to people who are not married and living with a spouse whose countable resources do not exceed this amount, before the burial funds exclusion. values: 2006-01-01: 10_000 2007-01-01: 10_210 @@ -24,6 +24,12 @@ metadata: unit: currency-USD period: year label: Medicare Part D low-income subsidy individual resource limit + # Years after the last value here are projected in + # parameters/uprating_extensions.py (extend_part_d_lis_resource_limits): the + # previous year's limit times the change in the not seasonally adjusted + # CPI-U from September two years before to September one year before, + # never lowered, rounded to the nearest $10, effective January 1. The + # published September 2026 index gives $17,210 for 2027. reference: # The statute's alternative resource standard: $10,000 in 2006, raised # each year by the September CPI-U and rounded to $10. Before 2024 it was @@ -31,10 +37,13 @@ metadata: # from 2024 it is the limit for the full subsidy, the only one left. SSA's # table lists both pre-2024 limits; these are the higher ones. SSA's table # excludes the $1,500 burial funds exclusion, which is a separate - # parameter. + # parameter. A person who is married but separated from their spouse + # counts only their own resources against this limit (20 CFR 418.3410(b)). - title: 42 U.S.C. § 1395w-114(a)(3)(E)(i) - Alternative resource standard href: https://www.law.cornell.edu/uscode/text/42/1395w-114#a_3_E_i - title: 42 CFR § 423.773(b)(2)(iii) and (d)(2) - Resource thresholds href: https://www.ecfr.gov/current/title-42/chapter-IV/subchapter-B/part-423/subpart-P/section-423.773#p-423.773(d)(2) - title: SSA POMS HI 03030.025 - Resource Limits for Subsidy Eligibility href: https://secure.ssa.gov/poms.nsf/lnx/0603030025 + - title: CMS, Calendar Year (CY) 2026 Resource and Cost-Sharing Limits for Low-Income Subsidy (LIS), October 31, 2025 + href: https://www.cms.gov/files/document/cy2026-lis-resource-limits-memo.pdf#page=2 diff --git a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/sources.yaml b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/sources.yaml index e85f02bcbf8..f427dbed12a 100644 --- a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/sources.yaml +++ b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/sources.yaml @@ -12,8 +12,9 @@ metadata: reference: # SSA counts liquid resources (cash, financial accounts, stocks, bonds, # mutual funds, retirement accounts and similar) and equity in real - # property other than the home. The model has no retirement account or - # non-home real property inputs. + # property other than the home. The model has no retirement account + # balances. Real estate is a household amount in the model, so it is in + # household_sources.yaml. - title: 20 CFR § 418.3405 - What types of resources do we count? href: https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3405 - title: 42 CFR § 423.772 - Definitions (resources) diff --git a/policyengine_us/parameters/uprating_extensions.py b/policyengine_us/parameters/uprating_extensions.py index 37caa4f6256..c8c57ed895a 100644 --- a/policyengine_us/parameters/uprating_extensions.py +++ b/policyengine_us/parameters/uprating_extensions.py @@ -575,6 +575,28 @@ def extend_la_cpi_u_indexed_amounts(parameters: ParameterNode, end_year: int) -> ) +def get_september_cpi_u_values(cpi: ParameterNode, year: int) -> Tuple[float, float]: + """The CPI-U for September two years and one year before ``year``. + + CMS indexes the Medicaid home equity limits and the Part D low-income + subsidy resource limits for ``year`` by the change from September of + ``year - 2`` to September of ``year - 1`` in the not seasonally adjusted + CPI-U. ``cpi`` is the ``gov.bls.cpi`` node. The published Septembers in + ``cpi_u_nsa_september`` are used when both are available. Otherwise both + Septembers come from the model's CPI-U series (seasonally adjusted from + January 2024) through ``get_projected_cpi_u_for_month``, so the two are + never mixed. Returns ``(prior September, later September)``. + """ + september = cpi.cpi_u_nsa_september + published = {int(value.instant_str[:4]) for value in september.values_list} + if {year - 2, year - 1} <= published: + return september(f"{year - 2}-09-01"), september(f"{year - 1}-09-01") + return ( + get_projected_cpi_u_for_month(cpi.cpi_u, instant(f"{year - 2}-09-01")), + get_projected_cpi_u_for_month(cpi.cpi_u, instant(f"{year - 1}-09-01")), + ) + + def get_cms_cpi_u_percentage_increase(cpi: ParameterNode, year: int) -> float: """The CPI-U percentage increase CMS applies to ``year``'s home equity limits. @@ -591,20 +613,10 @@ def get_cms_cpi_u_percentage_increase(cpi: ParameterNode, year: int) -> float: A fall in the index is not an increase, so the percentage is never negative. - ``cpi`` is the ``gov.bls.cpi`` node. The published Septembers in - ``cpi_u_nsa_september`` are used when both are available. Otherwise both - Septembers come from the model's CPI-U series (seasonally adjusted from - January 2024) through ``get_projected_cpi_u_for_month``, so the two are - never mixed. + ``cpi`` is the ``gov.bls.cpi`` node; see ``get_september_cpi_u_values`` + for where the Septembers come from. """ - september = cpi.cpi_u_nsa_september - published = {int(value.instant_str[:4]) for value in september.values_list} - if {year - 2, year - 1} <= published: - current = september(f"{year - 1}-09-01") - prior = september(f"{year - 2}-09-01") - else: - current = get_projected_cpi_u_for_month(cpi.cpi_u, instant(f"{year - 1}-09-01")) - prior = get_projected_cpi_u_for_month(cpi.cpi_u, instant(f"{year - 2}-09-01")) + prior, current = get_september_cpi_u_values(cpi, year) change = 100 * (Decimal(repr(current)) / Decimal(repr(prior)) - 1) percentage = change.quantize(Decimal("0.1"), rounding=ROUND_HALF_UP) return float(max(percentage, 0)) @@ -674,6 +686,67 @@ def extend_medicaid_home_equity_limits( ) +def adjust_part_d_lis_resource_limit_for_inflation( + prior_limit: float, prior_september: float, current_september: float +) -> float: + """Raise a Part D low-income subsidy resource limit for one year. + + 42 U.S.C. 1395w-114(a)(3)(E)(i)(II) and 42 CFR 423.773(d)(2)(ii) increase + the previous year's limit "by the annual percentage increase in the + consumer price index (all items, U.S. city average) as of September of + the previous year, rounded to the nearest multiple of $10". The increase + is the unrounded ratio of the two Septembers. CMS's CY 2026 memo reports + it as 3.01% (324.800 / 315.301), but the published $16,590 is $16,100 + times the unrounded 1.030127 ($16,585.04), where 1.0301 would give + $16,584.61 and so $16,580. A fall in the index is not an increase, so the + limit never falls: SSA kept the 2009 and 2015 limits for 2010 and 2016. + The arithmetic is decimal, with halves rounding up, so a product that + ends in exactly $5 rounds up as it does on paper. + """ + ratio = max( + Decimal(str(float(current_september))) / Decimal(str(float(prior_september))), + 1, + ) + adjusted = Decimal(str(float(prior_limit))) * ratio + tens = (adjusted / 10).quantize(Decimal(1), rounding=ROUND_HALF_UP) + return float(tens * 10) + + +def extend_part_d_lis_resource_limits(parameters: ParameterNode, end_year: int) -> None: + """Project the CPI-indexed Part D low-income subsidy resource limits. + + Each year after the last value in the YAML, the individual and couple + limits each become the previous year's limit raised by the change from + September two years before to September one year before (see + ``get_september_cpi_u_values``), never lowered, and rounded to the + nearest $10 (see ``adjust_part_d_lis_resource_limit_for_inflation``), + effective January 1. Amounts encoded in the YAML take precedence for + their own years. + + Like the other projections in this module, the values are fixed when the + parameter tree is built: a reform that changes one year's limit does not + carry through to later years. + """ + limits = parameters.gov.hhs.medicare.part_d.low_income_subsidy.eligibility.resources.limit + cpi = parameters.gov.bls.cpi + for limit in (limits.individual, limits.couple): + first_projected_year = 1 + max( + int(value.instant_str[:4]) for value in limit.values_list + ) + for year in range(first_projected_year, end_year + 1): + prior_september, current_september = get_september_cpi_u_values(cpi, year) + limit.update( + period=f"year:{year}-01-01:1", + value=adjust_part_d_lis_resource_limit_for_inflation( + limit(f"{year - 1}-01-01"), prior_september, current_september + ), + ) + limit.update( + start=instant(f"{end_year}-01-01"), + value=limit(f"{end_year}-01-01"), + ) + + def extend_wa_millionaires_standard_deduction( parameters: ParameterNode, end_year: int, @@ -1222,6 +1295,12 @@ def set_all_uprating_parameters(parameters: ParameterNode) -> ParameterNode: # Medicaid long-term care home equity limits, CMS's rounded CPI-U method extend_medicaid_home_equity_limits(parameters, end_year=END_YEAR) + # Part D low-income subsidy resource limits, raised by the unrounded + # September-to-September CPI-U change under 42 U.S.C. + # 1395w-114(a)(3)(E)(i). Must run after the CPI-U extension above so + # projected Septembers are available. + extend_part_d_lis_resource_limits(parameters, end_year=END_YEAR) + # The limits on a dependent's standard deduction follow 26 U.S.C. # 63(c)(4)'s chained CPI-U schedule, computed from the statutory 1987 and # 1997 bases. Must run after the Chained CPI-U extension above so diff --git a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis.py b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis.py index aa3d928ddea..b9cd12f3fbc 100644 --- a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis.py +++ b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis.py @@ -6,11 +6,15 @@ class part_d_lis(Variable): entity = Person label = "Medicare Part D low-income subsidy" documentation = ( - "Value of the Part D low-income subsidy (Extra Help) as the " - "Congressional Budget Office counts it: the Medicare Trustees' " - "average subsidy payment per subsidy enrollee, the same for every " - "enrollee. Most of the subsidy pays cost sharing, which depends on " - "each enrollee's drug use, which the model does not have." + "Value of the Part D low-income subsidy (Extra Help): the Medicare " + "Trustees' average subsidy payment per subsidy enrollee, the same for " + "every enrollee, which is how the Congressional Budget Office values " + "it. Most of the subsidy pays cost sharing, which depends on each " + "enrollee's drug use, which the model does not have. Recipients " + "differ from CBO's: CBO draws them at random from the eligible " + "population until they match the administrative count, while the " + "model pays every eligible person in a Part D plan who is on " + "Medicaid or SSI or takes the subsidy up." ) unit = USD definition_period = YEAR @@ -24,5 +28,4 @@ class part_d_lis(Variable): def formula(person, period, parameters): p = parameters(period).calibration.gov.hhs.medicare.part_d - enrolled = person("part_d_lis_enrolled", period) - return enrolled * p.low_income_subsidy_per_recipient + return person.filled_array(p.low_income_subsidy_per_recipient) diff --git a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_income.py b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_income.py index 686665bd8a5..d8c0e1faf92 100644 --- a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_income.py +++ b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_income.py @@ -12,9 +12,14 @@ class part_d_lis_countable_income(Variable): "Annual countable income for the Part D low-income subsidy: the " "Supplemental Security Income definition of income, for the person " "and a spouse living with them, without in-kind support and " - "maintenance or interest and dividends. The $20 general, $65 earned " - "and one-half earned income exclusions apply once to the combined " - "income." + "maintenance or interest and dividends. Each unearned source counts " + "for each person at no less than zero, so a rental loss does not " + "offset other income. The $20 general, $65 earned and one-half " + "earned income exclusions apply once to the combined income. Not " + "modeled: the Social Security cost-of-living increase, which SSA " + "leaves out through the month after the new poverty guidelines are " + "published (20 CFR 418.3340(f)); the model counts the year's " + "benefits in full." ) unit = USD definition_period = YEAR @@ -23,18 +28,33 @@ class part_d_lis_countable_income(Variable): "https://www.ecfr.gov/current/title-42/chapter-IV/subchapter-B/part-423/subpart-P/section-423.772", "https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3310", "https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3325", + "https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3335", + "https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3340#p-418.3340(f)", "https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3350", "https://secure.ssa.gov/poms.nsf/lnx/0603020050", + "https://secure.ssa.gov/poms.nsf/lnx/0500830505", ) def formula(person, period, parameters): - p = parameters(period).gov.hhs.medicare.part_d.low_income_subsidy.income + p = parameters(period) + excluded = p.gov.hhs.medicare.part_d.low_income_subsidy.income.excluded_sources + # SSI's unearned income sources without the ones the subsidy excludes, + # so a change to SSI's list carries through and an excluded source is + # never subtracted when SSI no longer counts it. + sources = [ + source + for source in p.gov.ssa.ssi.income.sources.unearned + if source not in excluded + ] + # SSI counts net rental income, and expenses above the rent do not + # offset other income (POMS SI 00830.505), so no source counts below + # zero, for either spouse. + unearned = person.filled_array(0.0) + for source in sources: + unearned = unearned + max_(person(source, period), 0) earned = person("ssi_earned_income", period) - unearned = person("ssi_unearned_income", period) - add( - person, period, p.excluded_sources - ) # A spouse's income counts whether or not the spouse applies or is # eligible, and the exclusions apply once to the couple's income. couple_earned = person.marital_unit.sum(earned) - couple_unearned = max_(person.marital_unit.sum(unearned), 0) + couple_unearned = person.marital_unit.sum(unearned) return _apply_ssi_exclusions(couple_earned, couple_unearned, parameters, period) diff --git a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.py b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.py index 8b23b2be7e2..c85ec1c9080 100644 --- a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.py +++ b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.py @@ -7,17 +7,25 @@ class part_d_lis_enrolled(Variable): label = "Enrolled in the Medicare Part D low-income subsidy" documentation = ( "Medicare pays the subsidy only for people enrolled in a Part D plan " - "(medicare_part_d_enrolled). It enrolls Medicaid enrollees and " - "Supplemental Security Income recipients in a plan with the subsidy " - "without an application, unless they opt out of Part D. Other " - "eligible people in a Part D plan receive it if they take it up." + "(medicare_part_d_enrolled). Medicaid enrollees and Supplemental " + "Security Income recipients get the subsidy without applying; other " + "eligible people in a plan get it if they take it up. CMS enrolls " + "subsidy-eligible people who don't choose a plan, unless they " + "decline Part D or are qualifying covered retirees whose employer " + "gets the retiree drug subsidy (42 CFR 423.34(d) and (e)). So " + "microdata that set takes_up_medicare_part_d_if_eligible should set " + "it true for Medicaid enrollees and SSI recipients other than those " + "two groups; a person whose Part D input is false gets no subsidy. " + "Not modeled: people deemed eligible from July to December stay " + "deemed eligible through the following year (423.773(c)(2)(ii)); the " + "model tests each year on its own." ) definition_period = YEAR reference = ( "https://www.law.cornell.edu/uscode/text/42/1395w-114#a_3_A", "https://www.ecfr.gov/current/title-42/chapter-IV/subchapter-B/part-423/subpart-P/section-423.773#p-423.773(c)(2)", "https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3101", - "https://www.ecfr.gov/current/title-42/chapter-IV/subchapter-B/part-423/subpart-B/section-423.34", + "https://www.ecfr.gov/current/title-42/chapter-IV/subchapter-B/part-423/subpart-B/section-423.34#p-423.34(d)", ) defined_for = "part_d_lis_eligible" diff --git a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_family_size.py b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_family_size.py index 9e5a9bf72b8..c33a393542e 100644 --- a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_family_size.py +++ b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_family_size.py @@ -8,8 +8,9 @@ class part_d_lis_family_size(Variable): documentation = ( "The person, a spouse living with them, and relatives living with " "them who depend on the person or spouse for at least half of their " - "support, approximated by the dependents of the tax unit the person " - "heads or is the spouse in." + "support, approximated by the dependents on the couple's tax " + "returns: a joint return's dependents count once, and when the " + "spouses file separately, the dependents on both returns count." ) definition_period = YEAR reference = ( @@ -19,6 +20,9 @@ class part_d_lis_family_size(Variable): def formula(person, period, parameters): couple_size = person.marital_unit.nb_persons() - head_or_spouse = person("is_tax_unit_head_or_spouse", period) + # Each tax unit's dependents count once, through the unit's head: on a + # joint return the couple has one head, and spouses who file + # separately each head their own return. + head = person("is_tax_unit_head", period) dependents = person.tax_unit("tax_unit_dependents", period) - return couple_size + where(head_or_spouse, dependents, 0) + return couple_size + person.marital_unit.sum(where(head, dependents, 0)) diff --git a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.py b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.py index fe7e0580493..16f82e95acc 100644 --- a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.py +++ b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.py @@ -8,12 +8,15 @@ class part_d_lis_resource_eligible(Variable): documentation = ( "Countable resources of the person and a spouse living with them do " "not exceed the individual or couple limit plus the burial funds " - "exclusion for each of them." + "exclusion for each of them. Resources are the couple's financial " + "assets and, for the household head's couple, the household's " + "equity in real estate other than the home." ) definition_period = YEAR reference = ( "https://www.law.cornell.edu/uscode/text/42/1395w-114#a_3_E", "https://www.ecfr.gov/current/title-42/chapter-IV/subchapter-B/part-423/subpart-P/section-423.773#p-423.773(d)(2)", + "https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3405", "https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3410", "https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3425", "https://secure.ssa.gov/poms.nsf/lnx/0603030025", @@ -23,7 +26,24 @@ def formula(person, period, parameters): p = parameters( period ).gov.hhs.medicare.part_d.low_income_subsidy.eligibility.resources - resources = person.marital_unit.sum(add(person, period, p.sources)) + own = add(person, period, p.sources) + # A household amount does not say whose it is. It counts in full for + # the marital unit of the household head (the oldest member when no + # head is designated), so it counts for one couple. + is_household_head = person("is_household_head", period) + has_household_head = person.household.any(is_household_head) + age = person("age", period) + holds_household_amount = where( + has_household_head, + person.get_rank(person.household, -age, condition=is_household_head) == 0, + person.get_rank(person.household, -age) == 0, + ) + household_amount = person.filled_array(0.0) + for source in p.household_sources: + household_amount = household_amount + person.household(source, period) + resources = person.marital_unit.sum( + own + holds_household_amount * household_amount + ) couple_size = person.marital_unit.nb_persons() limit = where(couple_size == 2, p.limit.couple, p.limit.individual) return resources <= limit + p.burial_exclusion * couple_size diff --git a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/takes_up_part_d_lis_if_eligible.py b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/takes_up_part_d_lis_if_eligible.py index adad6dfb5a3..3d4e8172bd7 100644 --- a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/takes_up_part_d_lis_if_eligible.py +++ b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/takes_up_part_d_lis_if_eligible.py @@ -13,7 +13,10 @@ class takes_up_part_d_lis_if_eligible(Variable): "Medicare Savings Program enrollees are deemed eligible, but the " "model has Medicare Savings Program eligibility, not enrollment, so " "this flag covers them too. The subsidy also requires enrollment in " - "a Part D plan (medicare_part_d_enrolled)." + "a Part D plan (medicare_part_d_enrolled), which CMS arranges for " + "subsidy-eligible people who don't choose one unless they decline " + "(42 CFR 423.34). The default, true, takes everyone up; microdata " + "can set a take-up rate." ) definition_period = YEAR default_value = True diff --git a/source_conflicts/candidates.yaml b/source_conflicts/candidates.yaml index 6b1dbcbedc4..1c00c91928e 100644 --- a/source_conflicts/candidates.yaml +++ b/source_conflicts/candidates.yaml @@ -11236,6 +11236,47 @@ candidates: state: unreviewed note: 'Main follows the form-line omission; the statute-first rule requires the statutory add-back proposed in the open PR. Code not yet on main: excess_business_loss, net_investment_income_excess_business_loss, gov.irs.investment.income.sources.' +- id: us:part-d-lis-couple-resource-limit-2015 + program: medicare-part-d-low-income-subsidy + years: + from: 2015 + type: calendar + question: Is the 2015 couple resource limit for the Part D low-income subsidy $24,260, the statute's formula applied + to the 2014 limit, or the $24,250 that CMS and SSA published; and does each later limit build on the formula's + amount or on the published one? + sources: + - kind: statute + citation: 42 U.S.C. 1395w-114(a)(3)(E)(i) + url: https://www.law.cornell.edu/uscode/text/42/1395w-114#a_3_E_i + - kind: regulation + citation: 42 CFR 423.773(d)(2)(ii) + url: https://www.ecfr.gov/current/title-42/chapter-IV/subchapter-B/part-423/subpart-P/section-423.773#p-423.773(d)(2)(ii) + - kind: guidance + citation: CMS, 2015 Medicare Part D Low-Income Subsidy (LIS) Income and Resource Standards, Attachment 4, PDF pp. 5-6 + url: https://www.cms.gov/files/document/2015-lis-income-and-resourcespdf#page=5 + - kind: manual + citation: SSA POMS HI 03030.025, resource limits for prior years + url: https://secure.ssa.gov/poms.nsf/lnx/0603030025 + readings: + statute: The 2014 limit of $23,860 increased by the September 2013 to September 2014 CPI-U change (238.031 / + 234.149) is $24,255.58, which rounds to $24,260. Each later year raises the previous year's limit as the formula + sets it, giving $24,620 in 2017 and $33,120 in 2026. + other: CMS's memo gives the 1.01658 factor and the rounding to $10 but prints $24,250, and POMS lists $24,250 for + 2015 and 2016. SSA raises its own published amount each later year, giving $24,600 in 2017 and $33,100 in 2026. + example: In 2026 a married couple with $36,110 of countable resources and the burial funds exclusion meets the + statutory limit of $33,120 plus $3,000 but not SSA's $33,100 plus $3,000. + pe_us: + follows: statute + code: + - policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/limit/couple.yaml + prs: + - https://github.com/PolicyEngine/policyengine-us/pull/10127 + state: ruled + note: Every other higher (partial subsidy, then full subsidy) limit SSA published from 2007 to 2026 equals the + formula applied to the previous published limit, and the memo's 1.01658 factor reproduces its other 2015 amounts ($7,280, $10,930 and + $12,140), so the $24,250 is the one cell the stated method doesn't produce. The model applies the formula as the + statute and 423.773(d)(2)(ii) state it, from the statute's 2006 amount of $20,000. The difference reaches only + couples whose countable resources fall within $10 to $20 of the limit. - id: us:recovery-rebate-joint-claimable-spouse program: recovery-rebate-credit years: From 33cc03d7f7f43a8aed0a87fbd77b274a89fbfdcb Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 8 Nov 2026 01:24:24 -0500 Subject: [PATCH 22/35] Count the subsidy as a health benefit and test the review fixes - Add part_d_lis next to msp_cost in household_health_benefits and healthcare_benefit_value, which count only when include_health_benefits_in_net_income is on. - YAML cases for the indexed 2027 limits, the statutory couple limit, non-home real estate and its attribution, rental losses, separate filers' family size and the Part D input of Medicaid enrollees. - Python tests: the CPI rule through 2027 with no published exception, projected years and a synthetic tree for the extension, exhaustive loops for the bounds, and a sample with separate filers, rental losses, real estate and households on each limit, plus a reach check. - Move the registry entry to the HHS block and fix its notes. - Read only September instants as published CPI-U values. Co-Authored-By: Claude Opus 5.5 --- changelog.d/medicare-part-d-lis.added.md | 2 +- .../household/household_health_benefits.yaml | 1 + .../parameters/uprating_extensions.py | 8 +- policyengine_us/programs.yaml | 39 +- policyengine_us/tests/core/test_part_d_lis.py | 544 ++++++++++++++---- .../low_income_subsidy/integration.yaml | 134 ++++- .../part_d_lis_countable_income.yaml | 40 ++ .../part_d_lis_enrolled.yaml | 18 + .../part_d_lis_family_size.yaml | 54 ++ .../part_d_lis_resource_eligible.yaml | 98 +++- .../household/healthcare_benefit_value.yaml | 10 + .../household/household_health_benefits.yaml | 24 + .../household/healthcare_benefit_value.py | 5 +- 13 files changed, 842 insertions(+), 135 deletions(-) diff --git a/changelog.d/medicare-part-d-lis.added.md b/changelog.d/medicare-part-d-lis.added.md index b37702d66bd..52e90cc1e3a 100644 --- a/changelog.d/medicare-part-d-lis.added.md +++ b/changelog.d/medicare-part-d-lis.added.md @@ -1 +1 @@ -Model the Medicare Part D low-income subsidy (Extra Help): statutory eligibility valued at the Trustees' average subsidy per enrollee, and count it as a CBO means-tested transfer. +Model the Medicare Part D low-income subsidy (Extra Help): statutory eligibility, with CPI-indexed resource limits, valued at the Trustees' average subsidy per subsidy enrollee for people in a Part D plan; count it as a CBO means-tested transfer and a household health benefit. diff --git a/policyengine_us/parameters/gov/household/household_health_benefits.yaml b/policyengine_us/parameters/gov/household/household_health_benefits.yaml index ba051538c04..6943f21e6cb 100644 --- a/policyengine_us/parameters/gov/household/household_health_benefits.yaml +++ b/policyengine_us/parameters/gov/household/household_health_benefits.yaml @@ -3,6 +3,7 @@ values: 2022-01-01: - medicaid_cost - msp_cost + - part_d_lis - chip - assigned_aca_ptc - assigned_ca_premium_subsidy diff --git a/policyengine_us/parameters/uprating_extensions.py b/policyengine_us/parameters/uprating_extensions.py index c8c57ed895a..41bfb651905 100644 --- a/policyengine_us/parameters/uprating_extensions.py +++ b/policyengine_us/parameters/uprating_extensions.py @@ -588,7 +588,13 @@ def get_september_cpi_u_values(cpi: ParameterNode, year: int) -> Tuple[float, fl never mixed. Returns ``(prior September, later September)``. """ september = cpi.cpi_u_nsa_september - published = {int(value.instant_str[:4]) for value in september.values_list} + # Only September instants are BLS values; the parameter tree also + # backdates the first value to 2015-01-01. + published = { + int(value.instant_str[:4]) + for value in september.values_list + if value.instant_str.endswith("-09-01") + } if {year - 2, year - 1} <= published: return september(f"{year - 2}-09-01"), september(f"{year - 1}-09-01") return ( diff --git a/policyengine_us/programs.yaml b/policyengine_us/programs.yaml index f2c2728175a..c5a9a1e6ca8 100644 --- a/policyengine_us/programs.yaml +++ b/policyengine_us/programs.yaml @@ -383,6 +383,28 @@ programs: parameter_prefix: gov.aca verified_start_year: 2024 + - id: medicare_part_d_lis + name: Medicare Part D Extra Help + full_name: Medicare Part D Low-Income Subsidy (Extra Help) + category: Healthcare + agency: HHS + status: partial + coverage: US + variable: part_d_lis + parameter_prefix: gov.hhs.medicare.part_d.low_income_subsidy + verified_start_year: 2015 + notes: >- + Models eligibility (countable income below 150% of the poverty + guideline and resources within the CPI-indexed limits, or deemed + eligibility for Medicaid enrollees, SSI recipients and people eligible + for a Medicare Savings Program) and pays the subsidy only to people in + a Part D plan: Medicaid enrollees and SSI recipients get it without + applying, and other eligible people take it up through + takes_up_part_d_lis_if_eligible, which defaults to true. Each enrollee + gets the Medicare Trustees' average payment per subsidy enrollee, the + amount CBO assigns each recipient; the premium and cost-sharing + subsidies are not computed per person. + - id: tanf name: TANF full_name: Temporary Assistance for Needy Families @@ -1718,23 +1740,6 @@ programs: adjustments; gross Part B premium calibration should use the enrollment-gated gross_medicare_part_b_premium_if_enrolled variable. - - id: medicare_part_d_lis - name: Medicare Part D Extra Help - full_name: Medicare Part D Low-Income Subsidy (Extra Help) - category: Healthcare - agency: HHS - status: partial - coverage: US - variable: part_d_lis - parameter_prefix: gov.hhs.medicare.part_d.low_income_subsidy - verified_start_year: 2015 - notes: >- - Models eligibility (countable income below 150% of the poverty guideline, - resource limits, and deemed eligibility for Medicaid and SSI recipients - and Medicare Savings Program enrollees) and values the subsidy at the - Medicare Trustees' average payment per subsidy enrollee, as CBO does; - the premium and cost-sharing subsidies are not computed per person. - # --- HUD programs --- - id: section_8 name: Section 8 diff --git a/policyengine_us/tests/core/test_part_d_lis.py b/policyengine_us/tests/core/test_part_d_lis.py index 3625a75940d..f892a84dbd6 100644 --- a/policyengine_us/tests/core/test_part_d_lis.py +++ b/policyengine_us/tests/core/test_part_d_lis.py @@ -1,12 +1,13 @@ """Invariants of the Medicare Part D low-income subsidy (``part_d_lis``). The subsidy goes to Medicare enrollees in the 50 states and DC who are deemed -eligible (Medicaid enrollees, SSI recipients, Medicare Savings Program -enrollees) or whose countable income is below 150% of the poverty guideline -for their family size and whose countable resources are within the limit -plus $1,500 per person for burial funds (42 U.S.C. 1395w-114(a)(3); 42 CFR -423.773; 20 CFR 418 subpart D). Each enrollee is valued at the Medicare -Trustees' average subsidy per subsidy enrollee, as CBO does. +eligible (Medicaid enrollees, SSI recipients, people eligible for a Medicare +Savings Program) or whose countable income is below 150% of the poverty +guideline for their family size and whose countable resources are within the +limit plus $1,500 per person for burial funds (42 U.S.C. 1395w-114(a)(3); 42 +CFR 423.773; 20 CFR 418 subpart D). Each enrollee in a Part D plan is valued +at the Medicare Trustees' average subsidy per subsidy enrollee, as CBO values +it. Parameters: @@ -21,48 +22,70 @@ 4. Indexing: each resource limit is the previous year's limit raised by the September-to-September change in the CPI-U (not seasonally adjusted), never lowered, and rounded to the nearest $10, from the statute's 2006 - amounts. SSA's published 2015 couple limit is $10 below the rule; the - parameter keeps the published amount (an intended exception). -5. Bounds (Hypothesis): the amount per recipient is positive and below - Medicare spending per enrollee in every year from 2013, the spending - series' first, to 2100, and the limits never fall. - -Households (a seeded sample in one shared simulation, each household also -run with more Social Security, more interest and more assets): - -6. Countable income equals the rule restated here: the couple's SSI - income without interest and dividends, less $20 a month from unearned - income (the rest from earnings), $65 a month of earnings and half the - remaining earnings. -7. Interest and dividends never change countable income or eligibility. -8. More Social Security never lowers countable income or makes an income - ineligible person income eligible; more assets never make a resource - ineligible person resource eligible. -9. Eligibility equals the restated rule; enrollees are the eligible people - in a Part D plan who are on Medicaid or SSI or take the subsidy up; and - the benefit is either zero or the year's amount per recipient, positive - exactly for enrollees. -10. Spouses get the same countable income, family size and test results. -11. Differential: for people without interest or dividends, countable income - equals 12 times ``msp_countable_income``, which applies the same SSI - exclusions through a separate formula (single people, and couples where - both spouses are Medicare eligible). The sample's states keep SSI's $20 - general exclusion for the Medicare Savings Programs; Illinois and - Mississippi exclude more under 42 U.S.C. 1396a(r)(2), which the subsidy's - income definition sets aside. + amounts, through 2027, the last year both Septembers are published. In + 2015 the couple limit is the formula's $24,260, not the $24,250 CMS + printed (source-conflict candidate + ``us:part-d-lis-couple-resource-limit-2015``). The Septembers typed here + equal ``cpi_u_nsa_september`` wherever both have a value. +5. Projection: from 2028 each limit is the previous year's raised by the + model's projected September CPI-U, never lowered, and rounded to $10. On + a synthetic parameter tree, values in the YAML stand, published + Septembers come first, a fall in the index leaves the limit unchanged, + and a missing September sends both Septembers to the model's CPI-U + series. +6. Rounding: the year-to-year adjustment reproduces CMS's published 2026 + limits from the unrounded ratio, and rounds an exact $5 up. +7. Bounds: the amount per recipient is positive and below Medicare spending + per enrollee in every year from 2013, the spending series' first, to 2100. + +Households (a seeded sample in one shared simulation, plus households at each +income and resource limit and just past it, each also run with more Social +Security, more interest and more assets): + +8. Countable income equals the rule restated here: the couple's SSI income + without interest and dividends, each source counted at no less than zero + for each person, less $20 a month from unearned income (the rest from + earnings), $65 a month of earnings and half the remaining earnings. +9. Interest and dividends never change countable income or eligibility. +10. More Social Security never lowers countable income or makes an income + ineligible person income eligible; more assets never make a resource + ineligible person resource eligible. +11. Eligibility equals the restated rule: family size counts the dependents + on both returns when spouses file separately, and resources include the + household's other real estate for the couple that holds it. Enrollees + are the eligible people in a Part D plan who are on Medicaid or SSI or + take the subsidy up, and the benefit is either zero or the year's amount + per recipient, positive exactly for enrollees. +12. Spouses get the same countable income, family size and test results. +13. Reach: the sample reaches every branch the properties above check, so a + change to the generator or the seed can't leave them vacuous. +14. Differential: for people without interest, dividends or rental income, + countable income equals 12 times ``msp_countable_income``, which applies + the same SSI exclusions through a separate formula (single people, and + couples where both spouses are Medicare eligible). This checks how each + formula gathers the couple's income; property 8 checks the exclusions + themselves. The sample's states keep SSI's $20 general exclusion for the + Medicare Savings Programs; Illinois and Mississippi exclude more under 42 + U.S.C. 1396a(r)(2), which the subsidy's income definition sets aside. """ +from types import SimpleNamespace + import numpy as np import pytest -from hypothesis import given -from hypothesis import strategies as st +from policyengine_core.parameters import ParameterNode from policyengine_us import Simulation +from policyengine_us.parameters.uprating_extensions import ( + adjust_part_d_lis_resource_limit_for_inflation, + extend_part_d_lis_resource_limits, + get_september_cpi_u_values, +) from policyengine_us.system import system P = system.parameters -PER_RECIPIENT = "calibration.gov.hhs.medicare.part_d.low_income_subsidy_per_recipient" LIS = P.gov.hhs.medicare.part_d.low_income_subsidy +KINDS = ["individual", "couple"] # 2026 Medicare Trustees Report (sha256 ffa56b91...8fa8), Table IV.B9 (file # page 158): low-income subsidy enrollment (millions) and subsidy amount ($). @@ -117,19 +140,24 @@ ) ) # BLS CPI-U, U.S. city average, all items, not seasonally adjusted -# (CUUR0000SA0), September of each year, retrieved 2026-10-11 from the BLS -# public API. (pe-us's gov.bls.cpi.cpi_u holds seasonally adjusted values -# from 2024, so it is not used here.) +# (CUUR0000SA0), September of each year, from the BLS public API: 2004 to +# 2025 retrieved 2026-10-11, 2026 retrieved 2026-11-08. pe-us's +# gov.bls.cpi.cpi_u_nsa_september starts in 2018; the years both hold must +# agree. CPI_U_SEPTEMBER = { **{2004: 189.9, 2005: 198.8, 2006: 202.9, 2007: 208.490, 2008: 218.783}, **{2009: 215.969, 2010: 218.439, 2011: 226.889, 2012: 231.407}, **{2013: 234.149, 2014: 238.031, 2015: 237.945, 2016: 241.428}, **{2017: 246.819, 2018: 252.439, 2019: 256.759, 2020: 260.280}, **{2021: 274.310, 2022: 296.808, 2023: 307.789, 2024: 315.301}, - **{2025: 324.800}, + **{2025: 324.800, 2026: 336.940}, } +LAST_SEPTEMBER = max(CPI_U_SEPTEMBER) STATUTE_2006 = {"individual": 10_000, "couple": 20_000} -PUBLISHED_EXCEPTIONS = {("couple", 2015): 24_250} # the rule gives 24,260 +# CMS, CY 2026 Resource and Cost-Sharing Limits for LIS (October 31, 2025), +# page 2, before the burial funds exclusion. +CMS_2025 = {"individual": 16_100, "couple": 32_130} +CMS_2026 = {"individual": 16_590, "couple": 33_100} def _per_recipient(year): @@ -138,6 +166,14 @@ def _per_recipient(year): ) +def _limit(kind): + return getattr(LIS.eligibility.resources.limit, kind) + + +def _round_to_10(x): + return int(np.floor(x / 10 + 0.5)) * 10 + + @pytest.mark.parametrize("year", sorted(IV_B9)) def test_per_recipient_transcribes_table_iv_b9(year): assert _per_recipient(year) == IV_B9[year][1] @@ -165,33 +201,162 @@ def test_recipients_times_amount_matches_per_enrollee_series(year): assert rebuilt == pytest.approx(per_enrollee, rel=0.005) -def _round_to_10(x): - return int(np.floor(x / 10 + 0.5)) * 10 +def test_typed_septembers_match_the_parameter(): + september = P.gov.bls.cpi.cpi_u_nsa_september + # pe-us backdates each parameter's first value to 2015-01-01; only the + # September instants are BLS values. + years = [ + int(value.instant_str[:4]) + for value in september.values_list + if value.instant_str.endswith("-09-01") + ] + assert LAST_SEPTEMBER in years + for year in years: + assert september(f"{year}-09-01") == pytest.approx( + CPI_U_SEPTEMBER[year], abs=5e-4 + ), year -@pytest.mark.parametrize("kind", ["individual", "couple"]) +@pytest.mark.parametrize("kind", KINDS) def test_resource_limits_follow_the_cpi_rule(kind): - limit = getattr(LIS.eligibility.resources.limit, kind) + limit = _limit(kind) assert limit("2006-01-01") == STATUTE_2006[kind] - for year in range(2007, 2027): + for year in range(2007, LAST_SEPTEMBER + 2): growth = CPI_U_SEPTEMBER[year - 1] / CPI_U_SEPTEMBER[year - 2] expected = _round_to_10(limit(f"{year - 1}-01-01") * max(growth, 1)) - expected = PUBLISHED_EXCEPTIONS.get((kind, year), expected) assert limit(f"{year}-01-01") == expected, year + assert limit(f"{year}-07-01") == expected, year -@given(st.integers(2013, 2100)) -def test_amount_positive_and_below_spending(year): - amount = _per_recipient(year) - spending = P.calibration.gov.hhs.medicare.per_capita_cost(f"{year}-01-01") - assert 0 < amount < spending +@pytest.mark.parametrize("kind", KINDS) +def test_projected_resource_limits_follow_the_projected_cpi(kind): + limit = _limit(kind) + for year in range(LAST_SEPTEMBER + 2, 2101): + prior, current = get_september_cpi_u_values(P.gov.bls.cpi, year) + expected = _round_to_10(limit(f"{year - 1}-01-01") * max(current / prior, 1)) + assert limit(f"{year}-01-01") == expected, year + # The projection is not flat over the Trustees' window. + assert limit("2035-01-01") > limit(f"{LAST_SEPTEMBER + 1}-01-01") + + +def test_published_2026_limits_need_the_unrounded_ratio(): + # CMS reports the CY 2026 increase as 3.01%, but $16,100 x 1.0301 = + # $16,584.61 rounds to $16,580; the unrounded ratio gives $16,585.04 and + # the published $16,590. CMS's couple limits ($32,130 to $33,100) follow + # the same rule; the model's couple limit builds on the formula's 2025 + # amount, $20 above CMS's (see the couple limit's parameter file). + for kind in KINDS: + assert ( + adjust_part_d_lis_resource_limit_for_inflation( + CMS_2025[kind], 315.301, 324.800 + ) + == CMS_2026[kind] + ) + assert _limit("individual")("2026-01-01") == CMS_2026["individual"] + assert _limit("couple")("2026-01-01") == CMS_2026["couple"] + 20 + + +@pytest.mark.parametrize( + "prior_limit, prior, current, expected", + [ + # 2015 couple: 23,860 x 238.031 / 234.149 = 24,255.58. + (23_860, 234.149, 238.031, 24_260), + # 2016: the index fell (237.945 < 238.031), so the limit stays. + (24_260, 238.031, 237.945, 24_260), + # An exact $5 rounds up. + (1_005, 100.0, 100.0, 1_010), + (1_000, 100.0, 100.5, 1_010), + (1_000, 100.0, 100.4, 1_000), + ], +) +def test_adjustment_rounds_to_the_nearest_10(prior_limit, prior, current, expected): + assert ( + adjust_part_d_lis_resource_limit_for_inflation(prior_limit, prior, current) + == expected + ) -@given(st.integers(2007, 2100)) -def test_resource_limits_never_fall(year): - for kind in ["individual", "couple"]: - limit = getattr(LIS.eligibility.resources.limit, kind) - assert limit(f"{year}-01-01") >= limit(f"{year - 1}-01-01") +def _synthetic_tree(nsa_septembers, sa_septembers): + def values(data): + return {"values": data} + + return ParameterNode( + data={ + "gov": { + "hhs": { + "medicare": { + "part_d": { + "low_income_subsidy": { + "eligibility": { + "resources": { + "limit": { + "individual": values( + {"2025-01-01": 16_100} + ), + "couple": values( + { + "2025-01-01": 32_150, + "2026-01-01": 33_120, + } + ), + } + } + } + } + } + } + }, + "bls": { + "cpi": { + "cpi_u_nsa_september": values(nsa_septembers), + "cpi_u": values(sa_septembers), + } + }, + } + } + ) + + +def test_extension_on_a_synthetic_tree(): + nsa = {"2024-09-01": 315.301, "2025-09-01": 324.8, "2026-09-01": 336.94} + nsa["2027-09-01"] = 330.0 # a fall + nsa["2028-09-01"] = 340.0 + # The model's (seasonally adjusted) series differs from the published one, + # so a year that reads it shows which series it used. + sa = {date: 0.99 * value for date, value in nsa.items()} + sa["2029-09-01"] = 0.99 * 350.0 + parameters = _synthetic_tree(nsa, sa) + extend_part_d_lis_resource_limits(parameters, end_year=2031) + limits = parameters.gov.hhs.medicare.part_d.low_income_subsidy.eligibility + limits = limits.resources.limit + individual = {y: limits.individual(f"{y}-01-01") for y in range(2025, 2036)} + couple = {y: limits.couple(f"{y}-01-01") for y in range(2025, 2036)} + # 2026: published Septembers 2024 and 2025; the YAML's 2026 couple stands. + assert individual[2026] == 16_590 + assert couple[2026] == 33_120 + # 2027: published 2025 and 2026. + assert individual[2027] == _round_to_10(16_590 * 336.94 / 324.8) + assert couple[2027] == _round_to_10(33_120 * 336.94 / 324.8) + # 2028: the published index fell, so the limits stay. + assert individual[2028] == individual[2027] + assert couple[2028] == couple[2027] + # 2029: published 2027 and 2028. + assert individual[2029] == _round_to_10(individual[2028] * 340.0 / 330.0) + # 2030: September 2029 is not published, so both Septembers come from + # the model's series (0.99 x 350 / (0.99 x 340), not 0.99 x 350 / 340). + assert individual[2030] == _round_to_10(individual[2029] * 350.0 / 340.0) + # 2031: the model's series holds flat after its last month. + assert individual[2031] == individual[2030] + # After the end year the last value holds. + assert individual[2035] == individual[2031] + assert couple[2035] == couple[2031] + + +def test_amount_positive_and_below_spending(): + for year in range(2013, 2101): + amount = _per_recipient(year) + spending = P.calibration.gov.hhs.medicare.per_capita_cost(f"{year}-01-01") + assert 0 < amount < spending, year # Households. @@ -200,10 +365,15 @@ def test_resource_limits_never_fall(year): SEED = 20261011 STATES = ["TX", "CA", "NY", "AK", "HI", "FL", "PR", "DC"] VARIANTS = ["base", "more_ss", "more_interest", "more_assets"] +LIMITS = LIS.eligibility.resources(f"{YEAR}-01-01") +BURIAL = LIMITS.burial_exclusion -def _households(): +def _random_households(): rng = np.random.default_rng(SEED) + # Features added after the first sample come from their own generator, + # so the original draws stay the same. + extra = np.random.default_rng(SEED + 1) out = [] for _ in range(N): married = bool(rng.random() < 0.5) @@ -222,6 +392,7 @@ def person(): msp_eligible=bool(rng.random() < 0.15), takes_up_part_d_lis_if_eligible=bool(rng.random() < 0.7), takes_up_medicare_part_d_if_eligible=bool(rng.random() < 0.85), + rental_income=int(extra.choice([0, 0, 0, -6_000, 2_400])), ) out.append( @@ -229,12 +400,72 @@ def person(): state=str(rng.choice(STATES)), dependents=int(rng.choice([0, 0, 0, 1, 2])), members=[person()] + ([person()] if married else []), + separate=married and bool(extra.random() < 0.3), + real_estate=int(extra.choice([0, 0, 0, 6_000, 60_000])), + ) + ) + return out + + +def _boundary_households(): + # Not deemed, in a Part D plan, taking the subsidy up, in Texas. + def person(social_security, bank_account_assets=0): + return dict( + social_security=social_security, + employment_income=0, + interest_income=0, + dividend_income=0, + bank_account_assets=bank_account_assets, + stock_assets=0, + medicare_enrolled=True, + medicaid_enrolled=False, + ssi=0, + msp_eligible=False, + takes_up_part_d_lis_if_eligible=True, + takes_up_medicare_part_d_if_eligible=True, + rental_income=0, + ) + + def household(members, real_estate=0): + return dict( + state="TX", + dependents=0, + members=members, + separate=False, + real_estate=real_estate, + ) + + single = LIMITS.limit.individual + BURIAL + couple = LIMITS.limit.couple + 2 * BURIAL + single_income = 1.5 * _fpg("TX", 1) + couple_income = 1.5 * _fpg("TX", 2) + out = [] + for over in (0, 1): + out.append(household([person(6_000, single + over)])) + out.append( + household([person(6_000, couple - 9_000 + over), person(6_000, 9_000)]) + ) + out.append(household([person(6_000, single - 10_000 + over)], 10_000)) + # Countable income at 150% of the guideline, and $12 a year below. + out.append(household([person(int(single_income + 240 - 12 * (1 - over)))])) + out.append( + household( + [ + person(20_000), + person(int(couple_income + 240 - 20_000 - 12 * (1 - over))), + ] ) ) return out -HOUSEHOLDS = _households() +def _fpg(state, size): + fpg = P.gov.hhs.fpg(f"{YEAR}-01-01") + group = state if state in ("AK", "HI", "PR") else "CONTIGUOUS_US" + return fpg.first_person[group] + fpg.additional_person[group] * (size - 1) + + +HOUSEHOLDS = _random_households() + _boundary_households() def _variant(member, variant, is_head): @@ -249,6 +480,15 @@ def _variant(member, variant, is_head): return member +INCOME_INPUTS = ( + "social_security", + "employment_income", + "interest_income", + "dividend_income", + "rental_income", +) + + def _situation(households, variants, inputs=True): people, marital_units, tax_units, spm_units, units = {}, {}, {}, {}, {} rows = [] # (household index, variant, member index, person name) @@ -259,15 +499,7 @@ def _situation(households, variants, inputs=True): name = f"{v}_{i}_{j}" record = _variant(member, v, j == 0) if not inputs: - record = { - k: record[k] - for k in ( - "social_security", - "employment_income", - "interest_income", - "dividend_income", - ) - } + record = {k: record[k] for k in INCOME_INPUTS} people[name] = { "age": {YEAR: 70}, **{k: {YEAR: val} for k, val in record.items()}, @@ -275,6 +507,7 @@ def _situation(households, variants, inputs=True): names.append(name) rows.append((i, v, j, name)) spouses = list(names) + returns = [[name] for name in spouses] if h["separate"] else [list(spouses)] dependents = [] for k in range(h["dependents"]): name = f"{v}_{i}_d{k}" @@ -283,14 +516,18 @@ def _situation(households, variants, inputs=True): "is_tax_unit_dependent": {YEAR: True}, } marital_units[f"mu_{name}"] = {"members": [name]} + # Spouses who file separately claim the dependents in turn. + returns[k % len(returns)].append(name) dependents.append(name) marital_units[f"mu_{v}_{i}"] = {"members": spouses} + for r, members in enumerate(returns): + tax_units[f"tu_{v}_{i}_{r}"] = {"members": members} members = spouses + dependents - tax_units[f"tu_{v}_{i}"] = {"members": members} spm_units[f"spm_{v}_{i}"] = {"members": members} units[f"hh_{v}_{i}"] = { "members": members, "state_code": {YEAR: h["state"]}, + "household_other_real_estate_equity": {YEAR: h["real_estate"]}, } situation = { "people": people, @@ -322,32 +559,45 @@ def sample(): return rows, index, values -def _restated_countable(members): +def _restated_countable(members, floor_sources=True): + def unearned(m): + rent = max(m["rental_income"], 0) if floor_sources else m["rental_income"] + return m["social_security"] + rent + earned = sum(m["employment_income"] for m in members) / 12 - unearned = sum(m["social_security"] for m in members) / 12 - general = min(20, unearned) - countable_unearned = unearned - general + total_unearned = sum(unearned(m) for m in members) / 12 + general = min(20, max(total_unearned, 0)) + countable_unearned = max(total_unearned, 0) - general countable_earned = max(earned - 65 - (20 - general), 0) / 2 return 12 * (countable_unearned + countable_earned) -def _fpg(state, size): - fpg = P.gov.hhs.fpg(f"{YEAR}-01-01") - group = state if state in ("AK", "HI", "PR") else "CONTIGUOUS_US" - return fpg.first_person[group] + fpg.additional_person[group] * (size - 1) +def _restated_tests(h, members, real_estate=True): + """Family size, income test and resource test for the household's couple.""" + couple = len(members) + size = couple + h["dependents"] + income_ok = _restated_countable(members) < 1.5 * _fpg(h["state"], size) + resources = sum(m["bank_account_assets"] + m["stock_assets"] for m in members) + # Every adult is 70 and every dependent 10, so the couple holds the + # household's real estate. + resources += h["real_estate"] if real_estate else 0 + limit = LIMITS.limit.couple if couple == 2 else LIMITS.limit.individual + resource_ok = resources <= limit + BURIAL * couple + return size, income_ok, resource_ok, resources - (limit + BURIAL * couple) def _value(values, index, variable, name): return values[variable][index[name]] +def _members(i, v): + return [_variant(m, v, j == 0) for j, m in enumerate(HOUSEHOLDS[i]["members"])] + + def test_countable_income_matches_restated_rule(sample): rows, index, values = sample for i, v, _, name in rows: - members = [ - _variant(m, v, j == 0) for j, m in enumerate(HOUSEHOLDS[i]["members"]) - ] - expected = _restated_countable(members) + expected = _restated_countable(_members(i, v)) actual = _value(values, index, "part_d_lis_countable_income", name) assert actual == pytest.approx(expected, abs=0.01), (i, v) @@ -384,39 +634,36 @@ def test_more_income_or_assets_never_helps(sample): assert _value(values, index, "part_d_lis_resource_eligible", base), i +def _restated_enrollment(h, me, income_ok, resource_ok): + excluded = list(LIS.eligibility.ineligible_jurisdictions(f"{YEAR}-01-01")) + deemed = me["medicaid_enrolled"] or me["ssi"] > 0 or me["msp_eligible"] + eligible = ( + me["medicare_enrolled"] + and h["state"] not in excluded + and (deemed or (income_ok and resource_ok)) + ) + automatic = me["medicaid_enrolled"] or me["ssi"] > 0 + in_part_d = me["takes_up_medicare_part_d_if_eligible"] + takes_up = me["takes_up_part_d_lis_if_eligible"] + enrolled = eligible and in_part_d and (automatic or takes_up) + return deemed, eligible, enrolled + + def test_eligibility_and_benefit_match_restated_rules(sample): rows, index, values = sample amount = _per_recipient(YEAR) - excluded = list(LIS.eligibility.ineligible_jurisdictions(f"{YEAR}-01-01")) - limits = LIS.eligibility.resources(f"{YEAR}-01-01") for i, v, j, name in rows: h = HOUSEHOLDS[i] - members = [_variant(m, v, k == 0) for k, m in enumerate(h["members"])] - me = members[j] - couple = len(members) - size = couple + h["dependents"] - assert _value(values, index, "part_d_lis_family_size", name) == size - income_ok = _restated_countable(members) < 1.5 * _fpg(h["state"], size) - resources = sum(m["bank_account_assets"] + m["stock_assets"] for m in members) - limit = limits.limit.couple if couple == 2 else limits.limit.individual - resource_ok = resources <= limit + limits.burial_exclusion * couple - deemed = me["medicaid_enrolled"] or me["ssi"] > 0 or me["msp_eligible"] - eligible = ( - me["medicare_enrolled"] - and h["state"] not in excluded - and (deemed or (income_ok and resource_ok)) - ) - automatic = me["medicaid_enrolled"] or me["ssi"] > 0 - in_part_d = me["takes_up_medicare_part_d_if_eligible"] - enrolled = ( - eligible - and in_part_d - and (automatic or me["takes_up_part_d_lis_if_eligible"]) + members = _members(i, v) + size, income_ok, resource_ok, _ = _restated_tests(h, members) + _, eligible, enrolled = _restated_enrollment( + h, members[j], income_ok, resource_ok ) + assert _value(values, index, "part_d_lis_family_size", name) == size, i assert _value(values, index, "part_d_lis_income_eligible", name) == income_ok assert _value(values, index, "part_d_lis_resource_eligible", name) == ( resource_ok - ) + ), i assert _value(values, index, "part_d_lis_eligible", name) == eligible, i assert _value(values, index, "part_d_lis_enrolled", name) == enrolled, i benefit = _value(values, index, "part_d_lis", name) @@ -440,15 +687,90 @@ def test_spouses_agree(sample): ), (i, variable) +def test_sample_reaches_every_branch(): + counts = dict.fromkeys( + [ + "couple", + "dependents", + "territory", + "no_medicare", + "deemed_by_medicaid_only", + "deemed_by_ssi_only", + "deemed_by_msp_only", + "passes_both_tests", + "fails_only_resources", + "fails_only_income", + "eligible_without_part_d", + "eligible_not_taking_up", + "automatic_despite_no_take_up", + "enrolled", + "on_resource_limit", + "one_dollar_over_resource_limit", + "on_income_limit", + "separate_returns_split_dependents", + "split_dependents_change_income_test", + "rental_floor_changes_income_test", + "real_estate_changes_resource_test", + ], + 0, + ) + for i, h in enumerate(HOUSEHOLDS): + members = _members(i, "base") + size, income_ok, resource_ok, over = _restated_tests(h, members) + counts["couple"] += len(members) == 2 + counts["dependents"] += h["dependents"] > 0 + counts["territory"] += h["state"] == "PR" + counts["on_resource_limit"] += over == 0 + counts["one_dollar_over_resource_limit"] += over == 1 + countable = _restated_countable(members) + counts["on_income_limit"] += countable == 1.5 * _fpg(h["state"], size) + if h["separate"] and h["dependents"] == 1: + counts["separate_returns_split_dependents"] += 1 + own_return = _restated_countable(members) < 1.5 * _fpg(h["state"], size - 1) + counts["split_dependents_change_income_test"] += own_return != income_ok + netted = _restated_countable(members, floor_sources=False) + counts["rental_floor_changes_income_test"] += income_ok != ( + netted < 1.5 * _fpg(h["state"], size) + ) + without = _restated_tests(h, members, real_estate=False)[2] + counts["real_estate_changes_resource_test"] += without != resource_ok + for me in members: + counts["no_medicare"] += not me["medicare_enrolled"] + routes = [me["medicaid_enrolled"], me["ssi"] > 0, me["msp_eligible"]] + if sum(routes) == 1: + counts["deemed_by_medicaid_only"] += routes[0] + counts["deemed_by_ssi_only"] += routes[1] + counts["deemed_by_msp_only"] += routes[2] + counts["passes_both_tests"] += income_ok and resource_ok + counts["fails_only_resources"] += income_ok and not resource_ok + counts["fails_only_income"] += resource_ok and not income_ok + _, eligible, enrolled = _restated_enrollment(h, me, income_ok, resource_ok) + in_part_d = me["takes_up_medicare_part_d_if_eligible"] + automatic = me["medicaid_enrolled"] or me["ssi"] > 0 + takes_up = me["takes_up_part_d_lis_if_eligible"] + counts["eligible_without_part_d"] += eligible and not in_part_d + counts["eligible_not_taking_up"] += ( + eligible and in_part_d and not automatic and not takes_up + ) + counts["automatic_despite_no_take_up"] += ( + eligible and in_part_d and automatic and not takes_up + ) + counts["enrolled"] += enrolled + unreached = [branch for branch, count in counts.items() if count == 0] + assert not unreached, counts + + def test_countable_income_matches_msp_countable_income(): - # No interest or dividends, everyone 70 and so Medicare eligible: the - # MSP formula then counts the same income the same way, through its - # couple branch for married couples and its personal branch otherwise. + # No interest, dividends or rental income, everyone 70 and so Medicare + # eligible: the MSP formula then counts the same income the same way, + # through its couple branch for married couples and its personal branch + # otherwise. households = [ { **h, "members": [ - {**m, "interest_income": 0, "dividend_income": 0} for m in h["members"] + {**m, "interest_income": 0, "dividend_income": 0, "rental_income": 0} + for m in h["members"] ], } for h in HOUSEHOLDS diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/integration.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/integration.yaml index 83a388e39b9..01d10d70b4b 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/integration.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/integration.yaml @@ -102,7 +102,7 @@ output: # Combined countable income (30,000 / 12 - 20) x 12 = 29,760 is over the # couple QI limit (29,214) but under 32,460; combined resources $30,000 - # are under 33,100 + 3,000 = 36,100. + # are under 33,120 + 3,000 = 36,120. msp_eligible: [false, false] part_d_lis_family_size: [2, 2] part_d_lis_countable_income: [29_760, 29_760] @@ -207,3 +207,135 @@ output: part_d_lis_eligible: false part_d_lis: 0 + +- name: Non-home real estate counts toward the resource limit. + period: 2026 + input: + people: + person: + age: 72 + social_security: 22_800 + bank_account_assets: 1_000 + households: + household: + members: [person] + state_code: TX + household_other_real_estate_equity: 200_000 + output: + # Countable income (22,800 / 12 - 20) x 12 = 22,560 is over the QI limit + # (21,546), so no Medicare Savings Program deems the person eligible, and + # under 23,940. Resources 1,000 + 200,000 exceed 16,590 + 1,500 = 18,090 + # (20 CFR 418.3405(b)). + msp_eligible: false + part_d_lis_income_eligible: true + part_d_lis_resource_eligible: false + part_d_lis_eligible: false + part_d_lis: 0 + +- name: The same person without the real estate gets the subsidy. + period: 2026 + input: + people: + person: + age: 72 + social_security: 22_800 + bank_account_assets: 1_000 + households: + household: + members: [person] + state_code: TX + output: + msp_eligible: false + part_d_lis_resource_eligible: true + part_d_lis_eligible: true + part_d_lis: 1_254 + +- name: A rental loss does not offset Social Security. + period: 2026 + input: + people: + person: + age: 70 + social_security: 30_000 + rental_income: -8_000 + bank_account_assets: 5_000 + households: + household: + members: [person] + state_code: TX + output: + # SSI counts net rental income but does not let excess expenses offset + # other income (POMS SI 00830.505), so the subsidy counts (30,000 / 12 - + # 20) x 12 = 29,760, over 23,940. Netting the loss would give 21,760. + part_d_lis_countable_income: 29_760 + part_d_lis_income_eligible: false + part_d_lis: 0 + +- name: Spouses filing separately share one family size. + period: 2026 + input: + people: + spouse1: + age: 70 + social_security: 24_000 + spouse2: + age: 68 + social_security: 9_000 + grandchild: + age: 10 + is_tax_unit_dependent: true + marital_units: + couple: + members: [spouse1, spouse2] + grandchild_unit: + members: [grandchild] + tax_units: + spouse1_return: + members: [spouse1] + spouse2_return: + members: [spouse2, grandchild] + spm_units: + spm_unit: + members: [spouse1, spouse2, grandchild] + households: + household: + members: [spouse1, spouse2, grandchild] + state_code: TX + output: + # The grandchild is a dependent on the second spouse's separate return, + # so the couple's family is 3 for both spouses. Combined countable + # income (33,000 / 12 - 20) x 12 = 32,760 is under 150% of the 3-person + # guideline, 1.5 x (15,960 + 2 x 5,680) = 40,980, but over the 2-person + # 32,460, so counting only the first spouse's return would deny that + # spouse. The couple's 2,730 a month exceeds the couple QI limit of + # 29,214 / 12 = 2,434.50, so no Medicare Savings Program deems them. + msp_eligible: [false, false, false] + part_d_lis_family_size: [3, 3, 1] + part_d_lis_countable_income: [32_760, 32_760, 0] + part_d_lis_income_eligible: [true, true, true] + part_d_lis_eligible: [true, true, false] + part_d_lis: [1_254, 1_254, 0] + +- name: 2027 uses the CPI-indexed resource limit. + period: 2027 + input: + people: + person: + age: 70 + social_security: 18_000 + bank_account_assets: 18_500 + households: + household: + members: [person] + state_code: TX + output: + # The 2027 limit is 16,590 x 336.940 / 324.800 = 17,210.04, rounded to + # 17,210 (September 2026 and 2025 CPI-U), so resources may reach 17,210 + # + 1,500 = 18,710. $18,500 is over the Medicare Savings Program's + # resource limit, and countable income 17,760 is under 150% of the + # projected 2027 guideline. + msp_eligible: false + part_d_lis_income_eligible: true + part_d_lis_resource_eligible: true + part_d_lis_eligible: true + part_d_lis: 1_384 diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_income.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_income.yaml index f21127b4dbf..66d6d18ca5c 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_income.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_income.yaml @@ -77,3 +77,43 @@ age: 66 output: part_d_lis_countable_income: 0 + +- name: A rental loss counts as zero and does not offset other income. + period: 2026 + input: + people: + person: + age: 70 + social_security: 12_000 + rental_income: -3_000 + output: + # (12,000 / 12 - 20) x 12 = 11,760 (POMS SI 00830.505). + part_d_lis_countable_income: 11_760 + +- name: One spouse's rental loss does not offset the other's income. + period: 2026 + input: + people: + spouse1: + age: 70 + social_security: 12_000 + spouse2: + age: 68 + rental_income: -6_000 + marital_units: + marital_unit: + members: [spouse1, spouse2] + output: + part_d_lis_countable_income: [11_760, 11_760] + +- name: Rental income counts. + period: 2026 + input: + people: + person: + age: 70 + social_security: 12_000 + rental_income: 2_400 + output: + # (14,400 / 12 - 20) x 12 = 14,160. + part_d_lis_countable_income: 14_160 diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.yaml index bbef7210439..c96f6ce6a3d 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.yaml @@ -78,3 +78,21 @@ ssi: 0 output: part_d_lis_enrolled: false + +- name: A Medicaid enrollee whose Part D input is false gets no subsidy. + period: 2026 + input: + people: + person: + age: 70 + part_d_lis_eligible: true + medicaid_enrolled: true + ssi: 0 + # CMS enrolls Medicaid enrollees in a plan unless they decline Part D + # or are qualifying covered retirees (42 CFR 423.34(d), (e)); the + # microdata mark those people with this input. + takes_up_medicare_part_d_if_eligible: false + output: + medicare_part_d_enrolled: false + part_d_lis_enrolled: false + part_d_lis: 0 diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_family_size.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_family_size.yaml index d0bcd98f082..5a78aa56f7f 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_family_size.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_family_size.yaml @@ -55,3 +55,57 @@ # The parent depends on the child, so the parent's family is just the # parent; the child's family includes the dependent parent. part_d_lis_family_size: [2, 1] + +- name: Spouses filing separately count the dependents on both returns. + period: 2026 + input: + people: + spouse1: + age: 70 + spouse2: + age: 68 + grandchild: + age: 10 + is_tax_unit_dependent: true + marital_units: + couple: + members: [spouse1, spouse2] + grandchild_unit: + members: [grandchild] + tax_units: + spouse1_return: + members: [spouse1] + spouse2_return: + members: [spouse2, grandchild] + output: + # Each spouse heads a return; only the second claims the grandchild. + part_d_lis_family_size: [3, 3, 1] + +- name: Each spouse files separately and claims one child. + period: 2026 + input: + people: + spouse1: + age: 70 + child1: + age: 15 + is_tax_unit_dependent: true + spouse2: + age: 68 + child2: + age: 12 + is_tax_unit_dependent: true + marital_units: + couple: + members: [spouse1, spouse2] + child1_unit: + members: [child1] + child2_unit: + members: [child2] + tax_units: + spouse1_return: + members: [spouse1, child1] + spouse2_return: + members: [spouse2, child2] + output: + part_d_lis_family_size: [4, 1, 4, 1] diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.yaml index c12e0858819..d64d43eda80 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.yaml @@ -28,13 +28,15 @@ spouse1: bank_account_assets: 20_000 spouse2: - stock_assets: 10_100 + stock_assets: 10_120 bond_assets: 6_000 marital_units: marital_unit: members: [spouse1, spouse2] output: - # 20,000 + 10,100 + 6,000 = 36,100 = 33,100 + 2 x 1,500. + # 20,000 + 10,120 + 6,000 = 36,120 = 33,120 + 2 x 1,500. The statute's + # formula gives $33,120; CMS published $33,100 (see the couple limit's + # parameter file). part_d_lis_resource_eligible: [true, true] - name: Married couple one dollar over the 2026 couple limit. @@ -44,7 +46,7 @@ spouse1: bank_account_assets: 20_001 spouse2: - stock_assets: 16_100 + stock_assets: 16_120 marital_units: marital_unit: members: [spouse1, spouse2] @@ -61,3 +63,93 @@ # 15,160 + 1,500 = 16,660, CMS's published 2023 partial subsidy limit. # The 2023 full subsidy limit was 9,090 + 1,500 = 10,590. part_d_lis_resource_eligible: true + +- name: Single person at the projected 2027 limit. + period: 2027 + input: + people: + person: + bank_account_assets: 18_710 + output: + # 16,590 x 336.940 / 324.800 = 17,210.04, rounded to 17,210; plus 1,500. + part_d_lis_resource_eligible: true + +- name: Single person one dollar over the projected 2027 limit. + period: 2027 + input: + people: + person: + bank_account_assets: 18_711 + output: + part_d_lis_resource_eligible: false + +- name: Married couple at the projected 2027 couple limit. + period: 2027 + input: + people: + spouse1: + bank_account_assets: 37_360 + spouse2: + bank_account_assets: 0 + marital_units: + marital_unit: + members: [spouse1, spouse2] + output: + # 33,120 x 336.940 / 324.800 = 34,358.11, rounded to 34,360; plus 2 x + # 1,500 = 37,360. + part_d_lis_resource_eligible: [true, true] + +- name: Non-home real estate counts for the household head's couple only. + period: 2026 + input: + people: + head: + age: 70 + is_household_head: true + bank_account_assets: 20_000 + spouse: + age: 68 + bank_account_assets: 7_000 + mother: + age: 92 + bank_account_assets: 9_000 + marital_units: + couple: + members: [head, spouse] + mother_unit: + members: [mother] + households: + household: + members: [head, spouse, mother] + household_other_real_estate_equity: 10_000 + output: + # The couple: 20,000 + 7,000 + 10,000 = 37,000 > 33,120 + 3,000 = + # 36,120. The mother: 9,000 <= 16,590 + 1,500 = 18,090. + part_d_lis_resource_eligible: [false, false, true] + +- name: Without a designated head, the oldest member holds the real estate. + period: 2026 + input: + people: + head: + age: 70 + bank_account_assets: 20_000 + spouse: + age: 68 + bank_account_assets: 7_000 + mother: + age: 92 + bank_account_assets: 9_000 + marital_units: + couple: + members: [head, spouse] + mother_unit: + members: [mother] + households: + household: + members: [head, spouse, mother] + household_other_real_estate_equity: 10_000 + output: + # The couple: 27,000 <= 36,120. The mother: 9,000 + 10,000 = 19,000 > + # 18,090. + part_d_lis_resource_eligible: [true, true, false] diff --git a/policyengine_us/tests/policy/baseline/household/healthcare_benefit_value.yaml b/policyengine_us/tests/policy/baseline/household/healthcare_benefit_value.yaml index 2b7980e1463..596087fbcfa 100644 --- a/policyengine_us/tests/policy/baseline/household/healthcare_benefit_value.yaml +++ b/policyengine_us/tests/policy/baseline/household/healthcare_benefit_value.yaml @@ -23,6 +23,16 @@ output: healthcare_benefit_value: 2_434.8 +- name: Case 2b, the Part D low-income subsidy is a healthcare benefit value. + period: 2026 + absolute_error_margin: 0.01 + input: + medicaid_cost: 0 + msp_cost: 2_434.8 + part_d_lis: 1_254 + output: + healthcare_benefit_value: 3_688.8 + - name: Case 3, enrolled CHIP value is included in healthcare benefit value. period: 2026 absolute_error_margin: 0.01 diff --git a/policyengine_us/tests/policy/baseline/household/household_health_benefits.yaml b/policyengine_us/tests/policy/baseline/household/household_health_benefits.yaml index c02d64382ee..2af124fd1bd 100644 --- a/policyengine_us/tests/policy/baseline/household/household_health_benefits.yaml +++ b/policyengine_us/tests/policy/baseline/household/household_health_benefits.yaml @@ -38,6 +38,30 @@ household_health_benefits: 4_234.8 household_benefits: 4_234.8 +- name: Case 3b, flag on includes the Part D low-income subsidy. + period: 2026 + absolute_error_margin: 0.01 + input: + gov.simulation.include_health_benefits_in_net_income: true + medicaid_cost: 0 + msp_cost: 2_434.8 + part_d_lis: 1_254 + snap: 0 + output: + household_health_benefits: 3_688.8 + household_benefits: 3_688.8 + +- name: Case 3c, flag off leaves the Part D low-income subsidy out of benefits. + period: 2026 + absolute_error_margin: 0.01 + input: + gov.simulation.include_health_benefits_in_net_income: false + part_d_lis: 1_254 + snap: 0 + output: + household_health_benefits: 0 + household_benefits: 0 + - name: Case 4, legacy wrappers do not double count canonical health values. period: 2026 absolute_error_margin: 0.01 diff --git a/policyengine_us/variables/household/healthcare_benefit_value.py b/policyengine_us/variables/household/healthcare_benefit_value.py index 0f68d98f3e9..bf7731ee3d5 100644 --- a/policyengine_us/variables/household/healthcare_benefit_value.py +++ b/policyengine_us/variables/household/healthcare_benefit_value.py @@ -11,11 +11,14 @@ class healthcare_benefit_value(Variable): "Annual canonical household resource value of health coverage. This " "uses annual health-value and government-cost proxy variables directly, " "including assigned_aca_ptc for ACA premium tax credits. CHIP is counted " - "through `chip`, which is gated on eligibility, take-up, and enrollment." + "through `chip`, which is gated on eligibility, take-up, and enrollment. " + "The Medicare Part D low-income subsidy counts through `part_d_lis`; " + "Medicare's own spending (`medicare_cost`) is not included." ) adds = [ "medicaid_cost", "msp_cost", + "part_d_lis", "chip", "assigned_aca_ptc", "assigned_ca_premium_subsidy", From fe4af16ec11cd8af37b76ad75883acdb0fcaa69c Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 8 Nov 2026 01:26:29 -0500 Subject: [PATCH 23/35] Reword the couple limit candidate's example Co-Authored-By: Claude Opus 5.5 --- source_conflicts/candidates.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source_conflicts/candidates.yaml b/source_conflicts/candidates.yaml index 1c00c91928e..23a95750581 100644 --- a/source_conflicts/candidates.yaml +++ b/source_conflicts/candidates.yaml @@ -11263,8 +11263,8 @@ candidates: sets it, giving $24,620 in 2017 and $33,120 in 2026. other: CMS's memo gives the 1.01658 factor and the rounding to $10 but prints $24,250, and POMS lists $24,250 for 2015 and 2016. SSA raises its own published amount each later year, giving $24,600 in 2017 and $33,100 in 2026. - example: In 2026 a married couple with $36,110 of countable resources and the burial funds exclusion meets the - statutory limit of $33,120 plus $3,000 but not SSA's $33,100 plus $3,000. + example: In 2026 a married couple with $36,110 of resources, $3,000 of them set aside for burial, has $33,110 of + countable resources, within the statutory limit of $33,120 but over SSA's $33,100. pe_us: follows: statute code: @@ -11273,8 +11273,8 @@ candidates: - https://github.com/PolicyEngine/policyengine-us/pull/10127 state: ruled note: Every other higher (partial subsidy, then full subsidy) limit SSA published from 2007 to 2026 equals the - formula applied to the previous published limit, and the memo's 1.01658 factor reproduces its other 2015 amounts ($7,280, $10,930 and - $12,140), so the $24,250 is the one cell the stated method doesn't produce. The model applies the formula as the + formula applied to the previous published limit, and the memo's 1.01658 factor reproduces its other 2015 amounts + ($7,280, $10,930 and $12,140), so the $24,250 is the one cell the stated method doesn't produce. The model applies the formula as the statute and 423.773(d)(2)(ii) state it, from the statute's 2006 amount of $20,000. The difference reaches only couples whose countable resources fall within $10 to $20 of the limit. - id: us:recovery-rebate-joint-claimable-spouse From 2a9b27cda682355485b39cc48443d6bfc0ff5d1c Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 8 Nov 2026 01:59:54 -0500 Subject: [PATCH 24/35] Correct the 2027 limit arithmetic in two test comments 16,590 x 336.940 / 324.800 is 17,210.08 and 33,120 x 336.940 / 324.800 is 34,357.92. The rounded limits and the tests' inputs don't change. Co-Authored-By: Claude Opus 5.5 --- .../hhs/medicare/part_d/low_income_subsidy/integration.yaml | 2 +- .../low_income_subsidy/part_d_lis_resource_eligible.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/integration.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/integration.yaml index 01d10d70b4b..473be095d6d 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/integration.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/integration.yaml @@ -329,7 +329,7 @@ members: [person] state_code: TX output: - # The 2027 limit is 16,590 x 336.940 / 324.800 = 17,210.04, rounded to + # The 2027 limit is 16,590 x 336.940 / 324.800 = 17,210.08, rounded to # 17,210 (September 2026 and 2025 CPI-U), so resources may reach 17,210 # + 1,500 = 18,710. $18,500 is over the Medicare Savings Program's # resource limit, and countable income 17,760 is under 150% of the diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.yaml index d64d43eda80..8ca6a68478b 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.yaml @@ -71,7 +71,7 @@ person: bank_account_assets: 18_710 output: - # 16,590 x 336.940 / 324.800 = 17,210.04, rounded to 17,210; plus 1,500. + # 16,590 x 336.940 / 324.800 = 17,210.08, rounded to 17,210; plus 1,500. part_d_lis_resource_eligible: true - name: Single person one dollar over the projected 2027 limit. @@ -95,7 +95,7 @@ marital_unit: members: [spouse1, spouse2] output: - # 33,120 x 336.940 / 324.800 = 34,358.11, rounded to 34,360; plus 2 x + # 33,120 x 336.940 / 324.800 = 34,357.92, rounded to 34,360; plus 2 x # 1,500 = 37,360. part_d_lis_resource_eligible: [true, true] From 4ecac84cc2ac6890a287fa37a6db7a6fee0c3c05 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 8 Nov 2026 02:05:15 -0500 Subject: [PATCH 25/35] State the covered-retiree exception as 42 CFR 423.34(d)(3) does CMS enrolls a qualifying covered retiree only if they are a full-benefit dual eligible whose plan sponsor it approved for the retiree drug subsidy and they confirm that they want a plan; it enrolls no other covered retiree. The docstring had limited the exception to retirees whose employer gets the subsidy. Documentation and a test comment only. Co-Authored-By: Claude Opus 5.5 --- .../low_income_subsidy/part_d_lis_enrolled.yaml | 4 ++-- .../low_income_subsidy/part_d_lis_enrolled.py | 17 +++++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.yaml index c96f6ce6a3d..ed08dcadf32 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.yaml @@ -89,8 +89,8 @@ medicaid_enrolled: true ssi: 0 # CMS enrolls Medicaid enrollees in a plan unless they decline Part D - # or are qualifying covered retirees (42 CFR 423.34(d), (e)); the - # microdata mark those people with this input. + # or are qualifying covered retirees who don't choose one (42 CFR + # 423.34(d), (e)); the microdata mark those people with this input. takes_up_medicare_part_d_if_eligible: false output: medicare_part_d_enrolled: false diff --git a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.py b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.py index c85ec1c9080..275b23a1661 100644 --- a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.py +++ b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_enrolled.py @@ -10,12 +10,17 @@ class part_d_lis_enrolled(Variable): "(medicare_part_d_enrolled). Medicaid enrollees and Supplemental " "Security Income recipients get the subsidy without applying; other " "eligible people in a plan get it if they take it up. CMS enrolls " - "subsidy-eligible people who don't choose a plan, unless they " - "decline Part D or are qualifying covered retirees whose employer " - "gets the retiree drug subsidy (42 CFR 423.34(d) and (e)). So " - "microdata that set takes_up_medicare_part_d_if_eligible should set " - "it true for Medicaid enrollees and SSI recipients other than those " - "two groups; a person whose Part D input is false gets no subsidy. " + "subsidy-eligible people who don't choose a plan, and any of them " + "can decline (42 CFR 423.34(d)(1) and (e)). Qualifying covered " + "retirees, whose employer retiree drug coverage qualifies for the " + "retiree drug subsidy, are the exception: CMS enrolls only the " + "full-benefit dual eligibles among them whose plan sponsor it " + "approved for that subsidy, and only if they confirm that they want " + "a plan (423.34(d)(3)). So microdata that set " + "takes_up_medicare_part_d_if_eligible should set it true for " + "Medicaid enrollees and SSI recipients other than those who decline " + "and covered retirees who don't choose a plan; a person whose Part D " + "input is false gets no subsidy. " "Not modeled: people deemed eligible from July to December stay " "deemed eligible through the following year (423.773(c)(2)(ii)); the " "model tests each year on its own." From 2c447a343c2f4d5ecf71cae68f4796118a17e974 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 8 Nov 2026 05:08:32 -0500 Subject: [PATCH 26/35] Test the two-head and September-instant tie-breaks A household with two flagged heads gives its real estate to the older one, and a non-September instant in the September CPI-U node is not a published September. Both rules had no test; the round 3 mutants that reversed them survived. Co-Authored-By: Claude Opus 5.5 --- policyengine_us/tests/core/test_part_d_lis.py | 14 ++++++++++ .../part_d_lis_resource_eligible.yaml | 26 +++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/policyengine_us/tests/core/test_part_d_lis.py b/policyengine_us/tests/core/test_part_d_lis.py index f892a84dbd6..574cd01dbbe 100644 --- a/policyengine_us/tests/core/test_part_d_lis.py +++ b/policyengine_us/tests/core/test_part_d_lis.py @@ -217,6 +217,20 @@ def test_typed_septembers_match_the_parameter(): ), year +def test_september_values_skip_non_september_instants(): + # The backdated 2015-01-01 entry is no BLS September, so 2017, which + # needs Septembers 2015 and 2016, reads both from the model's series. + cpi = ParameterNode( + data={ + "cpi_u_nsa_september": { + "values": {"2015-01-01": 237.945, "2016-09-01": 241.428} + }, + "cpi_u": {"values": {"2015-09-01": 200.0, "2016-09-01": 210.0}}, + } + ) + assert get_september_cpi_u_values(cpi, 2017) == (200.0, 210.0) + + @pytest.mark.parametrize("kind", KINDS) def test_resource_limits_follow_the_cpi_rule(kind): limit = _limit(kind) diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.yaml index 8ca6a68478b..bf2e67838fb 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.yaml @@ -127,6 +127,32 @@ # 36,120. The mother: 9,000 <= 16,590 + 1,500 = 18,090. part_d_lis_resource_eligible: [false, false, true] +- name: With two flagged heads, the older one holds the real estate. + period: 2026 + input: + people: + younger: + age: 70 + is_household_head: true + bank_account_assets: 9_000 + older: + age: 80 + is_household_head: true + bank_account_assets: 9_000 + marital_units: + younger_unit: + members: [younger] + older_unit: + members: [older] + households: + household: + members: [younger, older] + household_other_real_estate_equity: 10_000 + output: + # The younger: 9,000 <= 16,590 + 1,500 = 18,090. The older: 9,000 + + # 10,000 = 19,000 > 18,090. + part_d_lis_resource_eligible: [true, false] + - name: Without a designated head, the oldest member holds the real estate. period: 2026 input: From 18272ff02ac1c959171aff07d83b79890d06a289 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Wed, 11 Nov 2026 14:50:23 -0500 Subject: [PATCH 27/35] Describe the consumer test the file runs The module docstring promised a reference-implementation comparison that the file no longer contains. It now names the bounds check the test runs and points to the YAML cases that pin the value. Co-Authored-By: Claude Fable 5.2 --- .../tests/core/test_medicare_cost_part_d_premium.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/policyengine_us/tests/core/test_medicare_cost_part_d_premium.py b/policyengine_us/tests/core/test_medicare_cost_part_d_premium.py index f20823b4b4d..690cac1643b 100644 --- a/policyengine_us/tests/core/test_medicare_cost_part_d_premium.py +++ b/policyengine_us/tests/core/test_medicare_cost_part_d_premium.py @@ -37,10 +37,10 @@ cost per beneficiary (Table V.D1). 5. Calendar years: every date in a year reads the January 1 value; between the Trustees' five-year enrollment points the share holds the earlier one. -6. Consumer (Hypothesis, differential): ``medicare_cost`` equals a reference - implementation, max(gross - Part A - Part B - share x premium - IRMAA, 0), - for any year and premiums; it lies in [0, ``medicare_gross_cost``], which - does not change with the Part D premium. +6. Consumer (Hypothesis): ``medicare_cost`` lies in [0, + ``medicare_gross_cost``] for any year and premiums, and + ``medicare_gross_cost`` does not change with the premiums. The cases in + ``medicare_cost.yaml`` pin the formula's value. 7. Accounting (Hypothesis): the person's Part D IRMAA lowers ``medicare_cost`` dollar for dollar until the zero floor, as it raises what the person pays; the enrollment share does not scale it. From e9dc2276b8b13e2c66d37fcb34a88553f9cb2250 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Wed, 11 Nov 2026 15:41:31 -0500 Subject: [PATCH 28/35] Clarify the CBO Medicare premium methodology Co-Authored-By: Claude Opus 5.5 --- .../cbo-medicare-net-of-premiums.fixed.md | 2 +- .../cbo_social_insurance_benefits.yaml | 2 +- .../medicare/costs/cbo_medicare_benefit.py | 24 +++++++++---------- .../hhs/medicare/costs/medicare_gross_cost.py | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/changelog.d/cbo-medicare-net-of-premiums.fixed.md b/changelog.d/cbo-medicare-net-of-premiums.fixed.md index 31b17d9bb0c..759d610a4af 100644 --- a/changelog.d/cbo-medicare-net-of-premiums.fixed.md +++ b/changelog.d/cbo-medicare-net-of-premiums.fixed.md @@ -1 +1 @@ -The default CBO household income now counts Medicare as CBO does, at the average cost per enrollee net of premiums and excluding the Part D low-income subsidy, through a new `cbo_medicare_benefit` variable instead of gross Medicare spending. +PolicyEngine moves its default CBO household income closer to CBO's standard measure by counting Medicare at average cost per enrollee, net of premium income and excluding the Part D low-income subsidy. It uses the new `cbo_medicare_benefit` variable in place of gross Medicare spending. diff --git a/policyengine_us/parameters/gov/household/cbo_social_insurance_benefits.yaml b/policyengine_us/parameters/gov/household/cbo_social_insurance_benefits.yaml index 4228013adb3..7387247ed64 100644 --- a/policyengine_us/parameters/gov/household/cbo_social_insurance_benefits.yaml +++ b/policyengine_us/parameters/gov/household/cbo_social_insurance_benefits.yaml @@ -28,4 +28,4 @@ metadata: # of premiums paid by enrollees)" on PDF pages 5 and 37.) CBO calls that # measure plus enrollee premiums "gross Medicare spending". - title: Congressional Budget Office, Sensitivity of the Distribution of Household Income to the Treatment of Health Insurance From 1979 to 2021 - href: https://www.cbo.gov/publication/61910 + href: https://www.cbo.gov/system/files/2026-01/61910-DOHI-health.pdf#page=27 diff --git a/policyengine_us/variables/gov/hhs/medicare/costs/cbo_medicare_benefit.py b/policyengine_us/variables/gov/hhs/medicare/costs/cbo_medicare_benefit.py index a2b0c748dd2..e4756b9efdf 100644 --- a/policyengine_us/variables/gov/hhs/medicare/costs/cbo_medicare_benefit.py +++ b/policyengine_us/variables/gov/hhs/medicare/costs/cbo_medicare_benefit.py @@ -6,22 +6,22 @@ class cbo_medicare_benefit(Variable): entity = Person label = "CBO Medicare benefit" documentation = ( - "Medicare benefit as the Congressional Budget Office counts it in " - "household income: the government's average cost per enrollee of " - "providing Medicare Parts A, B and D, net of premium income " - "(premiums paid by or on behalf of enrollees, as the Medicare " - "Trustees count it; this includes premiums state Medicaid programs " - "pay, which PolicyEngine counts in Medicaid). CBO assigns the same " - "average to every enrollee and counts the Part D low-income subsidy " - "separately as a means-tested transfer, so this subtracts " - "per-enrollee averages of premium income and of the low-income " - "subsidy from Medicare spending per enrollee, rather than the " - "person's own premiums." + "PolicyEngine values Medicare Parts A, B and D in CBO household " + "income at average spending per enrollee, less premium income and the " + "Part D low-income subsidy. The Medicare Trustees count premiums that " + "enrollees or others pay on their behalf, including premiums state " + "Medicaid programs pay. PolicyEngine's state Medicaid spending totals " + "include these buy-ins, so PolicyEngine nets them here to avoid " + "counting them twice. CBO counts Medicaid-paid premiums as Medicare " + "spending. CBO assigns every enrollee the same average and counts the " + "Part D low-income subsidy separately as a means-tested transfer. " + "PolicyEngine subtracts average premium income and subsidy costs per " + "Medicare enrollee rather than the person's own premiums." ) unit = USD definition_period = YEAR reference = ( - "https://www.cbo.gov/publication/61910", + "https://www.cbo.gov/system/files/2026-01/61910-DOHI-health.pdf#page=27", # PDF pages 27, 39 "https://www.cbo.gov/system/files/2024-09/60341-income.pdf#page=27", # PDF pages 46, 52 diff --git a/policyengine_us/variables/gov/hhs/medicare/costs/medicare_gross_cost.py b/policyengine_us/variables/gov/hhs/medicare/costs/medicare_gross_cost.py index 1baeeaf188a..19199abea9d 100644 --- a/policyengine_us/variables/gov/hhs/medicare/costs/medicare_gross_cost.py +++ b/policyengine_us/variables/gov/hhs/medicare/costs/medicare_gross_cost.py @@ -18,7 +18,7 @@ class medicare_gross_cost(Variable): definition_period = YEAR reference = ( "https://www.cms.gov/about-cms/what-we-do/medicare", - "https://www.cbo.gov/publication/61910", + "https://www.cbo.gov/system/files/2026-01/61910-DOHI-health.pdf#page=27", ) defined_for = "medicare_enrolled" From 75fde048d4f055572b24180273fd960b7f877047 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Fri, 13 Nov 2026 09:33:05 -0500 Subject: [PATCH 29/35] Vary Part A and Part B premiums in the gross cost test The Hypothesis test adds a third enrollee with different Part A and Part B premiums and checks that all three people have the same gross cost. Invariant 6 now names the three premiums the test varies. Invariant 2 now says its $0.2 billion slack covers the December 31 credits that Table III.D3 books a year early. Co-Authored-By: Claude Fable 5.2 --- .../core/test_medicare_cost_part_d_premium.py | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/policyengine_us/tests/core/test_medicare_cost_part_d_premium.py b/policyengine_us/tests/core/test_medicare_cost_part_d_premium.py index 690cac1643b..da1e65354c9 100644 --- a/policyengine_us/tests/core/test_medicare_cost_part_d_premium.py +++ b/policyengine_us/tests/core/test_medicare_cost_part_d_premium.py @@ -26,7 +26,9 @@ published cells, rounded as stored. 2. Conservation: premiums per Part D enrollee times Part D enrollment, plus aggregate IRMAA, returns Table III.D3's premium income in every year from - 2015 to 2035, within the tables' rounding. + 2015 to 2035, once footnote 6's December 31 credits move to the following + year. The result differs from the table's cash-basis cell by no more than + the largest such credit, $0.2 billion. 3. Bounds: the share lies strictly between 0 and 1 and premiums are positive in every year from 2015 to 2200. The monthly premium per Part D enrollee is below the Trustees' average paid premium in 2025 and 2026, @@ -39,8 +41,9 @@ the Trustees' five-year enrollment points the share holds the earlier one. 6. Consumer (Hypothesis): ``medicare_cost`` lies in [0, ``medicare_gross_cost``] for any year and premiums, and - ``medicare_gross_cost`` does not change with the premiums. The cases in - ``medicare_cost.yaml`` pin the formula's value. + ``medicare_gross_cost`` does not change with the person's Part A premium, + Part B premium or Part D IRMAA. The cases in ``medicare_cost.yaml`` pin + the formula's value. 7. Accounting (Hypothesis): the person's Part D IRMAA lowers ``medicare_cost`` dollar for dollar until the zero floor, as it raises what the person pays; the enrollment share does not scale it. @@ -153,11 +156,15 @@ def test_share_is_trustees_part_d_over_total_enrollment(year): @pytest.mark.parametrize("year", PROJECTED_YEARS) def test_premiums_and_irmaa_return_trustees_premium_income(year): """Conservation: the series, scaled back up by enrollment, plus IRMAA - gives the published premium income, within rounding of the cells.""" + gives the published premium income with each December 31 credit moved to + the following year.""" rebuilt = _premium(year) * PART_D_ENROLLMENT[year] * 1e3 / 1e9 rebuilt += IRMAA_AGGREGATE[year] - # Each cell is rounded to $0.1 billion, the stored value to the cent. + # The stored value is rounded to the cent, which moves the total by less + # than $0.001 billion. assert rebuilt == pytest.approx(_accrual_premium_income(year), abs=1e-3) + # The cash-basis cell differs by the December 31 credits, $0.2 billion at + # most. assert abs(rebuilt - PREMIUM_INCOME[year]) <= 0.2 + 1e-3 @@ -231,27 +238,32 @@ def _enrollee(year, part_a, part_b, irmaa): } +part_a_premiums = st.floats(0, 12_000, allow_nan=False) premiums = st.floats(0, 40_000, allow_nan=False) irmaas = st.floats(0, 12_000, allow_nan=False) @settings(max_examples=25, deadline=None) -@given(years, st.floats(0, 12_000, allow_nan=False), premiums, irmaas, irmaas) -def test_medicare_cost_bounds_and_irmaa_slope(year, part_a, part_b, irmaa, more_irmaa): +@given(years, part_a_premiums, premiums, irmaas, irmaas, part_a_premiums, premiums) +def test_medicare_cost_bounds_and_irmaa_slope( + year, part_a, part_b, irmaa, more_irmaa, other_part_a, other_part_b +): low, high = sorted((irmaa, irmaa + more_irmaa)) simulation = _simulation( year, { "low": _enrollee(year, part_a, part_b, low), "high": _enrollee(year, part_a, part_b, high), + "other": _enrollee(year, other_part_a, other_part_b, low), }, ) net = simulation.calculate("medicare_cost", year) gross = simulation.calculate("medicare_gross_cost", year) assert (net >= 0).all() assert (net <= gross).all() - # The gross cost subtracts no premium, so both people have the same one. - assert gross[0] == gross[1] + # The gross cost subtracts no premium, so three people with different + # Part A premiums, Part B premiums and IRMAA have the same one. + assert (gross == gross[0]).all() assert net[1] <= net[0] # Accounting: above the zero floor, more IRMAA lowers the value dollar for # dollar, so the enrollment share does not scale it. Float32 values near From 103cd4a35c76c5670b2fb5cb5a5ec50d84307584 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Fri, 13 Nov 2026 18:19:49 -0500 Subject: [PATCH 30/35] Drop #10111's changelog fragment, which main already released Main's version bump consumed changelog.d/medicare-cost-part-d-premiums.fixed.md into CHANGELOG.md. Merging #10111's branch head restored it, which would repeat the entry in the next release. Co-Authored-By: Claude Opus 5.5 --- changelog.d/medicare-cost-part-d-premiums.fixed.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 changelog.d/medicare-cost-part-d-premiums.fixed.md diff --git a/changelog.d/medicare-cost-part-d-premiums.fixed.md b/changelog.d/medicare-cost-part-d-premiums.fixed.md deleted file mode 100644 index 958f4bf71d5..00000000000 --- a/changelog.d/medicare-cost-part-d-premiums.fixed.md +++ /dev/null @@ -1 +0,0 @@ -Subtract Medicare Part D premiums from `medicare_cost`, whose CMS spending per enrollee includes Part D: the average Part D premium per Medicare enrollee from the 2026 Medicare Trustees Report, plus the person's own Part D income-related monthly adjustment amount. From b867d6d687796e9553b2ac8af9c11f4d94957214 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sat, 14 Nov 2026 13:48:59 -0500 Subject: [PATCH 31/35] Cite PDF page 41 for CBO's Appendix D and state what Medicare nets CBO's 2021 household income report defines its terms in Appendix D, which starts on PDF page 41. Page 39 holds Table C-3. Cite page 41 in the reference title and comment of cbo_social_insurance_benefits.yaml and in cbo_medicare_benefit's reference comment. Describe Medicare in cbo_household_social_insurance_benefits as cbo_medicare_benefit does: average spending per enrollee less premium income and the Part D low-income subsidy. Co-Authored-By: Claude Fable 5.2 --- .../gov/household/cbo_social_insurance_benefits.yaml | 4 ++-- .../variables/gov/hhs/medicare/costs/cbo_medicare_benefit.py | 2 +- .../household/cbo_household_social_insurance_benefits.py | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/policyengine_us/parameters/gov/household/cbo_social_insurance_benefits.yaml b/policyengine_us/parameters/gov/household/cbo_social_insurance_benefits.yaml index 7387247ed64..130600d2a46 100644 --- a/policyengine_us/parameters/gov/household/cbo_social_insurance_benefits.yaml +++ b/policyengine_us/parameters/gov/household/cbo_social_insurance_benefits.yaml @@ -16,10 +16,10 @@ metadata: # (measured as the average cost to the government of providing those # benefits, net of offsetting receipts); regular unemployment insurance # ...; and workers' compensation." (Appendix A, note 3, PDF page 27.) - # Appendix D (PDF page 39) defines Medicare as "measured by the average + # Appendix D (PDF page 41) defines Medicare as "measured by the average # cost to the government of providing those benefits", with no netting # clause. - - title: "Congressional Budget Office, The Distribution of Household Income in 2021, Appendixes A and D #page 27,39" + - title: "Congressional Budget Office, The Distribution of Household Income in 2021, Appendixes A and D #page 27,41" href: https://www.cbo.gov/system/files/2024-09/60341-income.pdf#page=27 # "The measure of Medicare benefits in The Distribution of Household # Income includes the federal government's average cost per enrollee of diff --git a/policyengine_us/variables/gov/hhs/medicare/costs/cbo_medicare_benefit.py b/policyengine_us/variables/gov/hhs/medicare/costs/cbo_medicare_benefit.py index e4756b9efdf..af200346976 100644 --- a/policyengine_us/variables/gov/hhs/medicare/costs/cbo_medicare_benefit.py +++ b/policyengine_us/variables/gov/hhs/medicare/costs/cbo_medicare_benefit.py @@ -22,7 +22,7 @@ class cbo_medicare_benefit(Variable): definition_period = YEAR reference = ( "https://www.cbo.gov/system/files/2026-01/61910-DOHI-health.pdf#page=27", - # PDF pages 27, 39 + # PDF pages 27, 41 "https://www.cbo.gov/system/files/2024-09/60341-income.pdf#page=27", # PDF pages 46, 52 "https://www.cbo.gov/system/files/2018-07/54234-workingpaper.pdf#page=46", diff --git a/policyengine_us/variables/household/income/household/cbo_household_social_insurance_benefits.py b/policyengine_us/variables/household/income/household/cbo_household_social_insurance_benefits.py index 82ecc087d38..4fd13b41af5 100644 --- a/policyengine_us/variables/household/income/household/cbo_household_social_insurance_benefits.py +++ b/policyengine_us/variables/household/income/household/cbo_household_social_insurance_benefits.py @@ -7,8 +7,9 @@ class cbo_household_social_insurance_benefits(Variable): label = "CBO household social insurance benefits" documentation = ( "Social insurance benefits included in CBO household income: Social " - "Security, Medicare benefits net of enrollee premiums, unemployment " - "insurance, and workers' compensation." + "Security, Medicare at average spending per enrollee less premium " + "income and the Part D low-income subsidy (cbo_medicare_benefit), " + "unemployment insurance, and workers' compensation." ) definition_period = YEAR unit = USD From 5ef50e7a2060308f7ee8adb9da8eb0c750df9761 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sat, 14 Nov 2026 15:34:43 -0500 Subject: [PATCH 32/35] Count rental equity, floor resources at zero and round limits exactly Answers the round 3 reviews of #10127: - Rental property equity counts as an LIS resource, less up to $6,000 when the household's net rent is at least 6% of the excluded equity (20 CFR 418.3405(b), 416.1222(a); POMS HI 03030.020, SI 01130.503). Every rental is treated as nonbusiness property. - Each resource amount, the household's and each person's, counts at no less than zero, so negative equity or an overdraft no longer offsets other resources. - The resource-limit adjustment uses exact fractions, so exact $5 products round up; the finite decimal ratio put some just below $5. - Tests: rental equity and zero-floor YAML, the reviewers' households, the exact-tie rounding cases, the model-September fallback, and reach checks that each sample variant changes a result. - Citations: the CY 2026 CMS memo at its Wayback capture (CMS's URL now serves CY 2027), the registry's CBO wording and the take-up docs. Co-Authored-By: Claude Opus 5.5 --- .../resources/household_sources.yaml | 20 +-- .../eligibility/resources/limit/couple.yaml | 2 +- .../resources/limit/individual.yaml | 2 +- .../rental_property/equity_exclusion.yaml | 15 ++ .../rental_property/minimum_return.yaml | 15 ++ .../parameters/uprating_extensions.py | 18 +- policyengine_us/programs.yaml | 7 +- policyengine_us/tests/core/test_part_d_lis.py | 156 +++++++++++++++--- .../low_income_subsidy/integration.yaml | 49 ++++++ ..._lis_countable_rental_property_equity.yaml | 114 +++++++++++++ .../part_d_lis_resource_eligible.yaml | 57 +++++++ ..._d_lis_countable_rental_property_equity.py | 41 +++++ .../part_d_lis_resource_eligible.py | 15 +- .../takes_up_part_d_lis_if_eligible.py | 9 +- 14 files changed, 465 insertions(+), 55 deletions(-) create mode 100644 policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/rental_property/equity_exclusion.yaml create mode 100644 policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/rental_property/minimum_return.yaml create mode 100644 policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_rental_property_equity.yaml create mode 100644 policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_rental_property_equity.py diff --git a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/household_sources.yaml b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/household_sources.yaml index e7320981b42..e151b660c04 100644 --- a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/household_sources.yaml +++ b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/household_sources.yaml @@ -2,6 +2,7 @@ description: Medicare counts these household assets as resources of the househol values: 2006-01-01: - household_other_real_estate_equity + - part_d_lis_countable_rental_property_equity metadata: unit: list @@ -10,20 +11,17 @@ metadata: reference: # Equity in real property other than the home counts, whether or not it # can be sold within 20 workdays. The model holds real estate equity by - # household, so the formula counts it for the household head's couple. - # Rental property equity (household_rental_property_equity) is left out: - # property essential to self-support is excluded (418.3425(c) and (d)), - # rental property used in a trade or business in full and other - # income-producing property up to $6,000 of equity when it returns 6% a - # year (POMS SI 01130.501 and SI 01130.500), and the model can't tell - # which applies. + # household, so the formula counts it for the household head's couple + # and floors each amount at zero. Rental property equity counts less the + # exclusion for income-producing property essential to self-support + # (see part_d_lis_countable_rental_property_equity). - title: 20 CFR § 418.3405(b) - What types of resources do we count? href: https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3405#p-418.3405(b) - title: 20 CFR § 418.3425 - What resources do we exclude from counting? href: https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3425 - title: 42 CFR § 423.772 - Definitions (resources) href: https://www.ecfr.gov/current/title-42/chapter-IV/subchapter-B/part-423/subpart-P/section-423.772 - - title: SSA POMS SI 01130.501 - Essential Property Excluded Regardless of Value or Rate of Return - href: https://secure.ssa.gov/poms.nsf/lnx/0501130501 - - title: SSA POMS SI 01130.500 - Property Essential to Self-Support - Overview - href: https://secure.ssa.gov/poms.nsf/lnx/0501130500 + - title: SSA POMS HI 03030.020 - Resource Exclusions + href: https://secure.ssa.gov/poms.nsf/lnx/0603030020 + - title: SSA POMS SI 01130.503 - Essential Property Excluded up to $6,000 Equity If It Produces a 6 Percent Rate of Return + href: https://secure.ssa.gov/poms.nsf/lnx/0501130503 diff --git a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/limit/couple.yaml b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/limit/couple.yaml index 454dfc127cb..b43414f1193 100644 --- a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/limit/couple.yaml +++ b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/limit/couple.yaml @@ -58,4 +58,4 @@ metadata: - title: CMS, 2015 Medicare Part D Low-Income Subsidy (LIS) Income and Resource Standards, Attachment 4 href: https://www.cms.gov/files/document/2015-lis-income-and-resourcespdf#page=5 - title: CMS, Calendar Year (CY) 2026 Resource and Cost-Sharing Limits for Low-Income Subsidy (LIS), October 31, 2025 - href: https://www.cms.gov/files/document/cy2026-lis-resource-limits-memo.pdf#page=2 + href: https://web.archive.org/web/20251204185002/https://www.cms.gov/files/document/cy2026-lis-resource-limits-memo.pdf#page=2 diff --git a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/limit/individual.yaml b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/limit/individual.yaml index b24f6e8167c..aa49dc97b64 100644 --- a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/limit/individual.yaml +++ b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/limit/individual.yaml @@ -46,4 +46,4 @@ metadata: - title: SSA POMS HI 03030.025 - Resource Limits for Subsidy Eligibility href: https://secure.ssa.gov/poms.nsf/lnx/0603030025 - title: CMS, Calendar Year (CY) 2026 Resource and Cost-Sharing Limits for Low-Income Subsidy (LIS), October 31, 2025 - href: https://www.cms.gov/files/document/cy2026-lis-resource-limits-memo.pdf#page=2 + href: https://web.archive.org/web/20251204185002/https://www.cms.gov/files/document/cy2026-lis-resource-limits-memo.pdf#page=2 diff --git a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/rental_property/equity_exclusion.yaml b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/rental_property/equity_exclusion.yaml new file mode 100644 index 00000000000..c730096413c --- /dev/null +++ b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/rental_property/equity_exclusion.yaml @@ -0,0 +1,15 @@ +description: Medicare excludes up to this much equity in nonbusiness income-producing property from countable resources under the Part D low-income subsidy, when the property's net annual income meets the minimum return on the excluded equity. +values: + 2006-01-01: 6_000 + +metadata: + unit: currency-USD + period: year + label: Medicare Part D low-income subsidy income-producing property equity exclusion + reference: + - title: 20 CFR § 416.1222(a) - How income-producing property essential to self-support is counted + href: https://www.ecfr.gov/current/title-20/chapter-III/part-416/subpart-L/section-416.1222#p-416.1222(a) + - title: SSA POMS HI 03030.020 - Resource Exclusions + href: https://secure.ssa.gov/poms.nsf/lnx/0603030020 + - title: SSA POMS SI 01130.503 - Essential Property Excluded up to $6,000 Equity If It Produces a 6 Percent Rate of Return + href: https://secure.ssa.gov/poms.nsf/lnx/0501130503 diff --git a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/rental_property/minimum_return.yaml b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/rental_property/minimum_return.yaml new file mode 100644 index 00000000000..25193b1c96d --- /dev/null +++ b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/rental_property/minimum_return.yaml @@ -0,0 +1,15 @@ +description: Medicare excludes equity in nonbusiness income-producing property from countable resources under the Part D low-income subsidy only when the property's net annual income is at least this share of the excluded equity. +values: + 2006-01-01: 0.06 + +metadata: + unit: /1 + period: year + label: Medicare Part D low-income subsidy income-producing property minimum return + reference: + - title: 20 CFR § 416.1222(a) - How income-producing property essential to self-support is counted + href: https://www.ecfr.gov/current/title-20/chapter-III/part-416/subpart-L/section-416.1222#p-416.1222(a) + - title: SSA POMS HI 03030.020 - Resource Exclusions + href: https://secure.ssa.gov/poms.nsf/lnx/0603030020 + - title: SSA POMS SI 01130.503 - Essential Property Excluded up to $6,000 Equity If It Produces a 6 Percent Rate of Return + href: https://secure.ssa.gov/poms.nsf/lnx/0501130503 diff --git a/policyengine_us/parameters/uprating_extensions.py b/policyengine_us/parameters/uprating_extensions.py index 855d95921a0..49274d7bd30 100644 --- a/policyengine_us/parameters/uprating_extensions.py +++ b/policyengine_us/parameters/uprating_extensions.py @@ -2,6 +2,7 @@ import math from decimal import ROUND_HALF_UP, Decimal +from fractions import Fraction from typing import Dict, Optional, Tuple from policyengine_us.model_api import * @@ -652,8 +653,9 @@ def get_september_cpi_u_values(cpi: ParameterNode, year: int) -> Tuple[float, fl no seasonal pattern. Returns ``(prior September, later September)``. """ september = cpi.cpi_u_nsa_september - # Only September instants are BLS values; the parameter tree also - # backdates the first value to 2015-01-01. + # Only September instants are BLS values, so any other instant (such as + # a backdated first value) is skipped. The series has gaps (1988, then + # 2018 on), and a missing year must not read the September before it. published = { int(value.instant_str[:4]) for value in september.values_list @@ -773,15 +775,17 @@ def adjust_part_d_lis_resource_limit_for_inflation( times the unrounded 1.030127 ($16,585.04), where 1.0301 would give $16,584.61 and so $16,580. A fall in the index is not an increase, so the limit never falls: SSA kept the 2009 and 2015 limits for 2010 and 2016. - The arithmetic is decimal, with halves rounding up, so a product that - ends in exactly $5 rounds up as it does on paper. + The arithmetic is exact (each input is read as the decimal it prints + as), with halves rounding up, so a product that ends in exactly $5 rounds + up as it does on paper. """ ratio = max( - Decimal(str(float(current_september))) / Decimal(str(float(prior_september))), + Fraction(repr(float(current_september))) + / Fraction(repr(float(prior_september))), 1, ) - adjusted = Decimal(str(float(prior_limit))) * ratio - tens = (adjusted / 10).quantize(Decimal(1), rounding=ROUND_HALF_UP) + adjusted = Fraction(repr(float(prior_limit))) * ratio + tens = math.floor(adjusted / 10 + Fraction(1, 2)) return float(tens * 10) diff --git a/policyengine_us/programs.yaml b/policyengine_us/programs.yaml index ae195b7c25a..b19dfd548d0 100644 --- a/policyengine_us/programs.yaml +++ b/policyengine_us/programs.yaml @@ -449,9 +449,10 @@ programs: a Part D plan: Medicaid enrollees and SSI recipients get it without applying, and other eligible people take it up through takes_up_part_d_lis_if_eligible, which defaults to true. Each enrollee - gets the Medicare Trustees' average payment per subsidy enrollee, the - amount CBO assigns each recipient; the premium and cost-sharing - subsidies are not computed per person. + gets the Medicare Trustees' average payment per subsidy enrollee, + following CBO's method of assigning every recipient the same average + cost; the premium and cost-sharing subsidies are not computed per + person. - id: tanf name: TANF diff --git a/policyengine_us/tests/core/test_part_d_lis.py b/policyengine_us/tests/core/test_part_d_lis.py index 574cd01dbbe..7e42af5dcb1 100644 --- a/policyengine_us/tests/core/test_part_d_lis.py +++ b/policyengine_us/tests/core/test_part_d_lis.py @@ -52,13 +52,17 @@ ineligible person resource eligible. 11. Eligibility equals the restated rule: family size counts the dependents on both returns when spouses file separately, and resources include the - household's other real estate for the couple that holds it. Enrollees + household's other real estate and its rental property equity, less up to + $6,000 when net rent is at least 6% of the excluded equity, for the + couple that holds them, each counted at no less than zero. Enrollees are the eligible people in a Part D plan who are on Medicaid or SSI or take the subsidy up, and the benefit is either zero or the year's amount per recipient, positive exactly for enrollees. 12. Spouses get the same countable income, family size and test results. -13. Reach: the sample reaches every branch the properties above check, so a - change to the generator or the seed can't leave them vacuous. +13. Reach: the sample reaches every branch the properties above check, and + each variant raises its inputs and changes some test result (or, for + interest, would if interest counted), so a change to the generator or + the seed can't leave them vacuous. 14. Differential: for people without interest, dividends or rental income, countable income equals 12 times ``msp_countable_income``, which applies the same SSI exclusions through a separate formula (single people, and @@ -142,8 +146,8 @@ # BLS CPI-U, U.S. city average, all items, not seasonally adjusted # (CUUR0000SA0), September of each year, from the BLS public API: 2004 to # 2025 retrieved 2026-10-11, 2026 retrieved 2026-11-08. pe-us's -# gov.bls.cpi.cpi_u_nsa_september starts in 2018; the years both hold must -# agree. +# gov.bls.cpi.cpi_u_nsa_september holds 1988 and 2018 on; the years both +# hold must agree. CPI_U_SEPTEMBER = { **{2004: 189.9, 2005: 198.8, 2006: 202.9, 2007: 208.490, 2008: 218.783}, **{2009: 215.969, 2010: 218.439, 2011: 226.889, 2012: 231.407}, @@ -203,14 +207,14 @@ def test_recipients_times_amount_matches_per_enrollee_series(year): def test_typed_septembers_match_the_parameter(): september = P.gov.bls.cpi.cpi_u_nsa_september - # pe-us backdates each parameter's first value to 2015-01-01; only the - # September instants are BLS values. + # Only the September instants are BLS values. years = [ int(value.instant_str[:4]) for value in september.values_list if value.instant_str.endswith("-09-01") + and int(value.instant_str[:4]) in CPI_U_SEPTEMBER ] - assert LAST_SEPTEMBER in years + assert set(range(2018, LAST_SEPTEMBER + 1)) <= set(years) for year in years: assert september(f"{year}-09-01") == pytest.approx( CPI_U_SEPTEMBER[year], abs=5e-4 @@ -218,8 +222,9 @@ def test_typed_septembers_match_the_parameter(): def test_september_values_skip_non_september_instants(): - # The backdated 2015-01-01 entry is no BLS September, so 2017, which - # needs Septembers 2015 and 2016, reads both from the model's series. + # A non-September instant (such as a backdated first value) is no BLS + # September, so 2017, which needs Septembers 2015 and 2016, reads both + # from the model's series. cpi = ParameterNode( data={ "cpi_u_nsa_september": { @@ -231,6 +236,28 @@ def test_september_values_skip_non_september_instants(): assert get_september_cpi_u_values(cpi, 2017) == (200.0, 210.0) +def test_september_values_fall_back_to_the_model_septembers(): + # September 2025 is not published, so both Septembers come from the + # model's monthly series, September each year rather than a neighbouring + # month or the published 2024 value. + cpi = ParameterNode( + data={ + "cpi_u_nsa_september": {"values": {"2024-09-01": 300.0}}, + "cpi_u": { + "values": { + "2024-08-01": 199.0, + "2024-09-01": 200.0, + "2024-10-01": 201.0, + "2025-08-01": 205.0, + "2025-09-01": 210.0, + "2025-10-01": 220.0, + } + }, + } + ) + assert get_september_cpi_u_values(cpi, 2026) == (200.0, 210.0) + + @pytest.mark.parametrize("kind", KINDS) def test_resource_limits_follow_the_cpi_rule(kind): limit = _limit(kind) @@ -281,6 +308,12 @@ def test_published_2026_limits_need_the_unrounded_ratio(): (1_005, 100.0, 100.0, 1_010), (1_000, 100.0, 100.5, 1_010), (1_000, 100.0, 100.4, 1_000), + # Exact $5 products whose ratios have no finite decimal: 16,590 / + # 331.8 = 50, so 50 x 332.3 = 16,615 and 50 x 336.1 = 16,805; 33,120 + # / 331.2 = 100, so 100 x 331.45 = 33,145. + (16_590, 331.8, 332.3, 16_620), + (16_590, 331.8, 336.1, 16_810), + (33_120, 331.2, 331.45, 33_150), ], ) def test_adjustment_rounds_to_the_nearest_10(prior_limit, prior, current, expected): @@ -290,7 +323,7 @@ def test_adjustment_rounds_to_the_nearest_10(prior_limit, prior, current, expect ) -def _synthetic_tree(nsa_septembers, sa_septembers): +def _synthetic_tree(nsa_septembers, model_septembers): def values(data): return {"values": data} @@ -323,7 +356,7 @@ def values(data): "bls": { "cpi": { "cpi_u_nsa_september": values(nsa_septembers), - "cpi_u": values(sa_septembers), + "cpi_u": values(model_septembers), } }, } @@ -335,11 +368,12 @@ def test_extension_on_a_synthetic_tree(): nsa = {"2024-09-01": 315.301, "2025-09-01": 324.8, "2026-09-01": 336.94} nsa["2027-09-01"] = 330.0 # a fall nsa["2028-09-01"] = 340.0 - # The model's (seasonally adjusted) series differs from the published one, - # so a year that reads it shows which series it used. - sa = {date: 0.99 * value for date, value in nsa.items()} - sa["2029-09-01"] = 0.99 * 350.0 - parameters = _synthetic_tree(nsa, sa) + # The model's series (CBO annual averages for projected months) differs + # from the published one, so a year that reads it shows which series it + # used. + model = {date: 0.99 * value for date, value in nsa.items()} + model["2029-09-01"] = 0.99 * 350.0 + parameters = _synthetic_tree(nsa, model) extend_part_d_lis_resource_limits(parameters, end_year=2031) limits = parameters.gov.hhs.medicare.part_d.low_income_subsidy.eligibility limits = limits.resources.limit @@ -381,13 +415,15 @@ def test_amount_positive_and_below_spending(): VARIANTS = ["base", "more_ss", "more_interest", "more_assets"] LIMITS = LIS.eligibility.resources(f"{YEAR}-01-01") BURIAL = LIMITS.burial_exclusion +RENTAL = LIMITS.rental_property def _random_households(): rng = np.random.default_rng(SEED) - # Features added after the first sample come from their own generator, - # so the original draws stay the same. + # Features added after the first sample come from their own generators, + # so the earlier draws stay the same. extra = np.random.default_rng(SEED + 1) + equity = np.random.default_rng(SEED + 2) out = [] for _ in range(N): married = bool(rng.random() < 0.5) @@ -418,12 +454,16 @@ def person(): real_estate=int(extra.choice([0, 0, 0, 6_000, 60_000])), ) ) + rental_equity = int(equity.choice([0, 0, 0, 4_000, 14_000, -10_000])) + out[-1]["rental_equity"] = rental_equity + if equity.random() < 0.1: + out[-1]["real_estate"] = -8_000 return out def _boundary_households(): # Not deemed, in a Part D plan, taking the subsidy up, in Texas. - def person(social_security, bank_account_assets=0): + def person(social_security, bank_account_assets=0, rental_income=0): return dict( social_security=social_security, employment_income=0, @@ -437,16 +477,17 @@ def person(social_security, bank_account_assets=0): msp_eligible=False, takes_up_part_d_lis_if_eligible=True, takes_up_medicare_part_d_if_eligible=True, - rental_income=0, + rental_income=rental_income, ) - def household(members, real_estate=0): + def household(members, real_estate=0, rental_equity=0): return dict( state="TX", dependents=0, members=members, separate=False, real_estate=real_estate, + rental_equity=rental_equity, ) single = LIMITS.limit.individual + BURIAL @@ -460,6 +501,13 @@ def household(members, real_estate=0): household([person(6_000, couple - 9_000 + over), person(6_000, 9_000)]) ) out.append(household([person(6_000, single - 10_000 + over)], 10_000)) + # $14,000 of rental equity returning 6% of $6,000 counts $8,000. + out.append( + household( + [person(6_000, single - 8_000 + over, rental_income=1_000)], + rental_equity=14_000, + ) + ) # Countable income at 150% of the guideline, and $12 a year below. out.append(household([person(int(single_income + 240 - 12 * (1 - over)))])) out.append( @@ -542,6 +590,7 @@ def _situation(households, variants, inputs=True): "members": members, "state_code": {YEAR: h["state"]}, "household_other_real_estate_equity": {YEAR: h["real_estate"]}, + "household_rental_property_equity": {YEAR: h["rental_equity"]}, } situation = { "people": people, @@ -586,15 +635,29 @@ def unearned(m): return 12 * (countable_unearned + countable_earned) -def _restated_tests(h, members, real_estate=True): +def _restated_rental(h, members, exclude=True): + """Rental equity less up to $6,000 if net rent is 6% of the excluded part.""" + equity = max(h["rental_equity"], 0) + # Dependents have no rental income, so the couple's is the household's. + rent = sum(m["rental_income"] for m in members) + excludable = min(equity, RENTAL.equity_exclusion) + meets_return = rent >= RENTAL.minimum_return * excludable + return equity - (excludable if exclude and meets_return else 0) + + +def _restated_tests( + h, members, real_estate=True, rental=True, exclude_rental=True, floor=True +): """Family size, income test and resource test for the household's couple.""" couple = len(members) size = couple + h["dependents"] income_ok = _restated_countable(members) < 1.5 * _fpg(h["state"], size) resources = sum(m["bank_account_assets"] + m["stock_assets"] for m in members) # Every adult is 70 and every dependent 10, so the couple holds the - # household's real estate. - resources += h["real_estate"] if real_estate else 0 + # household's real estate, each amount counted at no less than zero. + other = max(h["real_estate"], 0) if floor else h["real_estate"] + resources += other if real_estate else 0 + resources += _restated_rental(h, members, exclude_rental) if rental else 0 limit = LIMITS.limit.couple if couple == 2 else LIMITS.limit.individual resource_ok = resources <= limit + BURIAL * couple return size, income_ok, resource_ok, resources - (limit + BURIAL * couple) @@ -725,9 +788,27 @@ def test_sample_reaches_every_branch(): "split_dependents_change_income_test", "rental_floor_changes_income_test", "real_estate_changes_resource_test", + "real_estate_floor_changes_resource_test", + "rental_equity_changes_resource_test", + "rental_exclusion_changes_resource_test", + "rental_return_short_counts_all_equity", + "more_ss_changes_income_test", + "more_assets_changes_resource_test", + "counting_interest_would_change_income_test", ], 0, ) + # The variants raise the head's inputs, so the monotonicity and + # no-change properties compare different households. + head = HOUSEHOLDS[0]["members"][0] + assert _variant(head, "more_ss", True)["social_security"] > head["social_security"] + assert ( + _variant(head, "more_assets", True)["bank_account_assets"] + > (head["bank_account_assets"]) + ) + more_interest = _variant(head, "more_interest", True) + assert more_interest["interest_income"] > head["interest_income"] + assert more_interest["dividend_income"] > head["dividend_income"] for i, h in enumerate(HOUSEHOLDS): members = _members(i, "base") size, income_ok, resource_ok, over = _restated_tests(h, members) @@ -748,6 +829,31 @@ def test_sample_reaches_every_branch(): ) without = _restated_tests(h, members, real_estate=False)[2] counts["real_estate_changes_resource_test"] += without != resource_ok + netted = _restated_tests(h, members, floor=False)[2] + counts["real_estate_floor_changes_resource_test"] += netted != resource_ok + without = _restated_tests(h, members, rental=False)[2] + counts["rental_equity_changes_resource_test"] += without != resource_ok + in_full = _restated_tests(h, members, exclude_rental=False)[2] + counts["rental_exclusion_changes_resource_test"] += in_full != resource_ok + counts["rental_return_short_counts_all_equity"] += h["rental_equity"] > 0 and ( + _restated_rental(h, members) == h["rental_equity"] + ) + more_ss = _restated_tests(h, _members(i, "more_ss"))[1] + counts["more_ss_changes_income_test"] += more_ss != income_ok + more_assets = _restated_tests(h, _members(i, "more_assets"))[2] + counts["more_assets_changes_resource_test"] += more_assets != resource_ok + with_interest = [ + { + **m, + "social_security": m["social_security"] + + m["interest_income"] + + m["dividend_income"], + } + for m in _members(i, "more_interest") + ] + counts["counting_interest_would_change_income_test"] += income_ok != ( + _restated_countable(with_interest) < 1.5 * _fpg(h["state"], size) + ) for me in members: counts["no_medicare"] += not me["medicare_enrolled"] routes = [me["medicaid_enrolled"], me["ssi"] > 0, me["msp_eligible"]] diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/integration.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/integration.yaml index 473be095d6d..b0ef5f2e18b 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/integration.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/integration.yaml @@ -271,6 +271,55 @@ part_d_lis_income_eligible: false part_d_lis: 0 +- name: Rental property equity above the $6,000 exclusion counts as a resource. + period: 2026 + input: + people: + person: + age: 70 + social_security: 18_000 + rental_income: 6_000 + bank_account_assets: 15_000 + households: + household: + members: [person] + state_code: TX + household_rental_property_equity: 100_000 + output: + # Countable income ((18,000 + 6,000) / 12 - 20) x 12 = 23,760 is under + # 23,940. The rental returns at least 6% of the excluded $6,000, so + # 100,000 - 6,000 = 94,000 counts: 15,000 + 94,000 = 109,000 > 18,090 + # (20 CFR 418.3405(b), 416.1222(a)). + part_d_lis_countable_income: 23_760 + part_d_lis_income_eligible: true + part_d_lis_countable_rental_property_equity: 94_000 + part_d_lis_resource_eligible: false + part_d_lis_eligible: false + part_d_lis: 0 + +- name: Negative real estate equity does not bring resources under the limit. + period: 2026 + input: + people: + person: + age: 72 + social_security: 22_800 + bank_account_assets: 20_000 + households: + household: + members: [person] + state_code: TX + household_other_real_estate_equity: -5_000 + output: + # Countable income 22,560 is over the QI limit and under 23,940. The real + # estate counts as zero, so $20,000 is over 18,090; netting it would give + # 15,000. + msp_eligible: false + part_d_lis_income_eligible: true + part_d_lis_resource_eligible: false + part_d_lis_eligible: false + part_d_lis: 0 + - name: Spouses filing separately share one family size. period: 2026 input: diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_rental_property_equity.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_rental_property_equity.yaml new file mode 100644 index 00000000000..acbeb22df68 --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_rental_property_equity.yaml @@ -0,0 +1,114 @@ +# Rental property equity counts as a resource less up to $6,000 when the +# household's net rental income is at least 6% of the excluded equity; when +# the return falls short, all of it counts (20 CFR 416.1222(a), POMS SI +# 01130.503). With $6,000 or more of equity, the return needed is 6% x +# 6,000 = 360. + +- name: POMS SI 01130.503 example 1, $10,000 of equity returning 6% counts $4,000. + period: 2026 + input: + people: + person: + rental_income: 600 + households: + household: + members: [person] + household_rental_property_equity: 10_000 + output: + part_d_lis_countable_rental_property_equity: 4_000 + +- name: A return of exactly 6% of the excluded equity meets the test. + period: 2026 + input: + people: + person: + rental_income: 360 + households: + household: + members: [person] + household_rental_property_equity: 10_000 + output: + part_d_lis_countable_rental_property_equity: 4_000 + +- name: A return a dollar short of 6% leaves all the equity countable. + period: 2026 + input: + people: + person: + rental_income: 359 + households: + household: + members: [person] + household_rental_property_equity: 10_000 + output: + part_d_lis_countable_rental_property_equity: 10_000 + +- name: POMS SI 01130.503 example 2, $3,000 of equity returning $750 is excluded. + period: 2026 + input: + people: + person: + rental_income: 750 + households: + household: + members: [person] + household_rental_property_equity: 3_000 + output: + # 6% x 3,000 = 180 <= 750. + part_d_lis_countable_rental_property_equity: 0 + +- name: Under $6,000 of equity, the return needed is 6% of that equity. + period: 2026 + input: + people: + person: + rental_income: 179 + households: + household: + members: [person] + household_rental_property_equity: 3_000 + output: + # 179 < 6% x 3,000 = 180. + part_d_lis_countable_rental_property_equity: 3_000 + +- name: A rental loss leaves all the equity countable. + period: 2026 + input: + people: + person: + rental_income: -2_000 + households: + household: + members: [person] + household_rental_property_equity: 5_000 + output: + part_d_lis_countable_rental_property_equity: 5_000 + +- name: Rental property worth less than its debt counts as zero. + period: 2026 + input: + people: + person: + rental_income: -2_000 + households: + household: + members: [person] + household_rental_property_equity: -20_000 + output: + part_d_lis_countable_rental_property_equity: 0 + +- name: The return test uses the household's combined rental income. + period: 2026 + input: + people: + spouse1: + rental_income: 200 + spouse2: + rental_income: 200 + households: + household: + members: [spouse1, spouse2] + household_rental_property_equity: 10_000 + output: + # 200 + 200 = 400 >= 360. + part_d_lis_countable_rental_property_equity: 4_000 diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.yaml index bf2e67838fb..b7d2dc50521 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.yaml @@ -179,3 +179,60 @@ # The couple: 27,000 <= 36,120. The mother: 9,000 + 10,000 = 19,000 > # 18,090. part_d_lis_resource_eligible: [true, true, false] + +- name: Rental property equity counts above its exclusion, at the limit. + period: 2026 + input: + people: + person: + bank_account_assets: 10_000 + rental_income: 1_000 + households: + household: + members: [person] + household_rental_property_equity: 14_090 + output: + # 1,000 >= 6% x 6,000 = 360, so 14,090 - 6,000 = 8,090 counts: 10,000 + + # 8,090 = 18,090 <= 16,590 + 1,500. + part_d_lis_resource_eligible: true + +- name: Rental property equity one dollar over the limit. + period: 2026 + input: + people: + person: + bank_account_assets: 10_000 + rental_income: 1_000 + households: + household: + members: [person] + household_rental_property_equity: 14_091 + output: + # 10,000 + 8,091 = 18,091 > 18,090. + part_d_lis_resource_eligible: false + +- name: Real estate worth less than its debt does not offset bank accounts. + period: 2026 + input: + people: + person: + bank_account_assets: 18_091 + households: + household: + members: [person] + household_other_real_estate_equity: -5_000 + output: + # The real estate counts as zero: 18,091 > 18,090. Netting it would give + # 13,091. + part_d_lis_resource_eligible: false + +- name: An overdrawn bank account does not offset stocks. + period: 2026 + input: + people: + person: + bank_account_assets: -1_000 + stock_assets: 18_091 + output: + # 18,091 > 18,090. Netting the overdraft would give 17,091. + part_d_lis_resource_eligible: false diff --git a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_rental_property_equity.py b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_rental_property_equity.py new file mode 100644 index 00000000000..7f4acf2989f --- /dev/null +++ b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_rental_property_equity.py @@ -0,0 +1,41 @@ +from policyengine_us.model_api import * + + +class part_d_lis_countable_rental_property_equity(Variable): + value_type = float + entity = Household + label = ( + "Countable rental property equity for the Medicare Part D low-income subsidy" + ) + documentation = ( + "Equity in rental property counts as a resource, less up to $6,000 " + "of it when the household's net rental income is at least 6% of " + "the excluded equity. If the return falls short, all of the equity " + "counts." + ) + unit = USD + definition_period = YEAR + reference = ( + "https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3405#p-418.3405(b)", + "https://www.ecfr.gov/current/title-20/chapter-III/part-416/subpart-L/section-416.1222#p-416.1222(a)", + "https://secure.ssa.gov/poms.nsf/lnx/0603030020", + "https://secure.ssa.gov/poms.nsf/lnx/0501130503", + ) + + def formula(household, period, parameters): + p = parameters( + period + ).gov.hhs.medicare.part_d.low_income_subsidy.eligibility.resources.rental_property + # SSA applies the SSI exclusions to Extra Help (POMS HI 03030.020), + # including the one for nonbusiness income-producing property (SI + # 01130.503), which covers a rental reported on Schedule E. Rental + # property used in a trade or business is excluded regardless of + # value (SI 01130.501), but the model can't tell the two apart and + # treats every rental as nonbusiness. It also treats the household's + # rentals as one property and does not model the exception for a + # temporary shortfall beyond the owner's control. + equity = max_(household("household_rental_property_equity", period), 0) + net_rental_income = add(household, period, ["rental_income"]) + excludable = min_(equity, p.equity_exclusion) + meets_return = net_rental_income >= p.minimum_return * excludable + return equity - where(meets_return, excludable, 0) diff --git a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.py b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.py index 16f82e95acc..87a948442f4 100644 --- a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.py +++ b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.py @@ -10,7 +10,9 @@ class part_d_lis_resource_eligible(Variable): "not exceed the individual or couple limit plus the burial funds " "exclusion for each of them. Resources are the couple's financial " "assets and, for the household head's couple, the household's " - "equity in real estate other than the home." + "equity in real estate other than the home, with rental property " + "equity reduced by the exclusion for income-producing property. " + "Each amount counts at zero when negative." ) definition_period = YEAR reference = ( @@ -19,6 +21,7 @@ class part_d_lis_resource_eligible(Variable): "https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3405", "https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3410", "https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3425", + "https://secure.ssa.gov/poms.nsf/lnx/0603030020", "https://secure.ssa.gov/poms.nsf/lnx/0603030025", ) @@ -26,7 +29,11 @@ def formula(person, period, parameters): p = parameters( period ).gov.hhs.medicare.part_d.low_income_subsidy.eligibility.resources - own = add(person, period, p.sources) + # A resource is worth at least nothing: an overdrawn account or + # property worth less than its debt does not offset other resources. + own = person.filled_array(0.0) + for source in p.sources: + own = own + max_(person(source, period), 0) # A household amount does not say whose it is. It counts in full for # the marital unit of the household head (the oldest member when no # head is designated), so it counts for one couple. @@ -40,7 +47,9 @@ def formula(person, period, parameters): ) household_amount = person.filled_array(0.0) for source in p.household_sources: - household_amount = household_amount + person.household(source, period) + household_amount = household_amount + max_( + person.household(source, period), 0 + ) resources = person.marital_unit.sum( own + holds_household_amount * household_amount ) diff --git a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/takes_up_part_d_lis_if_eligible.py b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/takes_up_part_d_lis_if_eligible.py index 3d4e8172bd7..09ae0317999 100644 --- a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/takes_up_part_d_lis_if_eligible.py +++ b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/takes_up_part_d_lis_if_eligible.py @@ -13,10 +13,11 @@ class takes_up_part_d_lis_if_eligible(Variable): "Medicare Savings Program enrollees are deemed eligible, but the " "model has Medicare Savings Program eligibility, not enrollment, so " "this flag covers them too. The subsidy also requires enrollment in " - "a Part D plan (medicare_part_d_enrolled), which CMS arranges for " - "subsidy-eligible people who don't choose one unless they decline " - "(42 CFR 423.34). The default, true, takes everyone up; microdata " - "can set a take-up rate." + "a Part D plan (medicare_part_d_enrolled); part_d_lis_enrolled " + "describes when CMS enrolls subsidy-eligible people who don't choose " + "a plan, and the exception for qualifying covered retirees (42 CFR " + "423.34(d)). The default, true, takes everyone up; microdata can set " + "a take-up rate." ) definition_period = YEAR default_value = True From 302244196ec9a14edfe8a95caa79b76425b0969e Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sat, 14 Nov 2026 15:45:01 -0500 Subject: [PATCH 33/35] Cite the statute for the rental exclusion and tidy two comments The rental property exclusion now cites 42 U.S.C. 1395w-114(a)(3)(E)(i), which makes the subsidy's resources SSI's, and 1382b(a)(3), SSI's exclusion for property essential to self-support. The variable's documentation names the parameters instead of their 2006 values, and the September filter's comment says what the gap in published years means. Co-Authored-By: Claude Opus 5.5 --- .../resources/rental_property/equity_exclusion.yaml | 8 ++++++++ .../resources/rental_property/minimum_return.yaml | 8 ++++++++ policyengine_us/parameters/uprating_extensions.py | 7 ++++--- .../part_d_lis_countable_rental_property_equity.py | 11 +++++++---- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/rental_property/equity_exclusion.yaml b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/rental_property/equity_exclusion.yaml index c730096413c..d7b1a681b36 100644 --- a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/rental_property/equity_exclusion.yaml +++ b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/rental_property/equity_exclusion.yaml @@ -7,6 +7,14 @@ metadata: period: year label: Medicare Part D low-income subsidy income-producing property equity exclusion reference: + # The subsidy's resources are SSI's (42 U.S.C. 1395w-114(a)(3)(E)(i)), + # which exclude property essential to self-support (42 U.S.C. + # 1382b(a)(3)); SSA applies 416.1222's rule to Extra Help (POMS HI + # 03030.020). + - title: 42 U.S.C. § 1395w-114(a)(3)(E)(i) - Alternative resource standard + href: https://www.law.cornell.edu/uscode/text/42/1395w-114#a_3_E_i + - title: 42 U.S.C. § 1382b(a)(3) - Exclusions from resources + href: https://www.law.cornell.edu/uscode/text/42/1382b#a_3 - title: 20 CFR § 416.1222(a) - How income-producing property essential to self-support is counted href: https://www.ecfr.gov/current/title-20/chapter-III/part-416/subpart-L/section-416.1222#p-416.1222(a) - title: SSA POMS HI 03030.020 - Resource Exclusions diff --git a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/rental_property/minimum_return.yaml b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/rental_property/minimum_return.yaml index 25193b1c96d..7f2dda6b07e 100644 --- a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/rental_property/minimum_return.yaml +++ b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/rental_property/minimum_return.yaml @@ -7,6 +7,14 @@ metadata: period: year label: Medicare Part D low-income subsidy income-producing property minimum return reference: + # The subsidy's resources are SSI's (42 U.S.C. 1395w-114(a)(3)(E)(i)), + # which exclude property essential to self-support (42 U.S.C. + # 1382b(a)(3)); SSA applies 416.1222's rule to Extra Help (POMS HI + # 03030.020). + - title: 42 U.S.C. § 1395w-114(a)(3)(E)(i) - Alternative resource standard + href: https://www.law.cornell.edu/uscode/text/42/1395w-114#a_3_E_i + - title: 42 U.S.C. § 1382b(a)(3) - Exclusions from resources + href: https://www.law.cornell.edu/uscode/text/42/1382b#a_3 - title: 20 CFR § 416.1222(a) - How income-producing property essential to self-support is counted href: https://www.ecfr.gov/current/title-20/chapter-III/part-416/subpart-L/section-416.1222#p-416.1222(a) - title: SSA POMS HI 03030.020 - Resource Exclusions diff --git a/policyengine_us/parameters/uprating_extensions.py b/policyengine_us/parameters/uprating_extensions.py index 49274d7bd30..30e7faab21d 100644 --- a/policyengine_us/parameters/uprating_extensions.py +++ b/policyengine_us/parameters/uprating_extensions.py @@ -653,9 +653,10 @@ def get_september_cpi_u_values(cpi: ParameterNode, year: int) -> Tuple[float, fl no seasonal pattern. Returns ``(prior September, later September)``. """ september = cpi.cpi_u_nsa_september - # Only September instants are BLS values, so any other instant (such as - # a backdated first value) is skipped. The series has gaps (1988, then - # 2018 on), and a missing year must not read the September before it. + # Only September instants are BLS values, so any other instant is + # skipped. The published years skip 1989 to 2017, so a year uses them + # only when both of its Septembers are published; otherwise a missing + # year would read the last September before it. published = { int(value.instant_str[:4]) for value in september.values_list diff --git a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_rental_property_equity.py b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_rental_property_equity.py index 7f4acf2989f..8dd260965a9 100644 --- a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_rental_property_equity.py +++ b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_rental_property_equity.py @@ -8,14 +8,17 @@ class part_d_lis_countable_rental_property_equity(Variable): "Countable rental property equity for the Medicare Part D low-income subsidy" ) documentation = ( - "Equity in rental property counts as a resource, less up to $6,000 " - "of it when the household's net rental income is at least 6% of " - "the excluded equity. If the return falls short, all of the equity " - "counts." + "Equity in rental property counts as a resource, less the exclusion " + "for income-producing property essential to self-support: up to the " + "equity exclusion when the household's net rental income is at least " + "the minimum return on the excluded equity. If the return falls " + "short, all of the equity counts." ) unit = USD definition_period = YEAR reference = ( + "https://www.law.cornell.edu/uscode/text/42/1395w-114#a_3_E_i", + "https://www.law.cornell.edu/uscode/text/42/1382b#a_3", "https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3405#p-418.3405(b)", "https://www.ecfr.gov/current/title-20/chapter-III/part-416/subpart-L/section-416.1222#p-416.1222(a)", "https://secure.ssa.gov/poms.nsf/lnx/0603030020", From 7764ee62489cc94a1d537fa385b759b215e7a37e Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sat, 14 Nov 2026 17:36:23 -0500 Subject: [PATCH 34/35] Test that negative assets count as zero and trace the rental exclusion Round 4 review P3s on #10127: - Two at-limit cases show a negative bank balance or negative real estate counts as zero rather than as its size, so an abs() floor now fails. - The rental variable and household_sources.yaml say why the exclusion follows the statute's section 1382b and POMS HI 03030.020 A rather than 20 CFR 418.3425 or 42 CFR 423.772 read alone, and cite 418.3425(c), 416.1222(a) and SI 01130.501. - The rental variable's documentation says trade-or-business rentals have no input, so every rental is held to the $6,000 exclusion. Co-Authored-By: Claude Opus 5.5 --- .../resources/household_sources.yaml | 6 ++++- .../part_d_lis_resource_eligible.yaml | 27 +++++++++++++++++++ ..._d_lis_countable_rental_property_equity.py | 15 +++++++++-- 3 files changed, 45 insertions(+), 3 deletions(-) diff --git a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/household_sources.yaml b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/household_sources.yaml index e151b660c04..b07a46c78e1 100644 --- a/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/household_sources.yaml +++ b/policyengine_us/parameters/gov/hhs/medicare/part_d/low_income_subsidy/eligibility/resources/household_sources.yaml @@ -14,11 +14,15 @@ metadata: # household, so the formula counts it for the household head's couple # and floors each amount at zero. Rental property equity counts less the # exclusion for income-producing property essential to self-support - # (see part_d_lis_countable_rental_property_equity). + # (see part_d_lis_countable_rental_property_equity). That exclusion comes + # from the statute's section 1382b and SSA's application of SI 01130.503 + # (HI 03030.020 A), not from 42 CFR 423.772 or 20 CFR 418.3425 read alone. - title: 20 CFR § 418.3405(b) - What types of resources do we count? href: https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3405#p-418.3405(b) - title: 20 CFR § 418.3425 - What resources do we exclude from counting? href: https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3425 + - title: 20 CFR § 416.1222(a) - How income-producing property essential to self-support is counted + href: https://www.ecfr.gov/current/title-20/chapter-III/part-416/subpart-L/section-416.1222#p-416.1222(a) - title: 42 CFR § 423.772 - Definitions (resources) href: https://www.ecfr.gov/current/title-42/chapter-IV/subchapter-B/part-423/subpart-P/section-423.772 - title: SSA POMS HI 03030.020 - Resource Exclusions diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.yaml index b7d2dc50521..d74e3b35264 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_resource_eligible.yaml @@ -226,6 +226,21 @@ # 13,091. part_d_lis_resource_eligible: false +- name: Real estate worth less than its debt counts as zero, not as its shortfall. + period: 2026 + input: + people: + person: + bank_account_assets: 18_090 + households: + household: + members: [person] + household_other_real_estate_equity: -5_000 + output: + # 18,090 + 0 = 18,090 <= 18,090. Counting the shortfall as a positive + # amount would give 23,090. + part_d_lis_resource_eligible: true + - name: An overdrawn bank account does not offset stocks. period: 2026 input: @@ -236,3 +251,15 @@ output: # 18,091 > 18,090. Netting the overdraft would give 17,091. part_d_lis_resource_eligible: false + +- name: An overdrawn bank account counts as zero, not as the amount overdrawn. + period: 2026 + input: + people: + person: + bank_account_assets: -1_000 + stock_assets: 18_090 + output: + # 0 + 18,090 = 18,090 <= 18,090. Counting the overdraft as a positive + # amount would give 19,090. + part_d_lis_resource_eligible: true diff --git a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_rental_property_equity.py b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_rental_property_equity.py index 8dd260965a9..9ab270a4798 100644 --- a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_rental_property_equity.py +++ b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_rental_property_equity.py @@ -12,7 +12,9 @@ class part_d_lis_countable_rental_property_equity(Variable): "for income-producing property essential to self-support: up to the " "equity exclusion when the household's net rental income is at least " "the minimum return on the excluded equity. If the return falls " - "short, all of the equity counts." + "short, all of the equity counts. Rental property used in a trade " + "or business is excluded regardless of value, but the model has no " + "input for it, so every rental is held to the equity exclusion." ) unit = USD definition_period = YEAR @@ -20,8 +22,10 @@ class part_d_lis_countable_rental_property_equity(Variable): "https://www.law.cornell.edu/uscode/text/42/1395w-114#a_3_E_i", "https://www.law.cornell.edu/uscode/text/42/1382b#a_3", "https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3405#p-418.3405(b)", + "https://www.ecfr.gov/current/title-20/chapter-III/part-418/subpart-D/section-418.3425#p-418.3425(c)", "https://www.ecfr.gov/current/title-20/chapter-III/part-416/subpart-L/section-416.1222#p-416.1222(a)", "https://secure.ssa.gov/poms.nsf/lnx/0603030020", + "https://secure.ssa.gov/poms.nsf/lnx/0501130501", "https://secure.ssa.gov/poms.nsf/lnx/0501130503", ) @@ -29,7 +33,14 @@ def formula(household, period, parameters): p = parameters( period ).gov.hhs.medicare.part_d.low_income_subsidy.eligibility.resources.rental_property - # SSA applies the SSI exclusions to Extra Help (POMS HI 03030.020), + # The statute takes resources "as determined under section 1382b", + # whose (a)(3) excludes property essential to self-support. Read + # alone, the regulations don't show this exclusion: 20 CFR 418.3425 + # brings in 416.1222 only for property of a trade or business + # (paragraph (c)) and 416.1224 for other property (paragraph (d)), + # and 42 CFR 423.772 counts real estate other than the home without + # exclusions. The model follows the statute and SSA's reading of it: + # SSA applies the SSI exclusions to Extra Help (POMS HI 03030.020 A), # including the one for nonbusiness income-producing property (SI # 01130.503), which covers a rental reported on Schedule E. Rental # property used in a trade or business is excluded regardless of From 5f60570dcce7e4613f0f5727270c6c93b97251cc Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sat, 14 Nov 2026 18:41:28 -0500 Subject: [PATCH 35/35] Say where the uncapped business-property exclusion comes from Round 4 delta review P3s on #10127: the codified 20 CFR 416.1222(a) still caps trade-or-business property at $6,000, so the documentation and comment now say that the last clause of 42 U.S.C. 1382b(a)(3) and POMS SI 01130.501 A.2 override that cap from May 1, 1990. The comment's claim that the regulations don't show the rental exclusion now names the Extra Help regulations, since the SSI regulation 416.1222(a) does show it. Co-Authored-By: Claude Opus 5.5 --- ..._d_lis_countable_rental_property_equity.py | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_rental_property_equity.py b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_rental_property_equity.py index 9ab270a4798..af888620ac7 100644 --- a/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_rental_property_equity.py +++ b/policyengine_us/variables/gov/hhs/medicare/part_d/low_income_subsidy/part_d_lis_countable_rental_property_equity.py @@ -13,8 +13,10 @@ class part_d_lis_countable_rental_property_equity(Variable): "equity exclusion when the household's net rental income is at least " "the minimum return on the excluded equity. If the return falls " "short, all of the equity counts. Rental property used in a trade " - "or business is excluded regardless of value, but the model has no " - "input for it, so every rental is held to the equity exclusion." + "or business is excluded regardless of value under 42 U.S.C. " + "1382b(a)(3) and POMS SI 01130.501, although the codified 20 CFR " + "416.1222(a) still caps it. The model has no input for it, so every " + "rental is held to the equity exclusion." ) unit = USD definition_period = YEAR @@ -34,20 +36,22 @@ def formula(household, period, parameters): period ).gov.hhs.medicare.part_d.low_income_subsidy.eligibility.resources.rental_property # The statute takes resources "as determined under section 1382b", - # whose (a)(3) excludes property essential to self-support. Read - # alone, the regulations don't show this exclusion: 20 CFR 418.3425 + # whose (a)(3) excludes property essential to self-support. Read alone, + # the Extra Help regulations don't show this exclusion: 20 CFR 418.3425 # brings in 416.1222 only for property of a trade or business - # (paragraph (c)) and 416.1224 for other property (paragraph (d)), - # and 42 CFR 423.772 counts real estate other than the home without + # (paragraph (c)) and 416.1224 for other property (paragraph (d)), and + # 42 CFR 423.772 counts real estate other than the home without # exclusions. The model follows the statute and SSA's reading of it: # SSA applies the SSI exclusions to Extra Help (POMS HI 03030.020 A), # including the one for nonbusiness income-producing property (SI # 01130.503), which covers a rental reported on Schedule E. Rental - # property used in a trade or business is excluded regardless of - # value (SI 01130.501), but the model can't tell the two apart and - # treats every rental as nonbusiness. It also treats the household's - # rentals as one property and does not model the exception for a - # temporary shortfall beyond the owner's control. + # property used in a trade or business is excluded regardless of value: + # the codified 416.1222(a) still caps it at $6,000, but the last clause + # of 1382b(a)(3) and SI 01130.501 A.2 override that cap from May 1, + # 1990. The model can't tell the two apart and treats every rental as + # nonbusiness. It also treats the household's rentals as one property + # and does not model the exception for a temporary shortfall beyond the + # owner's control. equity = max_(household("household_rental_property_equity", period), 0) net_rental_income = add(household, period, ["rental_income"]) excludable = min_(equity, p.equity_exclusion)