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
100 stars 174 forks source link

Incorrect Lifetime Learning Credit amount in years before 2021 #1324

Open martinholmer opened 2 years ago

martinholmer commented 2 years ago

Before 2021, the AGI phase-out parameters for the Lifetime Learning Credit (calculated in Part II of IRS Form 8863) differed from the AGI phase-out parameters for the American Opportunity Credit (calculated in Part I of IRS Form 8863). In 2021, these two sets of phase-out parameters were the same, and that is how OpenFisca-US 0.136.0 version has it for all years. Because the LLC phase-out begins at lower AGI than the AOC phase-out begin in years before 2021, the current code in OpenFisca-US sometimes assigns a positive LLC amount to a tax unit that in reality has AGI too large to receive a LLC.

The parameter differences in years before 2021 can be read straight off each Form 8863, links to which are provided on this IRS webpage.

The following 2020 test case illustrates this problem. First, the YAML test file, then the test results, and finally excerpts from the OpenFisca-US test trace and the USI-Tax-Analyzer dump output. The expected income tax in the test is derived from the USI-Tax-Analyzer because TAXSIM35 does not simulate education credits.

Here is the test file:

- name: Tax unit created by hand to illustrate pre-2021 LLC problem
  absolute_error_margin: 0.01
  period: 2020
  input:
    people:
      person1:
        is_tax_unit_head: 1
        is_tax_unit_spouse: 0
        is_tax_unit_dependent: 0
        age: 25
        ssi: 0
        state_supplement: 0
        wic: 0
        qualified_tuition_expenses: 4000
        is_eligible_for_american_opportunity_credit: 0
      person2:
        is_tax_unit_head: 0
        is_tax_unit_spouse: 1
        is_tax_unit_dependent: 0
        age: 25
        ssi: 0
        state_supplement: 0
        wic: 0
        employment_income: 150000
    spm_units:
      spm_unit:
        members: [person1, person2]
        snap: 0
        tanf: 0
    tax_units:
      tax_unit:
        members: [person1, person2]
        premium_tax_credit: 0
    households:
      household:
        members: [person1, person2]
        state_code: TX
  output:
    income_tax: 14644

Here are the test results:

================================= FAILURES ===================================
_______________________________ test session _________________________________
/Users/mrh/work/l20id1.test.yaml:
  Test 'Tax unit created by hand to illustrate pre-2021 LLC problem':
    income_tax@2020: [13844.] differs from 14644.0
      with an absolute margin [800.] > 0.01
========================= short test summary info ============================
FAILED l20id1.test.yaml::
============================ 1 failed in 0.64s ===============================

Here are some excerpts from the OpenFisca-US test trace:

adjusted_gross_income<2020> >> [146000.]
lifetime_learning_credit<2020> >> [800.]
recovery_rebate_credit<2020> >> [3600.]
income_tax<2020> >> [13844.]

And here are some excerpts from the USI-Tax-Analyzer dump output:

c00100 146000.0   <--- AGI
c07230 0.0        <--- LLC
rrc 3600.0
itax 14644.0  

So, the $800 income tax difference is caused by the fact that USI-Tax-Analyzer is using the AGI phase-out parameters specified by IRS on the 2020 Form 8863 while OpenFisca-US is neglecting to do this in 2020 and years before 2020.

martinholmer commented 1 year ago

Given that this pre-2021 LLC phase-out bug has no effect beginning in 2021 and given that few datasets include information on qualified tuition expenses that are not eligible for the American Opportunity Credit, it seems like the cost of correcting this bug is larger than the benefit of correcting the bug. Given those considerations, I'm closing this issue.

MaxGhenis commented 1 year ago

Thanks Martin, I agree this is low-priority, though I'd prefer we keep uncompleted issues open and as we identify a project management system we'll push prioritization there. We've used ZenHub in the past (where we assigned some issues to the "Icebox") and we're starting to try the new GitHub Projects; @ibushong also recently recommended Linear.