Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix erroneous federal AMT calculation #4775

Closed
martinholmer opened this issue Jul 23, 2024 · 8 comments · Fixed by #4815
Closed

Fix erroneous federal AMT calculation #4775

martinholmer opened this issue Jul 23, 2024 · 8 comments · Fixed by #4815
Assignees
Labels
bug Something isn't working tax Federal and state tax policy

Comments

@martinholmer
Copy link
Collaborator

martinholmer commented Jul 23, 2024

The following simple 2022 test case illustrates a major flaw in the federal AMT calculations that can cause PolicyEngine-US to generate federal income tax amounts that are many thousands of dollars larger than the correct amounts. This flaw causes errors as far back at 2018 (see #4769).

The characterization of this situation as a bug seems sensible because online TAXSIM-35 and Tax-Calculator 4.2.0 and 2022 Turbo Tax are all in agreement that this test case has a zero AMT. PolicyEngine-US 1.28.0, however, generates a federal AMT amount equal to $7,538.50.

That this bug exists is not particularly surprising because the developers of the alternative_minimum_tax formula did not specify any unit tests for it. (At least, I can't find any tests when doing a recursive grep operation over the source code tree.). Also, the 2022 federal income testing done in issue #1773 never considered test cases with more than $10K in qualified dividends or more than $10K in long-term capital gains.

First, I show the YAML file containing the test case. Then I show several screenshots from Turbo Tax processing a make-believe person like the test case.

The YAML test case:

- name: Single Texan with no children, $150K wages, $50K QDIV, $50K LTCG
  absolute_error_margin: 0.01
  period: 2022
  input:
    people:
      person1:
        age: 50
        employment_income: 150_000
        qualified_dividend_income: 50_000
        long_term_capital_gains: 50_000
    spm_units:
      spm_unit:
        members: [person1]
    tax_units:
      tax_unit:
        members: [person1]
    households:
      household:
        members: [person1]
        state_code: TX
  output:
    # expected output from online TAXSIM-35
    # which is at: https://taxsim.nber.org/taxsim35/
    #
    adjusted_gross_income: 250_000
    taxable_income: 237_050
    net_investment_income_tax: 1_900
    income_tax: 43_627.50

##############################################################################
# ABOVE TEST IS IN A FILE NAMED case22.yaml
# TEST ENVIRONMENT:
#   % pip list | grep policyengine
#   policyengine-core             2.21.8
#   policyengine-us               1.28.0
# RESULTS FROM RUNNING THIS TEST ARE AS FOLLOWS:
#
#=============================== FAILURES ===================================
#_____________________________ test session _________________________________
#/Users/mrh/work/.../case22.yaml:
#  Test 'Single Texan with no children, $150K wages, $50K QDIV, $50K LTCG':
#    income_tax@2022: [51166.] differs from 43627.5
#                     with an absolute margin [7538.5] > 0.01
#======================= short test summary info ============================
#FAILED case22.yaml::
#========================== 1 failed in 3.19s ===============================
#Trace output is in file: case22.trace
#% grep alternative_minimum_tax case22.trace
#         alternative_minimum_tax<2022, (default)> = [7538.5]
# So, the income tax difference is caused solely by the AMT difference.

2022 Turbo Tax screenshots:

Screenshot 2024-07-23 at 11 38 10 AM

.

Screenshot 2024-07-23 at 11 46 40 AM

.

And finally, federal Form 6251:

Screenshot 2024-07-23 at 11 52 24 AM Screenshot 2024-07-23 at 11 52 45 AM Screenshot 2024-07-23 at 11 53 23 AM Screenshot 2024-07-23 at 11 54 18 AM
@martinholmer martinholmer added bug Something isn't working tax Federal and state tax policy labels Jul 23, 2024
@MaxGhenis
Copy link
Contributor

Does this relate to PSLmodels/Tax-Calculator#2785?

@martinholmer
Copy link
Collaborator Author

@MaxGhenis asked in PR #4775:

Does this relate to PSLmodels/Tax-Calculator#2785?

No.

@PavelMakarchuk
Copy link
Collaborator

Thank you @martinholmer for filing -

The issue here is that we do not consider capital gains taxes when computing the final AMT amount in Part II Line 10 - will fix now

@martinholmer
Copy link
Collaborator Author

@PavelMakarchuk said in issue #4775:

The issue here is that we do not consider capital gains taxes when computing the final AMT amount in Part II Line 10 - will fix now.

Good that you've identified the problem in the code.

@MaxGhenis
Copy link
Contributor

This reform simulates repealing AMT by raising the exemption to $1T: https://policyengine.org/us/policy?focus=policyOutput.policyBreakdown&reform=62899&region=enhanced_us&timePeriod=2024&baseline=2

Before merging #4815, this produced a $153 billion cost in 2024; now it's $0.8 billion.

Do we now need to adjust other parameters to simulate AMT repeal? We could also try neutralizing from a notebook.

Other reforms still work correctly, e.g. TRAFWA.

@PavelMakarchuk
Copy link
Collaborator

I wonder if the previous effect was correct - the easiest way it to set the rate to 0 (both brackets). This would produce an impact of $1.4 billion - which is what we get if we repeal the AMT as a structural reform

@MaxGhenis
Copy link
Contributor

TPC projects that AMT raises $6.3 billion in 2023

I would expect our projection to be lower as we haven't fully incorporated important deductions like the property tax component of SALT and charitable deductions. So $1.4 billion seems OK.

Do you know why an infinite exemption differs from zeroing out the rates though?

@PavelMakarchuk
Copy link
Collaborator

TPC projects that AMT raises $6.3 billion in 2023

I would expect our projection to be lower as we haven't fully incorporated important deductions like the property tax component of SALT and charitable deductions. So $1.4 billion seems OK.

Do you know why an infinite exemption differs from zeroing out the rates though?

There is a cap on the exemption amounts for filers who are below 18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tax Federal and state tax policy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants