PolicyEngine / policyengine-us

The PolicyEngine US Python package contains a rules engine of the US tax-benefit system, and microdata generation for microsimulation analysis.
https://policyengine.org/us
GNU Affero General Public License v3.0
103 stars 176 forks source link

Missing MD Two-Income Married Couple Subtraction Worksheet logic #1481

Closed martinholmer closed 1 year ago

martinholmer commented 2 years ago

When comparing 2021 MD income taxes produced by PolicyEngine-US 0.176.0 versus TAXSIM35 10/24/22 version, we get many differences even for simple tax units.

One problem is that PolicyEngine is missing logic for the Two-Income Married Couple Subtraction Worksheet. Here is a screenshot of the 2021 worksheet:

MD-two-income-married-subtraction

Here is the test case showing the difference between the two models for a married couple with two incomes:

# PolicyEngine US test file derived from p21.its.csv and p21.ots.csv files

- name: Tax unit with taxsimid 2074 from p21.its.csv
  absolute_error_margin: 0.01
  period: 2021
  input:
    people:
      person1:
        is_tax_unit_head: 1
        is_tax_unit_spouse: 0
        is_tax_unit_dependent: 0
        age: 34
        employment_income: 4000
        ssi: 0
        state_supplement: 0
        wic: 0
      person2:
        is_tax_unit_head: 0
        is_tax_unit_spouse: 1
        is_tax_unit_dependent: 0
        age: 40
        employment_income: 20000
        ssi: 0
        state_supplement: 0
        wic: 0
      person3:
        is_tax_unit_head: 0
        is_tax_unit_spouse: 0
        is_tax_unit_dependent: 1
        age: 11
        ssi: 0
        state_supplement: 0
        wic: 0
      person4:
        is_tax_unit_head: 0
        is_tax_unit_spouse: 0
        is_tax_unit_dependent: 1
        age: 11
        ssi: 0
        state_supplement: 0
        wic: 0
      person5:
        is_tax_unit_head: 0
        is_tax_unit_spouse: 0
        is_tax_unit_dependent: 1
        age: 16
        ssi: 0
        state_supplement: 0
        wic: 0
    spm_units:
      spm_unit:
        members: [person1, person2, person3, person4, person5]
        snap: 0
        tanf: 0
    tax_units:
      tax_unit:
        members: [person1, person2, person3, person4, person5]
        premium_tax_credit: 0
    households:
      household:
        members: [person1, person2, person3, person4, person5]
        state_code: MD
  output:
    md_income_tax: -3308.00

The results for the above test case are:

================================= FAILURES ===================================
_______________________________ test session _________________________________
/Users/mrh/work/PolicyEngine-US/MD/p21-id2074.test.yaml:
  Test 'Tax unit with taxsimid 2074 from p21.its.csv':
    md_income_tax@2021: [-2871.0999] differs from -3308.0
                        with an absolute margin [436.90015] > 0.01
========================= short test summary info ============================
FAILED p21-id2074.test.yaml::
============================ 1 failed in 0.54s ===============================
fedderw commented 1 year ago

Yeah, this makes sense. I would have sworn up and down that I made an issue for this already, but it appears not

martinholmer commented 1 year ago

Will @fedderw, That would be great if you could add logic for the MD Two-Income Married Couple Subtraction Worksheet.

fedderw commented 1 year ago

Will @fedderw, That would be great if you could add logic for the MD Two-Income Married Couple Subtraction Worksheet.

I'll take a look at it tonight! It's been a while and I need to refresh

martinholmer commented 1 year ago

Will @fedderw, Are you busy with other things or have you hit a problem in resolving issue #1481? If the later, feel free to share the problem you are facing and perhaps others will be able to help.