From a5a54de2acdf9e927370b4e3c1c24b9fb70d6168 Mon Sep 17 00:00:00 2001 From: "martin.holmer@gmail.com" Date: Sat, 27 Jul 2024 12:42:14 -0400 Subject: [PATCH 1/3] Correct AMT taxable income calculation to handle QBID correctly. --- taxcalc/calcfunctions.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/taxcalc/calcfunctions.py b/taxcalc/calcfunctions.py index c4764c470..b96421498 100644 --- a/taxcalc/calcfunctions.py +++ b/taxcalc/calcfunctions.py @@ -1906,7 +1906,7 @@ def AGIsurtax(c00100, MARS, AGI_surtax_trt, AGI_surtax_thd, taxbc, surtax): def AMT(e07300, dwks13, standard, f6251, c00100, c18300, taxbc, c04470, c17000, c20800, c21040, e24515, MARS, sep, dwks19, dwks14, c05700, e62900, e00700, dwks10, age_head, age_spouse, - earned, cmbtp, + earned, cmbtp, qbided, AMT_child_em_c_age, AMT_brk1, AMT_em, AMT_prt, AMT_rt1, AMT_rt2, AMT_child_em, AMT_em_ps, AMT_em_pe, @@ -1943,7 +1943,7 @@ def AMT(e07300, dwks13, standard, f6251, c00100, c18300, taxbc, c20800: float Schedule A: net limited miscellaneous deductions deducted c21040: float - Itemized deductiosn that are phased out + Itemized deductions that are phased out e24515: float Schedule D: Un-Recaptured Section 1250 Gain MARS: int @@ -1970,6 +1970,8 @@ def AMT(e07300, dwks13, standard, f6251, c00100, c18300, taxbc, Earned income for filing unit cmbtp: float Estimate of income on (AMT) Form 6251 but not in AGI + qbided: float + Qualified business income deduction AMT_child_em_c_age: float Age ceiling for special AMT exemption AMT_brk1: float @@ -2021,11 +2023,11 @@ def AMT(e07300, dwks13, standard, f6251, c00100, c18300, taxbc, # pylint: disable=too-many-statements,too-many-branches # Form 6251, Part I if standard == 0.0: - c62100 = (c00100 - e00700 - c04470 + + c62100 = (c00100 - e00700 - qbided - c04470 + max(0., min(c17000, 0.025 * c00100)) + c18300 + c20800 - c21040) if standard > 0.0: - c62100 = c00100 - e00700 + c62100 = c00100 - e00700 - qbided c62100 += cmbtp # add income not in AGI but considered income for AMT if MARS == 3: amtsepadd = max(0., From beefe6a856462882c4ae34f03409244d3bf5ff6d Mon Sep 17 00:00:00 2001 From: "martin.holmer@gmail.com" Date: Sat, 27 Jul 2024 14:16:21 -0400 Subject: [PATCH 2/3] Update expected test results given fix to AMT calculations --- taxcalc/tests/cpscsv_agg_expect.csv | 24 ++++++++++++------------ taxcalc/tests/pufcsv_agg_expect.csv | 24 ++++++++++++------------ taxcalc/tests/test_reforms.py | 2 +- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/taxcalc/tests/cpscsv_agg_expect.csv b/taxcalc/tests/cpscsv_agg_expect.csv index dd89c380c..5dcecef64 100644 --- a/taxcalc/tests/cpscsv_agg_expect.csv +++ b/taxcalc/tests/cpscsv_agg_expect.csv @@ -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.8,11167.0,11573.2,13174.9,13543.8,14390.3,15077.5,15785.3,16457.7 -Itemizers (#m),62.8,24.0,25.1,27.5,31.2,31.2,29.8,29.4,30.4,81.1 -Itemized Deduction ($b),1218.6,613.4,656.3,746.7,863.7,883.2,888.9,915.0,964.2,2180.7 -Standard Deduction Filers (#m),124.3,175.3,176.8,176.8,175.7,178.4,182.4,185.4,187.1,139.1 -Standard Deduction ($b),1092.1,2949.5,3024.6,3079.1,3090.6,3229.8,3547.8,3805.0,3936.4,1613.3 +Itemizers (#m),62.8,23.9,25.0,27.5,31.2,31.2,29.8,29.4,30.4,81.1 +Itemized Deduction ($b),1218.6,612.0,655.1,745.4,862.7,881.9,887.6,913.8,963.1,2180.7 +Standard Deduction Filers (#m),124.3,175.3,176.9,176.9,175.8,178.5,182.5,185.5,187.2,139.1 +Standard Deduction ($b),1092.1,2951.3,3026.1,3080.8,3091.9,3231.4,3549.4,3806.5,3937.8,1613.3 Personal Exemption ($b),1383.6,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2081.6 -Taxable Income ($b),6230.6,7957.8,8321.4,8613.9,10048.2,10330.4,10946.5,11424.4,11988.0,11782.5 -Regular Tax ($b),1108.0,1379.8,1448.8,1497.1,1762.5,1837.0,1937.1,2016.1,2122.9,2339.6 -AMT Income ($b),8319.8,10261.9,10680.3,11016.8,12528.9,12879.7,13716.5,14379.0,15047.4,15074.1 -AMT Liability ($b),8.1,0.8,0.7,0.9,1.9,1.1,1.1,1.0,1.0,17.2 -AMT Filers (#m),2.6,0.2,0.2,0.2,0.3,0.2,0.2,0.2,0.2,4.1 -Tax before Credits ($b),1116.0,1380.6,1449.5,1498.0,1764.4,1838.1,1938.2,2017.1,2123.8,2356.8 +Taxable Income ($b),6230.6,7957.5,8321.1,8613.6,10047.9,10330.1,10946.2,11424.1,11987.7,11782.5 +Regular Tax ($b),1108.0,1379.7,1448.7,1497.0,1762.5,1837.0,1937.0,2016.0,2122.8,2339.6 +AMT Income ($b),8319.8,10210.9,10628.5,10963.9,12471.9,12819.7,13656.7,14316.6,14982.4,15074.1 +AMT Liability ($b),8.1,0.4,0.4,0.5,1.4,0.7,0.7,0.6,0.6,17.2 +AMT Filers (#m),2.6,0.1,0.1,0.1,0.2,0.1,0.1,0.1,0.1,4.1 +Tax before Credits ($b),1116.0,1380.1,1449.1,1497.6,1763.9,1837.6,1937.7,2016.6,2123.4,2356.8 Refundable Credits ($b),70.8,102.5,102.7,655.0,827.1,98.5,106.4,111.6,112.1,97.7 Nonrefundable Credits ($b),32.7,97.2,99.1,99.2,0.0,107.7,108.3,109.3,111.2,29.9 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,12.6,13.9,14.4,16.5,17.6,18.8,19.9 -Ind Income Tax ($b),1018.1,1191.5,1259.0,756.4,951.1,1646.2,1740.0,1813.7,1919.2,2249.0 +Ind Income Tax ($b),1018.1,1191.1,1258.5,755.9,950.6,1645.8,1739.6,1813.3,1918.8,2249.0 Payroll Taxes ($b),1040.8,1141.6,1194.9,1217.9,1318.7,1421.6,1506.7,1582.0,1656.7,1730.7 -Combined Liability ($b),2059.0,2333.1,2453.9,1974.3,2269.8,3067.8,3246.7,3395.7,3575.9,3979.7 +Combined Liability ($b),2059.0,2332.7,2453.4,1973.9,2269.3,3067.4,3246.2,3395.3,3575.5,3979.7 With Income Tax <= 0 (#m),88.1,96.2,97.0,135.4,127.8,96.1,97.9,99.2,99.6,97.4 With Combined Tax <= 0 (#m),62.8,65.4,66.4,98.2,97.7,67.9,69.3,70.5,71.3,70.7 UBI Benefits ($b),0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 diff --git a/taxcalc/tests/pufcsv_agg_expect.csv b/taxcalc/tests/pufcsv_agg_expect.csv index 1ca531e85..6b0ff737c 100644 --- a/taxcalc/tests/pufcsv_agg_expect.csv +++ b/taxcalc/tests/pufcsv_agg_expect.csv @@ -1,24 +1,24 @@ ,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.6,12247.2,12722.3,14930.0,14973.9,15955.0,16597.5,17310.2,17852.5 -Itemizers (#m),45.7,19.5,20.1,21.1,22.7,22.9,21.7,21.2,21.3,51.9 -Itemized Deduction ($b),1274.3,605.3,636.4,694.6,764.2,784.9,789.0,808.3,834.6,2047.9 -Standard Deduction Filers (#m),145.2,174.7,177.1,178.4,179.5,182.7,186.7,189.9,192.6,164.8 -Standard Deduction ($b),1239.3,2862.1,2951.5,3023.0,3078.3,3231.2,3546.7,3807.7,3963.4,1856.2 +Itemizers (#m),45.7,19.4,20.0,21.0,22.6,22.8,21.6,21.1,21.2,51.9 +Itemized Deduction ($b),1274.3,602.7,633.9,692.3,761.9,782.7,786.5,805.6,831.9,2047.9 +Standard Deduction Filers (#m),145.2,174.8,177.2,178.5,179.6,182.8,186.8,190.0,192.8,164.8 +Standard Deduction ($b),1239.3,2865.3,2954.5,3025.8,3081.1,3234.0,3549.8,3811.2,3966.7,1856.2 Personal Exemption ($b),1365.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1959.2 -Taxable Income ($b),8112.2,9178.5,9519.7,9906.4,12002.2,11926.7,12691.5,13123.9,13696.5,13377.8 -Regular Tax ($b),1656.8,1712.2,1778.1,1838.2,2281.4,2282.6,2421.6,2488.0,2599.1,2792.6 -AMT Income ($b),10512.4,11427.2,11835.2,12265.2,14423.4,14452.5,15424.7,16049.3,16741.5,16934.0 -AMT Liability ($b),51.3,23.2,24.1,26.2,29.0,28.6,30.0,31.5,33.0,85.1 -AMT Filers (#m),5.7,0.6,0.6,0.6,0.7,0.6,0.6,0.6,0.6,7.4 -Tax before Credits ($b),1708.1,1735.4,1802.2,1864.4,2310.4,2311.2,2451.6,2519.4,2632.1,2877.6 +Taxable Income ($b),8112.2,9177.8,9519.0,9905.8,12001.6,11926.1,12690.7,13123.1,13695.7,13377.8 +Regular Tax ($b),1656.8,1712.0,1777.9,1838.0,2281.2,2282.4,2421.4,2487.7,2598.8,2792.6 +AMT Income ($b),10512.4,11342.1,11748.2,12178.7,14329.2,14354.5,15322.6,15942.9,16631.0,16934.0 +AMT Liability ($b),51.3,22.1,23.0,25.1,27.8,27.4,28.8,30.3,31.8,85.1 +AMT Filers (#m),5.7,0.2,0.2,0.3,0.4,0.3,0.3,0.3,0.3,7.4 +Tax before Credits ($b),1708.1,1734.1,1800.9,1863.1,2309.1,2309.8,2450.2,2518.0,2630.7,2877.6 Refundable Credits ($b),102.9,117.5,118.5,642.0,802.6,119.2,127.1,133.0,135.2,121.9 Nonrefundable Credits ($b),67.0,127.3,129.2,128.5,47.6,140.8,143.3,144.0,145.9,78.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.9,84.9,61.5,66.5,65.2,66.0,64.2 -Ind Income Tax ($b),1578.2,1535.4,1598.1,1146.8,1545.0,2112.7,2247.8,2307.6,2417.0,2742.0 +Ind Income Tax ($b),1578.2,1534.1,1596.8,1145.5,1543.7,2111.3,2246.4,2306.2,2415.6,2742.0 Payroll Taxes ($b),1083.8,1133.3,1185.4,1209.0,1306.0,1403.4,1489.3,1563.9,1637.9,1711.0 -Combined Liability ($b),2662.0,2668.7,2783.5,2355.8,2851.0,3516.1,3737.1,3871.6,4054.9,4452.9 +Combined Liability ($b),2662.0,2667.4,2782.2,2354.5,2849.7,3514.7,3735.6,3870.2,4053.5,4452.9 With Income Tax <= 0 (#m),92.8,98.6,99.7,131.7,125.0,100.3,101.9,103.4,104.4,101.0 With Combined Tax <= 0 (#m),63.4,65.6,66.8,102.1,94.5,68.9,70.2,71.6,72.6,72.4 UBI Benefits ($b),0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 diff --git a/taxcalc/tests/test_reforms.py b/taxcalc/tests/test_reforms.py index 6a5ff4cd2..b3fc1d1e7 100644 --- a/taxcalc/tests/test_reforms.py +++ b/taxcalc/tests/test_reforms.py @@ -382,4 +382,4 @@ def test_ext_reform(tests_path): iitax_ext = calc_ext.array('iitax') rdiff = iitax_ext - iitax_end weighted_sum_rdiff = (rdiff * calc_end.array('s006')).sum() * 1.0e-9 - assert np.allclose([weighted_sum_rdiff], [-224.46], rtol=0.0, atol=0.01) + assert np.allclose([weighted_sum_rdiff], [-224.91], rtol=0.0, atol=0.01) From 57b5e18974df61f1f1d90b22e40741ad98b271ca Mon Sep 17 00:00:00 2001 From: "martin.holmer@gmail.com" Date: Sat, 27 Jul 2024 15:06:08 -0400 Subject: [PATCH 3/3] Simplify QBID threshold gap parameter in policy_current_law.json --- taxcalc/policy_current_law.json | 125 -------------------------------- 1 file changed, 125 deletions(-) diff --git a/taxcalc/policy_current_law.json b/taxcalc/policy_current_law.json index 074bbd799..fef9f433f 100644 --- a/taxcalc/policy_current_law.json +++ b/taxcalc/policy_current_law.json @@ -14701,106 +14701,6 @@ "MARS": "widow", "value": 1.0 }, - { - "year": 2014, - "MARS": "single", - "value": 1.0 - }, - { - "year": 2014, - "MARS": "mjoint", - "value": 1.0 - }, - { - "year": 2014, - "MARS": "mseparate", - "value": 1.0 - }, - { - "year": 2014, - "MARS": "headhh", - "value": 1.0 - }, - { - "year": 2014, - "MARS": "widow", - "value": 1.0 - }, - { - "year": 2015, - "MARS": "single", - "value": 1.0 - }, - { - "year": 2015, - "MARS": "mjoint", - "value": 1.0 - }, - { - "year": 2015, - "MARS": "mseparate", - "value": 1.0 - }, - { - "year": 2015, - "MARS": "headhh", - "value": 1.0 - }, - { - "year": 2015, - "MARS": "widow", - "value": 1.0 - }, - { - "year": 2016, - "MARS": "single", - "value": 1.0 - }, - { - "year": 2016, - "MARS": "mjoint", - "value": 1.0 - }, - { - "year": 2016, - "MARS": "mseparate", - "value": 1.0 - }, - { - "year": 2016, - "MARS": "headhh", - "value": 1.0 - }, - { - "year": 2016, - "MARS": "widow", - "value": 1.0 - }, - { - "year": 2017, - "MARS": "single", - "value": 1.0 - }, - { - "year": 2017, - "MARS": "mjoint", - "value": 1.0 - }, - { - "year": 2017, - "MARS": "mseparate", - "value": 1.0 - }, - { - "year": 2017, - "MARS": "headhh", - "value": 1.0 - }, - { - "year": 2017, - "MARS": "widow", - "value": 1.0 - }, { "year": 2018, "MARS": "single", @@ -14826,31 +14726,6 @@ "MARS": "widow", "value": 100000.0 }, - { - "year": 2019, - "MARS": "single", - "value": 50000.0 - }, - { - "year": 2019, - "MARS": "mjoint", - "value": 100000.0 - }, - { - "year": 2019, - "MARS": "mseparate", - "value": 50000.0 - }, - { - "year": 2019, - "MARS": "headhh", - "value": 50000.0 - }, - { - "year": 2019, - "MARS": "widow", - "value": 100000.0 - }, { "year": 2026, "MARS": "single",