Skip to content

Commit

Permalink
Merge pull request #2675 from jdebacker/ui_eitc_fix
Browse files Browse the repository at this point in the history
Fix to exemption of UI from AGI for EITC in certain years
  • Loading branch information
jdebacker authored Mar 13, 2023
2 parents 252ec1c + 6b2c8e9 commit 4c85758
Show file tree
Hide file tree
Showing 8 changed files with 408 additions and 265 deletions.
1 change: 0 additions & 1 deletion taxcalc.egg-info/entry_points.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
[console_scripts]
tc = taxcalc.cli.tc:cli_tc_main

42 changes: 24 additions & 18 deletions taxcalc/calcfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ def UBI(nu18, n1820, n21, UBI_u18, UBI_1820, UBI_21, UBI_ecrt,
@iterate_jit(nopython=True)
def AGI(ymod1, c02500, c02900, XTOT, MARS, sep, DSI, exact, nu18, taxable_ubi,
II_em, II_em_ps, II_prt, II_no_em_nu18,
c00100, pre_c04600, c04600):
e02300, UI_thd, UI_em, c00100, pre_c04600, c04600):
"""
Computes Adjusted Gross Income (AGI), c00100, and
compute personal exemption amount, c04600.
Expand Down Expand Up @@ -694,12 +694,19 @@ def AGI(ymod1, c02500, c02900, XTOT, MARS, sep, DSI, exact, nu18, taxable_ubi,
Personal exemption phaseout rate
II_no_em_nu18: float
Repeal personal exemptions for dependents under age 18
e02300: float
Unemployment compensation
UI_thd: list
AGI threshold for unemployment compensation exclusion
UI_em: float
Amount of unemployment compensation excluded from AGI
c00100: float
Adjusted Gross Income (AGI)
pre_c04600: float
Personal exemption before phase-out
c04600: float
Personal exemptions after phase-out
Returns
-------
c00100: float
Expand All @@ -711,6 +718,12 @@ def AGI(ymod1, c02500, c02900, XTOT, MARS, sep, DSI, exact, nu18, taxable_ubi,
"""
# calculate AGI assuming no foreign earned income exclusion
c00100 = ymod1 + c02500 - c02900 + taxable_ubi
# calculate UI exclusion (e.g., from 2020 AGI due to ARPA)
if (c00100 - e02300) <= UI_thd[MARS - 1]:
ui_excluded = min(e02300, UI_em)
else:
ui_excluded = 0.
c00100 -= ui_excluded
# calculate personal exemption amount
if II_no_em_nu18: # repeal of personal exemptions for deps. under 18
pre_c04600 = max(0, XTOT - nu18) * II_em
Expand Down Expand Up @@ -1173,12 +1186,11 @@ def StdDed(DSI, earned, STD, age_head, age_spouse, STD_Aged, STD_Dep,

@iterate_jit(nopython=True)
def TaxInc(c00100, standard, c04470, c04600, MARS, e00900, e26270,
e02100, e27200, e00650, c01000, e02300, PT_SSTB_income,
e02100, e27200, e00650, c01000, PT_SSTB_income,
PT_binc_w2_wages, PT_ubia_property, PT_qbid_rt,
PT_qbid_taxinc_thd, PT_qbid_taxinc_gap, PT_qbid_w2_wages_rt,
PT_qbid_alt_w2_wages_rt, PT_qbid_alt_property_rt, c04800,
PT_qbid_ps, PT_qbid_prt, qbided, PT_qbid_limit_switch,
UI_em, UI_thd):
PT_qbid_ps, PT_qbid_prt, qbided, PT_qbid_limit_switch):
"""
Calculates taxable income, c04800, and
qualified business income deduction, qbided.
Expand Down Expand Up @@ -1244,14 +1256,8 @@ def TaxInc(c00100, standard, c04470, c04600, MARS, e00900, e26270,
qbided: float
Qualified Business Income (QBI) deduction
"""
# calculate UI excluded from taxable income
if (c00100 - e02300) <= UI_thd[MARS - 1]:
ui_excluded = min(e02300, UI_em)
else:
ui_excluded = 0.
# calculate taxable income before qualified business income deduction
pre_qbid_taxinc = max(0., c00100 - max(c04470, standard) - c04600 -
ui_excluded)
pre_qbid_taxinc = max(0., c00100 - max(c04470, standard) - c04600)
# calculate qualified business income deduction
qbided = 0.
qbinc = max(0., e00900 + e26270 + e02100 + e27200)
Expand Down Expand Up @@ -2190,26 +2196,27 @@ def EITCamount(basic_frac, phasein_rate, earnings, max_amount,
Parameters
----------
basic_frac: list
basic_frac: float
Fraction of maximum earned income credit paid at zero earnings
phasein_rate: list
phasein_rate: float
Earned income credit phasein rate
earnings: float
Earned income for filing unit
max_amount: list
max_amount: float
Maximum earned income credit
phaseout_start: list
phaseout_start: float
Earned income credit phaseout start AGI
agi: float
Adjusted Gross Income (AGI)
phaseout_rate: list
phaseout_rate: float
Earned income credit phaseout rate
Returns
-------
eitc: float
Earned Income Credit
"""
# calculate qualified business income de
eitc = min((basic_frac * max_amount +
(1.0 - basic_frac) * phasein_rate * earnings), max_amount)
if earnings > phaseout_start or agi > phaseout_start:
Expand All @@ -2225,8 +2232,7 @@ def EITC(MARS, DSI, EIC, c00100, e00300, e00400, e00600, c01000,
EITC_ps, EITC_MinEligAge, EITC_MaxEligAge, EITC_ps_MarriedJ,
EITC_rt, EITC_c, EITC_prt, EITC_basic_frac,
EITC_InvestIncome_c, EITC_excess_InvestIncome_rt,
EITC_indiv, EITC_sep_filers_elig,
c59660):
EITC_indiv, EITC_sep_filers_elig, c59660):
"""
Computes EITC amount, c59660.
Expand Down
14 changes: 7 additions & 7 deletions taxcalc/tests/cpscsv_agg_expect.csv
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026
Returns (#m),187.1,199.2,201.9,204.5,207.1,209.7,212.3,214.9,217.5,220.1
AGI ($b),9087.6,10714.9,11166.8,11529.5,12789.5,13581.6,14198.2,14689.5,15207.5,15767.2
AGI ($b),9087.6,10714.9,11166.8,11508.0,12789.5,13581.6,14198.2,14689.5,15207.5,15767.2
Itemizers (#m),62.8,23.9,25.1,27.1,31.4,30.6,29.6,30.4,31.6,80.9
Itemized Deduction ($b),1218.6,613.4,656.3,734.5,861.5,860.9,862.0,911.0,968.0,2109.8
Itemized Deduction ($b),1218.6,613.4,656.3,734.6,861.5,860.9,862.0,911.0,968.0,2109.8
Standard Deduction Filers (#m),124.3,175.3,176.8,177.4,175.7,179.1,182.7,184.5,186.0,139.2
Standard Deduction ($b),1092.1,2949.5,3024.7,3087.5,3079.7,3243.3,3507.4,3642.2,3748.8,1560.6
Standard Deduction ($b),1092.1,2949.5,3024.7,3087.4,3079.7,3243.3,3507.4,3642.2,3748.8,1560.6
Personal Exemption ($b),1383.6,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2014.1
Taxable Income ($b),6230.6,7958.0,8321.2,8559.0,9684.9,10375.4,10802.9,11156.5,11548.8,11252.7
Regular Tax ($b),1108.0,1379.8,1448.7,1491.3,1700.8,1843.2,1911.4,1975.5,2049.4,2232.3
AMT Income ($b),8319.8,10262.1,10680.1,10982.3,12145.1,12934.9,13548.0,13998.9,14470.6,14429.0
AMT Income ($b),8319.8,10262.1,10680.1,10960.7,12145.1,12934.9,13548.0,13998.9,14470.6,14429.0
AMT Liability ($b),8.1,0.8,0.7,0.6,1.1,1.1,1.1,1.0,1.0,16.5
AMT Filers (#m),2.6,0.2,0.2,0.1,0.2,0.2,0.2,0.2,0.2,4.0
Tax before Credits ($b),1116.0,1380.6,1449.4,1491.9,1701.9,1844.3,1912.5,1976.5,2050.4,2248.8
Refundable Credits ($b),70.8,102.4,102.7,655.2,821.5,97.5,103.6,106.0,107.9,94.0
Refundable Credits ($b),70.8,102.4,102.7,655.6,821.5,97.5,103.6,106.0,107.9,94.0
Nonrefundable Credits ($b),32.7,97.2,99.1,99.3,2.2,108.2,108.8,109.9,111.3,31.0
Reform Surtaxes ($b),0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
Other Taxes ($b),5.5,10.7,11.3,11.4,11.7,12.6,14.0,15.2,16.3,17.3
Ind Income Tax ($b),1018.1,1191.7,1258.9,748.8,890.0,1651.2,1714.1,1775.8,1847.5,2141.1
Ind Income Tax ($b),1018.1,1191.7,1258.9,748.3,890.0,1651.2,1714.1,1775.8,1847.5,2141.1
Payroll Taxes ($b),1040.8,1141.6,1194.9,1217.1,1325.3,1430.9,1502.4,1556.3,1609.9,1669.5
Combined Liability ($b),2059.0,2333.2,2453.8,1965.9,2215.3,3082.2,3216.5,3332.1,3457.4,3810.6
Combined Liability ($b),2059.0,2333.2,2453.8,1965.4,2215.3,3082.2,3216.5,3332.1,3457.4,3810.6
With Income Tax <= 0 (#m),88.1,96.2,97.0,135.3,127.8,96.0,97.8,98.8,99.8,97.9
With Combined Tax <= 0 (#m),62.8,65.4,66.4,98.3,97.8,67.9,69.3,70.3,71.4,70.9
UBI Benefits ($b),0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
Expand Down
12 changes: 6 additions & 6 deletions taxcalc/tests/puf_var_wght_means_by_year.csv
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
,description,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031
c00100,Federal AGI, 50840, 54457, 54942, 55071, 58024, 60320, 61591, 62889, 69393, 72742, 74619, 75622, 76915, 78447, 80285, 82388, 84624, 87009, 89526
c00100,Federal AGI, 50840, 54457, 54942, 55071, 58024, 60320, 61591, 62779, 69393, 72742, 74619, 75622, 76915, 78447, 80285, 82388, 84624, 87009, 89526
c02500,OASDI benefits in AGI, 1295, 1394, 1416, 1479, 1501, 1587, 1688, 1813, 1993, 2112, 2306, 2474, 2636, 2808, 2986, 3183, 3387, 3601, 3825
c04470,Post-phase-out itemized deduction, 5907, 6036, 6149, 6382, 6562, 6800, 7007, 7407, 7876, 7901, 8128, 8427, 8717, 9015, 9305, 9615, 9919, 10248, 10581
c04470,Post-phase-out itemized deduction, 5907, 6036, 6149, 6382, 6562, 6800, 7007, 7408, 7876, 7901, 8128, 8427, 8717, 9015, 9305, 9615, 9919, 10248, 10581
c04600,Post-phase-out personal exemption, 7105, 7131, 7163, 7217, 7149, 7261, 7410, 7518, 7557, 7882, 8352, 8594, 8778, 8956, 9138, 9324, 9523, 9725, 9932
c04800,Federal regular taxable income, 35754, 39297, 39664, 39592, 42568, 44509, 45382, 46164, 52111, 55146, 56169, 56525, 57281, 58262, 59558, 61095, 62764, 64548, 66444
c04800,Federal regular taxable income, 35754, 39297, 39664, 39592, 42568, 44509, 45382, 46163, 52111, 55146, 56169, 56525, 57281, 58262, 59558, 61095, 62764, 64548, 66444
c05200,Regular tax on taxable income, 7672, 8732, 8725, 8585, 9500, 9994, 10122, 10382, 11944, 12734, 12813, 12748, 12837, 12987, 13229, 13545, 13898, 14277, 14669
c07180,Child care credit, 17, 17, 17, 17, 17, 17, 17, 17, 0, 17, 17, 17, 17, 17, 16, 16, 16, 16, 16
c07220,Child tax credit (adjusted), 158, 155, 147, 143, 139, 133, 129, 123, 360, 116, 109, 104, 101, 97, 94, 91, 88, 85, 82
c07220,Child tax credit (adjusted), 158, 155, 147, 143, 139, 133, 129, 124, 360, 116, 109, 104, 101, 97, 94, 91, 88, 85, 82
c09600,Federal AMT liability, 212, 227, 240, 251, 268, 280, 287, 310, 336, 331, 338, 350, 362, 375, 387, 401, 414, 428, 439
c11070,Extra child tax credit (refunded), 150, 144, 138, 133, 126, 123, 120, 121, 0, 108, 109, 109, 108, 106, 104, 102, 101, 100, 98
c21040,Itemized deduction that is phased out, 203, 242, 231, 219, 255, 270, 271, 282, 332, 352, 349, 343, 343, 343, 347, 354, 361, 369, 375
Expand Down Expand Up @@ -64,10 +64,10 @@ e58990,Investment income elected amount from Form 4952, 14, 14, 1
e62900,Alternative Minimum Tax foreign tax credit from Form 6251, 78, 86, 84, 84, 90, 93, 95, 99, 105, 106, 110, 113, 116, 119, 122, 125, 128, 132, 134
e87521,Total tentative AmOppCredit amount for all students, 172, 176, 182, 184, 191, 197, 201, 211, 223, 224, 232, 239, 246, 253, 260, 268, 275, 284, 294
e87530,Adjusted qualified lifetime learning expenses for all students, 93, 92, 94, 96, 99, 102, 105, 110, 116, 117, 121, 125, 129, 132, 136, 140, 144, 148, 152
eitc,Federal EITC, 376, 369, 364, 352, 342, 341, 344, 350, 328, 339, 364, 374, 380, 385, 390, 394, 399, 405, 411
eitc,Federal EITC, 376, 369, 364, 352, 342, 341, 344, 351, 328, 339, 364, 374, 380, 385, 390, 394, 399, 405, 411
elderly_dependents,number of dependents age 65+ in filing unit excluding taxpayer and spouse, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
g20500,Itemizable gross (before 10% AGI disregard) casualty or theft loss, 29, 30, 31, 32, 33, 35, 36, 38, 40, 40, 42, 43, 45, 47, 48, 51, 53, 55, 58
iitax,Federal income tax liability, 6550, 7474, 7521, 7477, 8281, 8746, 8933, 6452, 8236, 11302, 11401, 11418, 11561, 11753, 12020, 12349, 12706, 13083, 13470
iitax,Federal income tax liability, 6550, 7474, 7521, 7477, 8281, 8746, 8933, 6450, 8236, 11302, 11401, 11418, 11561, 11753, 12020, 12349, 12706, 13083, 13470
k1bx14p,Partner self-employment earnings/loss for taxpayer (included in e26270 total), -213, -239, -187, -162, -144, -139, -133, -128, -158, -170, -171, -167, -161, -156, -148, -139, -128, -110, -92
k1bx14s,Partner self-employment earnings/loss for spouse (included in e26270 total), -7, -9, 0, 2, 8, 10, 11, 11, 14, 14, 13, 13, 13, 14, 16, 18, 22, 24, 28
nu06,Number of dependents under 6 years old, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Expand Down
52 changes: 26 additions & 26 deletions taxcalc/tests/pufcsv_agg_expect.csv
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026
Returns (#m),190.9,194.3,197.3,200.1,202.9,205.6,208.4,211.2,214,216.8
AGI ($b),11078.7,11816.9,12247.1,12673.1,14196.4,15082.8,15676.3,16093.1,16584.5,17003.7
Itemizers (#m),45.7,19.5,20.1,20.8,23.1,22.5,21.3,21.6,22,51.9
Itemized Deduction ($b),1274.1,605.2,636.3,686,767.2,768.9,762.7,794.2,832.4,1986.9
Standard Deduction Filers (#m),145.2,174.7,177.1,179.2,179.8,183.1,187,189.6,191.9,164.8
Standard Deduction ($b),1239.3,2862.1,2951.5,3040.2,3076.8,3239.2,3509,3659.4,3784.5,1794.6
Personal Exemption ($b),1365,0,0,0,0,0,0,0,0,1897
Taxable Income ($b),8112.4,9179,9519.8,9846.2,11244.1,12043.6,12452.8,12728.9,13094.9,12659.1
Regular Tax ($b),1656.8,1712.3,1778.1,1849.3,2132.1,2310.9,2370.8,2413.5,2480.6,2627
AMT Income ($b),10512.6,11427.7,11835.2,12223.8,13691.7,14573.3,15167.1,15558.7,16020.7,16113.9
AMT Liability ($b),51.3,23.2,24.1,24.8,28.1,28.4,29.5,30.7,32.1,82.8
AMT Filers (#m),5.7,0.6,0.6,0.3,0.7,0.7,0.6,0.6,0.6,7.3
Tax before Credits ($b),1708.1,1735.5,1802.2,1874.1,2160.2,2339.3,2400.3,2444.3,2512.7,2709.9
Refundable Credits ($b),102.9,117.4,118.5,642.1,784.4,118.5,125.2,128.4,131.7,118.2
Nonrefundable Credits ($b),67,127.3,129.2,128.3,49.6,141.5,142,142.5,143.6,75
Reform Surtaxes ($b),0,0,0,0,0,0,0,0,0,0
Other Taxes ($b),40,44.8,43.6,52.2,59.5,63.1,63.2,60.8,60.1,58.3
Ind Income Tax ($b),1578.3,1535.6,1598.1,1155.9,1385.7,2142.4,2196.3,2234.2,2297.5,2574.9
Payroll Taxes ($b),1083.8,1133.3,1185.4,1207.5,1311.3,1413.2,1486.3,1539.9,1592.9,1651.4
Combined Liability ($b),2662,2668.9,2783.5,2363.4,2697,3555.5,3682.6,3774.1,3890.5,4226.2
With Income Tax <= 0 (#m),92.8,98.6,99.7,131.7,124.8,100.1,101.9,103.3,104.5,101.5
With Combined Tax <= 0 (#m),63.4,65.6,66.8,102.2,94.3,68.8,70.3,71.5,72.7,72.6
UBI Benefits ($b),0,0,0,0,0,0,0,0,0,0
"Total Benefits, Consumption Value ($b)",1052.3,1104.9,1174.1,1244.8,1494,1411.5,1514.7,1618.4,1720.1,1826.4
Total Benefits Cost ($b),1052.3,1104.9,1174.1,1244.8,1494,1411.5,1514.7,1618.4,1720.1,1826.4
,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026
Returns (#m),190.9,194.3,197.3,200.1,202.9,205.6,208.4,211.2,214.0,216.8
AGI ($b),11078.7,11816.9,12247.1,12651.1,14196.4,15082.8,15676.3,16093.1,16584.5,17003.7
Itemizers (#m),45.7,19.5,20.1,20.8,23.1,22.5,21.3,21.6,22.0,51.9
Itemized Deduction ($b),1274.1,605.2,636.3,686.1,767.2,768.9,762.7,794.2,832.4,1986.9
Standard Deduction Filers (#m),145.2,174.7,177.1,179.2,179.8,183.1,187.0,189.6,191.9,164.8
Standard Deduction ($b),1239.3,2862.1,2951.5,3040.1,3076.8,3239.2,3509.0,3659.4,3784.5,1794.6
Personal Exemption ($b),1365.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1897.0
Taxable Income ($b),8112.4,9179.0,9519.8,9846.2,11244.1,12043.6,12452.8,12728.9,13094.9,12659.1
Regular Tax ($b),1656.8,1712.3,1778.1,1849.3,2132.1,2310.9,2370.8,2413.5,2480.6,2627.0
AMT Income ($b),10512.6,11427.7,11835.2,12201.8,13691.7,14573.3,15167.1,15558.7,16020.7,16113.9
AMT Liability ($b),51.3,23.2,24.1,24.8,28.1,28.4,29.5,30.7,32.1,82.8
AMT Filers (#m),5.7,0.6,0.6,0.3,0.7,0.7,0.6,0.6,0.6,7.3
Tax before Credits ($b),1708.1,1735.5,1802.2,1874.1,2160.2,2339.3,2400.3,2444.3,2512.7,2709.9
Refundable Credits ($b),102.9,117.4,118.5,642.4,784.4,118.5,125.2,128.4,131.7,118.2
Nonrefundable Credits ($b),67.0,127.3,129.2,128.3,49.6,141.5,142.0,142.5,143.6,75.0
Reform Surtaxes ($b),0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
Other Taxes ($b),40.0,44.8,43.6,52.2,59.5,63.1,63.2,60.8,60.1,58.3
Ind Income Tax ($b),1578.3,1535.6,1598.1,1155.7,1385.7,2142.4,2196.3,2234.2,2297.5,2574.9
Payroll Taxes ($b),1083.8,1133.3,1185.4,1207.5,1311.3,1413.2,1486.3,1539.9,1592.9,1651.4
Combined Liability ($b),2662.0,2668.9,2783.5,2363.1,2697.0,3555.5,3682.6,3774.1,3890.5,4226.2
With Income Tax <= 0 (#m),92.8,98.6,99.7,131.7,124.8,100.1,101.9,103.3,104.5,101.5
With Combined Tax <= 0 (#m),63.4,65.6,66.8,102.2,94.3,68.8,70.3,71.5,72.7,72.6
UBI Benefits ($b),0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
"Total Benefits, Consumption Value ($b)",1052.3,1104.9,1174.1,1244.8,1494.0,1411.5,1514.7,1618.4,1720.1,1826.4
Total Benefits Cost ($b),1052.3,1104.9,1174.1,1244.8,1494.0,1411.5,1514.7,1618.4,1720.1,1826.4
4 changes: 2 additions & 2 deletions taxcalc/tests/reforms_expect.csv
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ rid,res1,res2,res3,res4
57,-14.1,-15.6,-15.9,-14.3
58,-15.5,-17.1,-17.5,-15.7
59,-66.1,-66.2,-66.2,-66.4
60,-67.3,-67.2,-67.3,-67.4
60,-67.3,-67.2,-67.3,-67.3
61,-1.0,-0.5,-0.7,-1.2
62,-17.3,-17.9,-24.1,-19.4
63,-12.7,-13.0,-23.3,-13.9
63,-12.7,-12.9,-23.3,-13.9
64,-46.9,-48.0,-49.0,-51.6
Loading

0 comments on commit 4c85758

Please sign in to comment.