Skip to content

Commit

Permalink
Merge pull request #5553 from PolicyEngine/amt_refactor
Browse files Browse the repository at this point in the history
Refactor AMT code to use descriptive variable names rather than those tied to form lines
  • Loading branch information
PavelMakarchuk authored Feb 6, 2025
2 parents 5f44afb + 9ede0e4 commit bb5735d
Show file tree
Hide file tree
Showing 24 changed files with 593 additions and 305 deletions.
4 changes: 4 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- bump: minor
changes:
added:
- Refactor the Alternative Minimum Tax (AMT) logic.

This file was deleted.

21 changes: 21 additions & 0 deletions policyengine_us/parameters/gov/irs/income/amt/multiplier.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
description: The IRS multiplies the Alternative Minimum Tax income tax brackets by this rate, based on filing status.
metadata:
unit: /1
period: year
breakdown:
- filing_status
label: AMT tax bracket multiplier
reference:
- title: 26 U.S. Code § 55 - Alternative minimum tax imposed (b)(1)(C)
href: https://www.law.cornell.edu/uscode/text/26/55#b_1_C

SINGLE:
2013-01-01: 1
JOINT:
2013-01-01: 1
HEAD_OF_HOUSEHOLD:
2013-01-01: 1
SURVIVING_SPOUSE:
2013-01-01: 0.5
SEPARATE:
2013-01-01: 1
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ def formula(tax_unit, period, parameters):
line44 = dwks14

# Apply different thresholds for primary/secondary for capital gains
cg = p.capital_gains.brackets
cg = parameters(period).gov.irs.capital_gains.brackets
primary_line45 = max_(
0, cg.thresholds["1"][filing_status] - line44
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,50 @@
state_code: CA
output:
alternative_minimum_tax: 0

- name: Integration test - single filer with 5k of income
absolute_error_margin: 0.01
period: 2024
input:
people:
person1:
age: 40
employment_income: 2_000_000
spm_units:
spm_unit:
members: [person1]
tax_units:
tax_unit:
members: [person1]
households:
household:
members: [person1]
state_code: TX
output:
alternative_minimum_tax: 0

- name: AMT does not apply if regular tax is higher than AMT
period: 2022
input:
amt_base_tax: 10_000
amt_part_iii_required: false
amt_tax_including_cg: 2_000
foreign_tax_credit: 0
regular_tax_before_credits: 11_000
form_4972_lumpsum_distributions: 0
capital_gains_tax: 0
output:
alternative_minimum_tax: 0

- name: Part iii required, AMT higher than regular tax
period: 2022
input:
amt_base_tax: 15_000
amt_part_iii_required: true
amt_tax_including_cg: 12_000
foreign_tax_credit: 0
regular_tax_before_credits: 11_000
form_4972_lumpsum_distributions: 0
capital_gains_tax: 0
output:
alternative_minimum_tax: 1_000
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
- name: Not required
period: 2022
input:
dwks10: 0
dwks13: 0
dwks14: 0
dwks19: 0
unrecaptured_section_1250_gain: 0
output:
amt_part_iii_required: false

- name: Required
period: 2022
input:
dwks10: 0
dwks13: 0
dwks14: 1
dwks19: 0
unrecaptured_section_1250_gain: 0
output:
amt_part_iii_required: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
- name: First bracket, no capital gains
period: 2023
input:
filing_status: SINGLE
amt_income_less_exemptions: 50_000
dwks10: 0
dwks13: 0
dwks14: 0
unrecaptured_section_1250_gain: 0
output:
amt_tax_including_cg: 13_000

- name: First bracket, no capital gains, higher income
period: 2023
input:
filing_status: SINGLE
amt_income_less_exemptions: 100_000
dwks10: 0
dwks13: 0
dwks14: 0
unrecaptured_section_1250_gain: 0
output:
amt_tax_including_cg: 26_000

- name: Income with capital gains in first bracket
period: 2023
input:
filing_status: SINGLE
amt_income_less_exemptions: 100_000
dwks10: 50_000
dwks13: 30_000
dwks14: 0
unrecaptured_section_1250_gain: 0
output:
amt_tax_including_cg: 22_700

- name: AMT with capital gains in second bracket
period: 2023
input:
filing_status: SINGLE
amt_income_less_exemptions: 600_000
dwks10: 200_000
dwks13: 150_000
dwks14: 0
unrecaptured_section_1250_gain: 0
output:
amt_tax_including_cg: 144_086

- name: AMT with unrecaptured section 1250 gains
period: 2023
input:
filing_status: SINGLE
amt_income_less_exemptions: 1_000_000
dwks10: 500_000
dwks13: 300_000
dwks14: 0
unrecaptured_section_1250_gain: 200_000
output:
amt_tax_including_cg: 230_586
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
- name: Single person, low income
period: 2022
input:
filing_status: SINGLE
amt_income_less_exemptions: 10_000
output:
amt_base_tax: 2_600

- name: Single person, no income
period: 2022
input:
filing_status: SINGLE
amt_income_less_exemptions: 0
output:
amt_base_tax: 0

- name: Joint, high income
period: 2022
input:
filing_status: JOINT
amt_income_less_exemptions: 200_000
output:
amt_base_tax: 52_000
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
- name: Single person, low income
period: 2022
input:
filing_status: SINGLE
amt_income_less_exemptions: 10_000
output:
amt_higher_base_tax: 0

- name: Single person, 400k income
period: 2022
input:
filing_status: SINGLE
amt_income_less_exemptions: 400_000
output:
amt_higher_base_tax: 54_292

- name: Joint, 600k income
period: 2022
input:
filing_status: JOINT
amt_income_less_exemptions: 600_000
output:
amt_higher_base_tax: 110_292
Loading

0 comments on commit bb5735d

Please sign in to comment.