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

Qualified dividends cause 2021 US tax and credit calculation problems #1200

Closed martinholmer closed 2 years ago

martinholmer commented 2 years ago

The presence of qualified dividends in a very simple case causes two tax calculation problems:

The following case, which was tested using the 0.116.0 version, should receive exactly half of the 2021 $1400 RRC because its AGI is exactly half way between the phase-out begin and end amounts of $75,000 and $80,000.

Here is the YAML test file:

# OpenFisca-US test file derived from v21.its.csv and v21.ota.csv files
- name: Tax unit with taxsimid 0 from v21.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: 40
        pension_income: 76500
        qualified_dividend_income: 1000
        ssi: 0
        state_supplement: 0
        wic: 0
    spm_units:
      spm_unit:
        members: [person1]
        snap: 0
        tanf: 0
    tax_units:
      tax_unit:
        members: [person1]
        premium_tax_credit: 0
    households:
      household:
        members: [person1]
        state_code: TX
  output:
    taxsim_tfica: 0.00
    income_tax: 9267.50

Here are the test results for the above YAML file:

  Test 'Tax unit with taxsimid 0 from v21.its.csv':
    income_tax@2021: [8767.5] differs from 9267.5 
      with an absolute margin [500.] > 0.01

The trace output from this test contains this:

rrc_arpa<2021> >> [980.]

rather than the expected $700. This is caused because OpenFisca-US thinks the AGI for this case is $76,500 not the $77,500 that the other two models get.

The remaining tax difference is $220, which (perhaps not coincidently) equals 22% of the $1000 qualified dividends. TAXSIM35 calculates that this case is in the 22% tax bracket. I don't understand what OpenFisca-US is doing with the taxation of qualified dividends, but whatever it is doing it is different from what TAXSIM35 and US Tax Analyzer are doing.

martinholmer commented 2 years ago

The problem reported in issue #1200 has been eliminated in the 0.118.0 version by the fix in PR #1197. Thanks, Nikhil.