Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/zero-imputed-medical-premiums.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Description: Zero PE's imputed Medicare Part B premiums (medical_expense_health_insurance_premiums) so they don't inflate state medical exemptions/deductions, restoring TAXSIM/TaxAct parity for elderly itemizers (MA, OK, OH).
10 changes: 10 additions & 0 deletions policyengine_taxsim/core/input_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,16 @@ def form_household_situation(year, state, taxsim_vars):
"commodity_supplemental_food_program"
] = {str(year): 0}

# Explicitly set imputed medical expenses to 0 for all people. TAXSIM has no
# medical-expense input, so PE's imputed Medicare Part B premiums would
# otherwise flow through the federal itemized medical deduction into state
# medical exemptions/deductions (e.g. MA Schedule Y, OK Schedule 511-D, OH),
# understating state tax relative to TAXSIM/TaxAct.
for person_name in household_situation["people"]:
household_situation["people"][person_name][
"medical_expense_health_insurance_premiums"
] = {str(year): 0}

# Explicitly set SNAP to 0 for all SPM units to prevent PolicyEngine from imputing SNAP benefits
# TAXSIM does not model SNAP, so we need to ensure it's not automatically calculated
for spm_unit_name in household_situation["spm_units"]:
Expand Down
6 changes: 6 additions & 0 deletions policyengine_taxsim/core/yaml_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ def generate_yaml(
"commodity_supplemental_food_program": person_data.get(
"commodity_supplemental_food_program", {}
).get(year_str, 0),
# TAXSIM has no medical-expense input; zero PE's imputed Medicare
# Part B premiums so they don't flow into state medical
# exemptions/deductions via the federal itemized medical deduction.
"medical_expense_health_insurance_premiums": person_data.get(
"medical_expense_health_insurance_premiums", {}
).get(year_str, 0),
}

# Add optional fields only if they have non-zero values
Expand Down
4 changes: 4 additions & 0 deletions policyengine_taxsim/runners/policyengine_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ def _initialize_dataset_structure(self) -> dict:
"head_start", # Head Start should be 0 to match TAXSIM (which doesn't model Head Start)
"early_head_start", # Early Head Start should be 0 to match TAXSIM (which doesn't model Early Head Start)
"commodity_supplemental_food_program", # Commodity supplemental food program should be 0 to match TAXSIM (which doesn't model this program)
"medical_expense_health_insurance_premiums", # TAXSIM has no medical-expense input; zero PE's imputed Medicare Part B premiums so they don't flow into state medical exemptions/deductions via the federal itemized medical deduction
}

# Combine all variables
Expand Down Expand Up @@ -837,6 +838,9 @@ def generate(self) -> None:
data["commodity_supplemental_food_program"][year_int] = np.zeros(
total_people_for_year
) # Set commodity supplemental food program to 0 to match TAXSIM (which doesn't model this program)
data["medical_expense_health_insurance_premiums"][year_int] = np.zeros(
total_people_for_year
) # TAXSIM has no medical-expense input; zero PE's imputed Medicare Part B premiums so they don't flow into state medical exemptions/deductions via the federal itemized medical deduction

# Household data
data["household_id"][year_int] = year_household_ids
Expand Down
14 changes: 14 additions & 0 deletions tests/test_mappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def test_import_single_household(sample_taxsim_input):
"head_start": {"2021": 0},
"early_head_start": {"2021": 0},
"commodity_supplemental_food_program": {"2021": 0},
"medical_expense_health_insurance_premiums": {"2021": 0},
}
},
"spm_units": {
Expand Down Expand Up @@ -128,6 +129,7 @@ def test_import_single_household_without_state(sample_taxsim_input_without_state
"head_start": {"2021": 0},
"early_head_start": {"2021": 0},
"commodity_supplemental_food_program": {"2021": 0},
"medical_expense_health_insurance_premiums": {"2021": 0},
}
},
"spm_units": {
Expand Down Expand Up @@ -162,6 +164,7 @@ def test_import_single_household_with_state_eq_0(sample_taxsim_input_with_state_
"head_start": {"2021": 0},
"early_head_start": {"2021": 0},
"commodity_supplemental_food_program": {"2021": 0},
"medical_expense_health_insurance_premiums": {"2021": 0},
}
},
"spm_units": {
Expand Down Expand Up @@ -250,6 +253,7 @@ def test_joint_household(sample_taxsim_input_for_joint):
"head_start": {"2023": 0},
"early_head_start": {"2023": 0},
"commodity_supplemental_food_program": {"2023": 0},
"medical_expense_health_insurance_premiums": {"2023": 0},
},
"your partner": {
"age": {"2023": 40},
Expand All @@ -259,6 +263,7 @@ def test_joint_household(sample_taxsim_input_for_joint):
"head_start": {"2023": 0},
"early_head_start": {"2023": 0},
"commodity_supplemental_food_program": {"2023": 0},
"medical_expense_health_insurance_premiums": {"2023": 0},
},
"your first dependent": {
"age": {"2023": 10},
Expand All @@ -270,6 +275,7 @@ def test_joint_household(sample_taxsim_input_for_joint):
"head_start": {"2023": 0},
"early_head_start": {"2023": 0},
"commodity_supplemental_food_program": {"2023": 0},
"medical_expense_health_insurance_premiums": {"2023": 0},
},
"your second dependent": {
"age": {"2023": 10},
Expand All @@ -281,6 +287,7 @@ def test_joint_household(sample_taxsim_input_for_joint):
"head_start": {"2023": 0},
"early_head_start": {"2023": 0},
"commodity_supplemental_food_program": {"2023": 0},
"medical_expense_health_insurance_premiums": {"2023": 0},
},
},
"spm_units": {
Expand Down Expand Up @@ -356,6 +363,7 @@ def test_household_with_dependent(sample_taxsim_input_for_household_with_depende
"head_start": {"2023": 0},
"early_head_start": {"2023": 0},
"commodity_supplemental_food_program": {"2023": 0},
"medical_expense_health_insurance_premiums": {"2023": 0},
},
"your partner": {
"age": {"2023": 40},
Expand All @@ -365,6 +373,7 @@ def test_household_with_dependent(sample_taxsim_input_for_household_with_depende
"head_start": {"2023": 0},
"early_head_start": {"2023": 0},
"commodity_supplemental_food_program": {"2023": 0},
"medical_expense_health_insurance_premiums": {"2023": 0},
},
"your first dependent": {
"age": {"2023": 4},
Expand All @@ -376,6 +385,7 @@ def test_household_with_dependent(sample_taxsim_input_for_household_with_depende
"head_start": {"2023": 0},
"early_head_start": {"2023": 0},
"commodity_supplemental_food_program": {"2023": 0},
"medical_expense_health_insurance_premiums": {"2023": 0},
},
"your second dependent": {
"age": {"2023": 10},
Expand All @@ -387,6 +397,7 @@ def test_household_with_dependent(sample_taxsim_input_for_household_with_depende
"head_start": {"2023": 0},
"early_head_start": {"2023": 0},
"commodity_supplemental_food_program": {"2023": 0},
"medical_expense_health_insurance_premiums": {"2023": 0},
},
},
"spm_units": {
Expand Down Expand Up @@ -455,6 +466,7 @@ def test_household_with_dependent_single_parent(
"head_start": {"2023": 0},
"early_head_start": {"2023": 0},
"commodity_supplemental_food_program": {"2023": 0},
"medical_expense_health_insurance_premiums": {"2023": 0},
},
"your first dependent": {
"age": {"2023": 4},
Expand All @@ -466,6 +478,7 @@ def test_household_with_dependent_single_parent(
"head_start": {"2023": 0},
"early_head_start": {"2023": 0},
"commodity_supplemental_food_program": {"2023": 0},
"medical_expense_health_insurance_premiums": {"2023": 0},
},
"your second dependent": {
"age": {"2023": 10},
Expand All @@ -477,6 +490,7 @@ def test_household_with_dependent_single_parent(
"head_start": {"2023": 0},
"early_head_start": {"2023": 0},
"commodity_supplemental_food_program": {"2023": 0},
"medical_expense_health_insurance_premiums": {"2023": 0},
},
},
"spm_units": {
Expand Down
Loading