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

Incorrect calculation of 2021 MA Senior Circuit Breaker qualifying income #1028

Closed martinholmer closed 2 years ago

martinholmer commented 2 years ago

When using the 0.86.0 version, OpenFisca-US computes the same Senior Circuit Breaker (SCB) credit and the same MA income tax liability as TAXSIM35 in almost all of the q21 validation sample cases. The following test case is an example of the cases where there is a SCB qualifying income difference, and hence, a SCB credit difference and a MA income tax difference.

Here is the test case with a discussion below:

# OpenFisca-US test file derived from q21.its.csv and q21.ots.csv files

- name: Tax unit with taxsimid 94202 from q21.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: 73
        employment_income: 3000
        social_security: 2000
        real_estate_taxes: 2000
        interest_expense: 10000
      person2:
        is_tax_unit_head: 0
        is_tax_unit_spouse: 1
        is_tax_unit_dependent: 0
        age: 77
        employment_income: 4000
      person3:
        is_tax_unit_head: 0
        is_tax_unit_spouse: 0
        is_tax_unit_dependent: 1
        age: 11
      person4:
        is_tax_unit_head: 0
        is_tax_unit_spouse: 0
        is_tax_unit_dependent: 1
        age: 11
      person5:
        is_tax_unit_head: 0
        is_tax_unit_spouse: 0
        is_tax_unit_dependent: 1
        age: 11
    tax_units:
      tax_unit:
        members: [person1, person2, person3, person4, person5]
        premium_tax_credit: 0
    households:
      household:
        members: [person1, person2, person3, person4, person5]
        state_code: MA
  output:
    ma_income_tax: -2475.00

The models agree on the MA AGI of $7000, but OpenFisca-US generates an SCB qualifying income of $39,847.68 while the MA Tax-Analyzer (which generates the same MA income tax amount for this case as TAXSIM35) generates an SCB qualifying income of $4600.

If we use this test case to fill out the 2021 MA Schedule CB, we have the following line entries:

(L3)   7000.  [MA AGI]
(L4)   2000.  [social security benefits]
(L5)      0.  [pension benefits]
(L6)      0.  [misc income including "cash public assistance"]
(L7)   9000.  [sum of (L3), (L4), (L5), and (L6)]
(L8)   4400.  [sum of 3000 dependent exemptions and 1400 aged exemptions]
(L9)   4600.  [(L7) minus (L8) = SCB qualifying income]

I don' understand how OpenFisca-US generates a (L9) amount of nearly $40,000 for this test case.

nikhilwoodruff commented 2 years ago

Thanks for filing this Martin. I think I understand why OpenFisca-US produces this result.

It's to do with the 'cash public assistance'. From my understanding, this includes benefits such as SNAP and SSI which are simulated by OpenFisca. This means that in test cases, we'll need to provide two more entity levels: SPM unit (used to decide SNAP groups) and marital unit (used to decide SSI groups). I've added a modified version of your test below adding these entity definitions. This reduces the total benefits simulated compared to your input, because OpenFisca defaults to putting everyone in their own household/family/etc if groups are not specified.

After this, the calculation is:

(L3) 7000. [MA AGI] (L4) 2000. [social security benefits] (L5) 0. [pension benefits] (L6) 0 *11148 (SNAP) + 11422 (SSI) + 605 2 (State suplements) = 23780. [misc income including "cash public assistance"] (L7) 9000/ 32780. [sum of (L3), (L4), (L5), and (L6)] (L8) 4400. [sum of 3000 dependent exemptions and 1400 aged exemptions] (L9) 4600 28380**. [(L7) minus (L8) = SCB qualifying income]

Does this make sense?

# OpenFisca-US test file derived from q21.its.csv and q21.ots.csv files

- name: Tax unit with taxsimid 94202 from q21.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: 73
        employment_income: 3000
        social_security: 2000
        real_estate_taxes: 2000
        interest_expense: 10000
      person2:
        is_tax_unit_head: 0
        is_tax_unit_spouse: 1
        is_tax_unit_dependent: 0
        age: 77
        employment_income: 4000
      person3:
        is_tax_unit_head: 0
        is_tax_unit_spouse: 0
        is_tax_unit_dependent: 1
        age: 11
      person4:
        is_tax_unit_head: 0
        is_tax_unit_spouse: 0
        is_tax_unit_dependent: 1
        age: 11
      person5:
        is_tax_unit_head: 0
        is_tax_unit_spouse: 0
        is_tax_unit_dependent: 1
        age: 11
    tax_units:
      tax_unit:
        members: [person1, person2, person3, person4, person5]
        premium_tax_credit: 0
    households:
      household:
        members: [person1, person2, person3, person4, person5]
        state_code: MA
    spm_units:
      spm_unit:
        members: [person1, person2, person3, person4, person5]
    marital_units:
      marital_unit:
        members: [person1, person2]
  output:
    ma_income_tax: -2475.00
martinholmer commented 2 years ago

@nikhilwoodruff said in issue #1028:

Thanks for filing this Martin. I think I understand why OpenFisca-US produces this result.

It's to do with the 'cash public assistance'. From my understanding, this includes benefits such as SNAP and SSI which are simulated by OpenFisca.

Certainly SSI benefits are "cash public assistance", but years ago when I was studying public assistance programs, Food Stamps (now called SNAP) were "in-kind benefits" meaning they were not "cash public assistance". Have things changed? Is there a place in the MA tax legislation that specifically calls for SNAP benefits to be included on line 6 of the MA Schedule CB?

nikhilwoodruff commented 2 years ago

@martinholmer yes, if you look at this Mass.gov page(in the income definition section) it states that the value of food stamps is included.

martinholmer commented 2 years ago

@nikhilwoodruff, Thanks for clarifying that SNAP benefits are considered "cash public assistance" under MA income tax law.

nikhilwoodruff commented 2 years ago

No problem. On the validation side, if you want to disable benefits simulation, you can also specify snap: 0 on the SPM unit inputs, and for the other benefits.

martinholmer commented 2 years ago

@nikhilwoodruff, Yes. The validation testing software already includes the line "premium_tax_credit: 0" because TAXSIM knows nothing about SLCSP premiums, etc.

I'll enhance the validation test software to zero of these benefit amounts that TAXSIM knows nothing about. Thanks for your insightful diagnosis of the latest (incorrect) test results.

martinholmer commented 2 years ago

Closing issue #1028 and implementing @nikhilwoodruff insights in enhanced validation testing scripts.