Skip to content

Commit

Permalink
Merge pull request #2348 from martinholmer/fix-qbid
Browse files Browse the repository at this point in the history
Add taxable-income cap to QBID logic
  • Loading branch information
martinholmer authored Jun 26, 2019
2 parents a141d93 + 75fc1bc commit 51ef36a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 29 deletions.
5 changes: 5 additions & 0 deletions taxcalc/calcfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,7 @@ 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,
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,
Expand Down Expand Up @@ -823,6 +824,10 @@ def TaxInc(c00100, standard, c04470, c04600, MARS, e00900, e26270,
prt = (pre_qbid_taxinc - lower_thd) / pre_qbid_taxinc_gap
adj = prt * (qbid_adjusted - cap_adjusted)
qbided = qbid_adjusted - adj
# apply taxinc cap (assuning cap rate is equal to PT_qbid_rt)
net_cg = e00650 + c01000 # per line 34 in 2018 Pub 535 Worksheet 12-A
taxinc_cap = PT_qbid_rt * max(0., pre_qbid_taxinc - net_cg)
qbided = min(qbided, taxinc_cap)
# calculate taxable income after qualified business income deduction
c04800 = max(0., pre_qbid_taxinc - qbided)
return (c04800, qbided)
Expand Down
28 changes: 14 additions & 14 deletions taxcalc/tests/cpscsv_agg_expect.csv
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026
Returns (#m),160.3,162.9,165.3,167.5,169.8,171.9,174.1,176.2,178.4,180.6
AGI ($b),10451.2,10994.1,11545.0,12109.4,12655.0,13180.4,13724.6,14296.7,14857.0,15433.7
Itemizers (#m),69.6,29.5,30.6,32.0,33.2,34.3,35.4,36.6,37.8,82.0
Itemized Deduction ($b),1499.4,799.9,847.7,902.2,961.1,1020.4,1082.2,1147.7,1216.8,2327.3
Standard Deduction Filers (#m),90.6,133.4,134.7,135.5,136.6,137.6,138.7,139.7,140.7,98.6
Standard Deduction ($b),818.3,2290.8,2363.4,2420.6,2495.3,2571.7,2649.4,2726.2,2801.8,1075.8
Itemizers (#m),69.6,29.5,30.6,32.1,33.2,34.4,35.5,36.6,37.8,82.0
Itemized Deduction ($b),1499.4,801.0,848.9,903.5,962.5,1022.0,1083.9,1149.4,1218.5,2327.3
Standard Deduction Filers (#m),90.6,133.3,134.6,135.4,136.5,137.6,138.6,139.6,140.6,98.6
Standard Deduction ($b),818.3,2290.3,2362.8,2419.9,2494.5,2570.7,2648.3,2725.1,2800.7,1075.8
Personal Exemption ($b),1279.6,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1743.0
Taxable Income ($b),7391.5,8360.0,8811.5,9280.9,9715.5,10128.9,10558.8,11013.2,11454.3,11056.5
Regular Tax ($b),1407.9,1423.6,1511.2,1609.7,1697.2,1778.7,1861.8,1948.8,2033.0,2200.4
AMT Income ($b),9604.3,10430.1,10947.8,11475.1,11978.7,12461.5,12961.2,13486.2,13996.5,14117.4
AMT Liability ($b),16.5,1.2,1.2,1.2,1.2,1.2,1.2,1.2,1.2,34.4
Taxable Income ($b),7391.5,8374.9,8827.1,9296.9,9732.0,10145.9,10576.3,11031.3,11473.0,11056.5
Regular Tax ($b),1407.9,1425.4,1513.1,1611.7,1699.3,1780.8,1863.9,1951.0,2035.3,2200.4
AMT Income ($b),9604.3,10429.2,10946.8,11474.0,11977.5,12460.2,12959.9,13484.8,13995.1,14117.4
AMT Liability ($b),16.5,1.2,1.2,1.1,1.1,1.1,1.1,1.1,1.1,34.4
AMT Filers (#m),4.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,6.2
Tax before Credits ($b),1424.5,1424.8,1512.4,1610.9,1698.4,1779.9,1863.0,1950.0,2034.2,2234.8
Refundable Credits ($b),66.9,77.9,78.0,77.7,78.1,79.5,80.1,80.6,81.4,70.7
Nonrefundable Credits ($b),27.4,90.6,92.3,94.0,95.4,96.7,97.9,99.1,100.3,25.3
Tax before Credits ($b),1424.5,1426.6,1514.2,1612.8,1700.4,1781.9,1865.0,1952.1,2036.4,2234.8
Refundable Credits ($b),66.9,77.7,77.9,77.5,78.0,79.3,79.9,80.4,81.2,70.7
Nonrefundable Credits ($b),27.4,91.0,92.7,94.4,95.9,97.1,98.3,99.6,100.8,25.3
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),9.3,9.8,10.4,11.0,11.5,12.0,12.5,12.9,12.3,12.9
Ind Income Tax ($b),1339.4,1266.2,1352.6,1450.2,1536.4,1615.7,1697.4,1783.2,1864.8,2151.7
Ind Income Tax ($b),1339.4,1267.7,1354.1,1451.8,1538.0,1617.4,1699.2,1785.1,1866.8,2151.7
Payroll Taxes ($b),1156.4,1203.7,1262.7,1323.7,1381.1,1436.2,1493.4,1554.3,1617.2,1680.6
Combined Liability ($b),2495.8,2469.9,2615.2,2773.9,2917.5,3051.9,3190.8,3337.5,3482.0,3832.3
With Income Tax <= 0 (#m),55.5,59.2,59.8,60.0,60.6,61.1,61.7,62.3,62.8,61.3
Combined Liability ($b),2495.8,2471.4,2616.8,2775.5,2919.1,3053.6,3192.6,3339.4,3484.0,3832.3
With Income Tax <= 0 (#m),55.5,58.8,59.4,59.6,60.2,60.8,61.4,61.9,62.4,61.3
With Combined Tax <= 0 (#m),36.0,37.7,38.4,39.0,39.7,40.4,41.2,41.8,42.6,42.3
30 changes: 15 additions & 15 deletions taxcalc/tests/pufcsv_agg_expect.csv
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026
Returns (#m),169.9,172.7,175.2,177.5,179.8,182.0,184.3,186.4,188.7,190.9
AGI ($b),11286.7,12044.9,12581.2,13054.1,13531.0,14015.4,14544.1,15135.3,15749.9,16297.8
Itemizers (#m),46.2,20.3,20.4,21.0,21.6,22.2,22.8,23.5,24.2,53.4
Itemized Deduction ($b),1302.3,639.2,657.3,687.7,727.3,769.1,812.2,858.0,904.5,1961.3
Itemizers (#m),46.2,20.4,20.5,21.0,21.6,22.2,22.8,23.5,24.2,53.4
Itemized Deduction ($b),1302.3,639.7,657.9,688.2,727.6,769.5,812.7,858.7,905.4,1961.3
Standard Deduction Filers (#m),123.8,152.4,154.8,156.5,158.2,159.8,161.4,162.9,164.5,137.5
Standard Deduction ($b),1097.0,2586.4,2688.0,2770.4,2865.1,2959.9,3059.2,3155.0,3255.0,1488.2
Standard Deduction ($b),1097.0,2586.4,2687.8,2770.2,2865.0,2959.9,3059.1,3154.8,3254.6,1488.2
Personal Exemption ($b),1253.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1695.6
Taxable Income ($b),8207.8,9301.6,9742.3,10113.1,10472.5,10837.9,11245.4,11714.3,12204.7,11918.9
Regular Tax ($b),1680.7,1743.7,1830.2,1900.0,1965.2,2032.7,2110.1,2202.3,2299.4,2465.0
AMT Income ($b),10684.1,11623.1,12147.4,12601.4,13051.3,13506.6,14005.6,14565.3,15147.7,15391.5
AMT Liability ($b),49.6,23.0,24.2,25.6,26.7,27.7,29.0,30.2,31.6,88.3
AMT Filers (#m),5.3,0.6,0.6,0.6,0.6,0.6,0.6,0.6,0.6,7.2
Tax before Credits ($b),1730.3,1766.7,1854.4,1925.5,1991.9,2060.4,2139.1,2232.6,2331.0,2553.3
Refundable Credits ($b),104.6,120.2,121.6,122.3,124.0,126.9,128.8,130.4,132.9,117.5
Nonrefundable Credits ($b),68.2,127.4,129.6,131.2,132.4,134.0,135.7,138.0,139.9,74.6
Taxable Income ($b),8207.8,9319.3,9760.9,10132.4,10492.5,10858.6,11266.8,11736.5,12227.8,11918.9
Regular Tax ($b),1680.7,1746.1,1832.7,1902.6,1967.8,2035.5,2112.9,2205.3,2302.5,2465.0
AMT Income ($b),10684.1,11622.7,12146.9,12601.0,13050.9,13506.2,14005.1,14564.7,15147.0,15391.5
AMT Liability ($b),49.6,22.6,23.9,25.2,26.3,27.4,28.6,29.8,31.2,88.3
AMT Filers (#m),5.3,0.6,0.6,0.6,0.5,0.5,0.5,0.5,0.5,7.2
Tax before Credits ($b),1730.3,1768.7,1856.6,1927.8,1994.2,2062.8,2141.6,2235.1,2333.7,2553.3
Refundable Credits ($b),104.6,120.1,121.5,122.1,123.8,126.7,128.6,130.2,132.7,117.5
Nonrefundable Credits ($b),68.2,128.0,130.2,131.8,133.1,134.7,136.5,138.8,140.8,74.6
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.9,48.5,49.6,48.9,49.0,49.3,50.2,51.5,53.2,53.7
Ind Income Tax ($b),1598.4,1567.5,1652.8,1721.0,1784.5,1848.8,1924.8,2015.7,2111.3,2414.8
Ind Income Tax ($b),1598.4,1569.1,1654.5,1722.7,1786.3,1850.7,1926.7,2017.7,2113.4,2414.8
Payroll Taxes ($b),1108.9,1154.1,1209.4,1266.2,1319.6,1371.5,1425.7,1483.7,1543.5,1604.1
Combined Liability ($b),2707.3,2721.7,2862.2,2987.2,3104.1,3220.4,3350.5,3499.4,3654.8,4018.9
With Income Tax <= 0 (#m),69.3,76.2,76.6,76.8,77.4,77.9,78.5,78.9,79.4,73.5
With Combined Tax <= 0 (#m),40.8,42.8,43.4,43.3,43.9,44.5,45.1,45.4,46.1,44.7
Combined Liability ($b),2707.3,2723.2,2863.9,2988.9,3105.9,3222.2,3352.4,3501.4,3656.9,4018.9
With Income Tax <= 0 (#m),69.3,75.8,76.2,76.4,76.9,77.4,78.0,78.4,78.9,73.5
With Combined Tax <= 0 (#m),40.8,42.8,43.3,43.3,43.9,44.5,45.0,45.4,46.0,44.7

0 comments on commit 51ef36a

Please sign in to comment.