diff --git a/taxcalc/calcfunctions.py b/taxcalc/calcfunctions.py index 5aa06b0a4..9512d9a14 100644 --- a/taxcalc/calcfunctions.py +++ b/taxcalc/calcfunctions.py @@ -249,7 +249,7 @@ def Adj(e03150, e03210, c03260, ------- c02900 : total Form 1040 adjustments, which are not included in AGI """ - # Form 2555 foreign earned income deduction is assumed to be zero + # Form 2555 foreign earned income exclusion is assumed to be zero # Form 1040 adjustments that are included in expanded income: c02900 = ((1. - ALD_StudentLoan_hc) * e03210 + c03260 + @@ -983,7 +983,7 @@ def GainsTax(e00650, c01000, c23650, p23250, e01100, e58990, e00200, dwks19 = 0. # final calculations done no matter what the value of hasqdivltcg - c05100 = c24580 # because no foreign earned income deduction + c05100 = c24580 # because foreign earned income exclusion is assumed zero c05700 = 0. # no Form 4972, Lump Sum Distributions taxbc = c05700 + c05100 return (dwks10, dwks13, dwks14, dwks19, c05700, taxbc) @@ -1102,7 +1102,7 @@ def NetInvIncTax(e00300, e00600, e02000, e26270, c01000, Computes Net Investment Income Tax (NIIT) amount assuming that all annuity income is excluded from net investment income. """ - modAGI = c00100 # no deducted foreign earned income to add + modAGI = c00100 # no foreign earned income exclusion to add if not NIIT_PT_taxed: NII = max(0., e00300 + e00600 + c01000 + e02000 - e26270) else: # do not subtract e26270 from e02000 @@ -1226,33 +1226,61 @@ def EITC(MARS, DSI, EIC, c00100, e00300, e00400, e00600, c01000, @iterate_jit(nopython=True) -def ChildDepTaxCredit(n24, MARS, c00100, exact, - CTC_c, CTC_ps, CTC_prt, prectc, nu05, - CTC_c_under5_bonus, XTOT, num, +def ChildDepTaxCredit(n24, MARS, c00100, XTOT, num, c05800, + e07260, CR_ResidentialEnergy_hc, + e07300, CR_ForeignTax_hc, + c07180, + c07230, + e07240, CR_RetirementSavings_hc, + c07200, + CTC_c, CTC_ps, CTC_prt, exact, DependentCredit_Child_c, DependentCredit_Nonchild_c, - FilerCredit_c, dep_credit): - """ - Computes pre-CTC amount (prectc) and nonrefundable dependent credit. - """ - modAGI = c00100 # no foreign earned income deduction to add to AGI - # calculate and phase-out pre-CTC amount - base_ctc = CTC_c * n24 + CTC_c_under5_bonus * nu05 - prectc = base_ctc - if prectc > 0. and modAGI > CTC_ps[MARS - 1]: - excess = modAGI - CTC_ps[MARS - 1] - if exact == 1: # exact calculation as on tax forms - excess = 1000. * math.ceil(excess / 1000.) - prectc = max(0., prectc - CTC_prt * excess) - # calculate and phase-out dependent credit after pre-CTC is phased out - dep_credit = (DependentCredit_Child_c * n24 + - DependentCredit_Nonchild_c * max(0, XTOT - n24 - num) + - FilerCredit_c[MARS - 1]) - if dep_credit > 0. and modAGI > CTC_ps[MARS - 1]: + CTC_c_under5_bonus, nu05, FilerCredit_c, + c07220, dep_credit, codtc_limited): + """ + Computes amounts on "Child Tax Credit and Credit for Other Dependents + Worksheet" in 2018 Publication 972, which pertain to these two + nonrefundable tax credits. + """ + # Worksheet Part 1 + line1 = ((CTC_c + DependentCredit_Child_c) * n24 + + CTC_c_under5_bonus * nu05) + line2 = (DependentCredit_Nonchild_c * max(0, XTOT - n24 - num) + + FilerCredit_c[MARS - 1]) + line3 = line1 + line2 + modAGI = c00100 # no foreign earned income exclusion to add to AGI (line6) + if line3 > 0. and modAGI > CTC_ps[MARS - 1]: excess = modAGI - CTC_ps[MARS - 1] if exact == 1: # exact calculation as on tax forms excess = 1000. * math.ceil(excess / 1000.) - dep_credit = max(0., dep_credit - CTC_prt * excess) - return (prectc, dep_credit) + line10 = max(0., line3 - CTC_prt * excess) + else: + line10 = line3 + if line10 > 0.: + # Worksheet Part 2 + line11 = c05800 + line12 = (e07260 * (1. - CR_ResidentialEnergy_hc) + + e07300 * (1. - CR_ForeignTax_hc) + + c07180 + # child & dependent care expense credit + c07230 + # education credit + e07240 * (1. - CR_RetirementSavings_hc) + + c07200) # Schedule R credit + line13 = line11 - line12 + line14 = 0. + line15 = max(0., line13 - line14) + line16 = min(line10, line15) # credit is capped by tax liability + else: + line16 = 0. + # separate the CTC and ODTC amounts + c07220 = 0. # nonrefundable CTC amount + dep_credit = 0. # nonrefundable ODTC amount + if line16 > 0.: + if line1 > 0.: + c07220 = line16 * line1 / line3 + dep_credit = max(0., line16 - c07220) + # compute codtc_limited for use in AdditionalCTC function + codtc_limited = max(0., line10 - line16) + return (c07220, dep_credit, codtc_limited) @iterate_jit(nopython=True) @@ -1352,7 +1380,7 @@ def SchR(age_head, age_spouse, MARS, c00100, are not able to be changed using Policy class parameters. Note that the CR_SchR_hc policy parameter allows the user to eliminate - or reduce total schedule R credits. + or reduce total Schedule R credits. """ if age_head >= 65 or (MARS == 2 and age_spouse >= 65): # calculate credit assuming nobody is disabled (so line12 = line10) @@ -1472,7 +1500,7 @@ def CharityCredit(e19800, e20100, c00100, CR_Charity_rt, CR_Charity_f, @iterate_jit(nopython=True) def NonrefundableCredits(c05800, e07240, e07260, e07300, e07400, - e07600, p08000, prectc, dep_credit, + e07600, p08000, dep_credit, personal_nonrefundable_credit, CR_RetirementSavings_hc, CR_ForeignTax_hc, CR_ResidentialEnergy_hc, CR_GeneralBusiness_hc, @@ -1507,11 +1535,11 @@ def NonrefundableCredits(c05800, e07240, e07260, e07300, e07400, c07240 = min(e07240 * (1. - CR_RetirementSavings_hc), avail) avail = avail - c07240 if DependentCredit_before_CTC: - # Dependent credit + # Other dependent credit dep_credit = min(dep_credit, avail) avail = avail - dep_credit # Child tax credit - c07220 = min(prectc, avail) + c07220 = min(c07220, avail) avail = avail - c07220 # Residential energy credit - Form 5695 c07260 = min(e07260 * (1. - CR_ResidentialEnergy_hc), avail) @@ -1543,59 +1571,41 @@ def NonrefundableCredits(c05800, e07240, e07260, e07300, e07400, @iterate_jit(nopython=True) -def AdditionalCTC(n24, prectc, earned, c07220, ptax_was, - ACTC_Income_thd, ACTC_rt, ACTC_ChildNum, - c03260, e09800, c59660, e11200, c11070, nu05, - ACTC_rt_bonus_under5family): - """ - Calculates Additional (refundable) Child Tax Credit, c11070. - """ - c82925 = 0. - c82930 = 0. - c82935 = 0. - c82880 = 0. - c82885 = 0. - c82890 = 0. - c82900 = 0. - c82905 = 0. - c82910 = 0. - c82915 = 0. - c82920 = 0. - c82937 = 0. - c82940 = 0. - c11070 = 0. - # Part I of 2005 Form 8812 - if n24 > 0: - c82925 = prectc - c82930 = c07220 - c82935 = c82925 - c82930 - # CTC not applied to tax - c82880 = max(0., earned) - c82885 = max(0., c82880 - ACTC_Income_thd) - # Accomodate ACTC rate bonus for families with children under 5 +def AdditionalCTC(codtc_limited, CTC_c, n24, earned, ACTC_Income_thd, + ACTC_rt, nu05, ACTC_rt_bonus_under5family, ACTC_ChildNum, + ptax_was, c03260, e09800, c59660, e11200, + c11070): + """ + Calculates refundable Additional Child Tax Credit (ACTC), c11070, + following 2018 Form 8812 logic. + """ + # Part I + line3 = codtc_limited + line4 = CTC_c * n24 + c11070 = 0. # line15 + if line3 > 0. and line4 > 0.: + line5 = min(line3, line4) + line7 = max(0., earned - ACTC_Income_thd) + # accommodate ACTC rate bonus for families with children under 5 if nu05 == 0: ACTC_rate = ACTC_rt else: ACTC_rate = ACTC_rt + ACTC_rt_bonus_under5family - c82890 = ACTC_rate * c82885 - # Part II of 2005 Form 8812 - if n24 >= ACTC_ChildNum and c82890 < c82935: - c82900 = 0.5 * ptax_was - c82905 = c03260 + e09800 - c82910 = c82900 + c82905 - c82915 = c59660 + e11200 - c82920 = max(0., c82910 - c82915) - c82937 = max(c82890, c82920) - # Part II of 2005 Form 8812 - if n24 < ACTC_ChildNum: - if n24 > 0 and c82890 > 0: - c82940 = min(c82890, c82935) - else: # if n24 >= ACTC_ChildNum - if c82890 >= c82935: - c82940 = c82935 - else: - c82940 = min(c82935, c82937) - c11070 = c82940 + line8 = ACTC_rate * line7 + if n24 < ACTC_ChildNum: + if line8 > 0.: + c11070 = min(line5, line8) + else: # if n24 >= ACTC_ChildNum + if line8 >= line5: + c11070 = line5 + else: # complete Part II + line9 = 0.5 * ptax_was + line10 = c03260 + e09800 + line11 = line9 + line10 + line12 = c59660 + e11200 + line13 = max(0., line11 - line12) + line14 = max(line8, line13) + c11070 = min(line5, line14) return c11070 diff --git a/taxcalc/calculator.py b/taxcalc/calculator.py index 50953547b..5ad842cef 100644 --- a/taxcalc/calculator.py +++ b/taxcalc/calculator.py @@ -1448,12 +1448,12 @@ def _calc_one_year(self, zero_out_calc_vars=False): self._taxinc_to_amt() F2441(self.__policy, self.__records) EITC(self.__policy, self.__records) - ChildDepTaxCredit(self.__policy, self.__records) PersonalTaxCredit(self.__policy, self.__records) AmOppCreditParts(self.__policy, self.__records) SchR(self.__policy, self.__records) EducationTaxCredit(self.__policy, self.__records) CharityCredit(self.__policy, self.__records) + ChildDepTaxCredit(self.__policy, self.__records) NonrefundableCredits(self.__policy, self.__records) AdditionalCTC(self.__policy, self.__records) C1040(self.__policy, self.__records) diff --git a/taxcalc/records_variables.json b/taxcalc/records_variables.json index 04401205c..0a7e84571 100644 --- a/taxcalc/records_variables.json +++ b/taxcalc/records_variables.json @@ -1041,7 +1041,7 @@ "desc": "Personal exemption before phase-out", "form": {"2013-20??": "calculated variable"} }, - "prectc": { + "codtc_limited": { "type": "float", "desc": "search taxcalc/calcfunctions.py for how calculated and used", "form": {"2013-20??": "calculated variable"} diff --git a/taxcalc/tests/cpscsv_agg_expect.txt b/taxcalc/tests/cpscsv_agg_expect.txt index 4784a55df..7f803b9b5 100644 --- a/taxcalc/tests/cpscsv_agg_expect.txt +++ b/taxcalc/tests/cpscsv_agg_expect.txt @@ -13,11 +13,11 @@ AMT Liability ($b) 10.6 13.4 13.8 15.6 1.3 AMT Filers (#m) 2.8 3.5 3.7 4.0 0.2 0.3 0.3 0.2 0.3 0.3 Tax before Credits ($b) 1120.1 1297.3 1330.3 1380.7 1380.7 1489.3 1594.3 1686.2 1773.7 1860.1 Refundable Credits ($b) 67.2 68.6 68.8 68.2 79.0 78.5 78.2 78.6 79.8 80.4 -Nonrefundable Credits ($b) 26.7 27.0 27.1 27.4 90.0 92.1 93.8 95.2 96.4 97.6 +Nonrefundable Credits ($b) 26.7 27.0 27.1 27.4 90.1 92.3 94.0 95.4 96.7 97.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) 6.7 7.8 8.0 8.1 8.6 9.6 10.4 11.2 11.8 12.5 -Ind Income Tax ($b) 1032.9 1209.5 1242.4 1293.2 1220.4 1328.3 1432.8 1523.6 1609.3 1694.6 +Ind Income Tax ($b) 1032.9 1209.5 1242.4 1293.2 1220.2 1328.1 1432.5 1523.3 1609.0 1694.3 Payroll Taxes ($b) 933.0 1069.6 1096.3 1140.9 1193.6 1260.9 1326.1 1384.6 1441.3 1498.8 -Combined Liability ($b) 1965.9 2279.0 2338.8 2434.1 2414.0 2589.2 2758.8 2908.2 3050.6 3193.3 +Combined Liability ($b) 1965.9 2279.0 2338.8 2434.1 2413.8 2589.0 2758.6 2907.9 3050.3 3193.0 With Income Tax <= 0 (#m) 58.0 54.1 55.2 56.0 59.7 59.9 60.1 60.6 61.2 61.8 With Combined Tax <= 0 (#m) 36.0 34.9 35.7 36.3 38.1 38.5 39.1 39.8 40.5 41.3 diff --git a/taxcalc/tests/puf_var_correl_coeffs_2016.csv b/taxcalc/tests/puf_var_correl_coeffs_2016.csv index d8031eda2..163a2ba05 100644 --- a/taxcalc/tests/puf_var_correl_coeffs_2016.csv +++ b/taxcalc/tests/puf_var_correl_coeffs_2016.csv @@ -6,7 +6,7 @@ c04600, -0.21, -0.12, -0.14, 1.00, -0.21, -0.21, 0.13, 0.51, c04800, 0.99, 0.07, 0.47, -0.21, 1.00, 1.00, -0.01, -0.06, 0.06, -0.05, 0.87, 0.04, 0.03, 0.45, 0.38, 0.24, 0.39, 0.34, 0.29, -0.01, 0.06, 0.01, 0.08, 0.10, 0.03, 0.05, 0.40, -0.03, -0.03, 0.03, 0.01, -0.03, -0.02, -0.02, 0.22, 0.14, 0.04, 0.07, 0.00, -0.01, -0.02, 0.04, 0.23, 0.15, 0.06, 0.01, -0.00, 0.00, 0.10, -0.01, 0.55, 0.43, 0.28, 0.26, 0.18, 0.36, 0.14, 0.09, 0.35, 0.01, -0.00, 0.06, 0.24, -0.04, -0.01, -0.06, 0.00, 0.00, 0.96, -0.09, -0.01, -0.01, 0.03, 0.02, 0.09, 0.78, 0.46, 0.19, 0.20 c05200, 0.99, 0.07, 0.47, -0.21, 1.00, 1.00, -0.01, -0.05, 0.06, -0.05, 0.87, 0.04, 0.03, 0.45, 0.38, 0.24, 0.39, 0.34, 0.29, -0.01, 0.05, 0.01, 0.08, 0.10, 0.02, 0.05, 0.40, -0.03, -0.03, 0.03, 0.01, -0.03, -0.02, -0.01, 0.22, 0.14, 0.04, 0.07, 0.00, -0.01, -0.02, 0.04, 0.23, 0.15, 0.06, 0.01, -0.00, 0.00, 0.09, -0.01, 0.55, 0.42, 0.27, 0.26, 0.18, 0.36, 0.14, 0.09, 0.34, 0.01, -0.01, 0.06, 0.24, -0.04, -0.01, -0.05, 0.00, 0.00, 0.96, -0.08, -0.01, -0.01, 0.03, 0.02, 0.09, 0.79, 0.45, 0.18, 0.20 c07180, -0.00, -0.05, -0.00, 0.13, -0.01, -0.01, 1.00, 0.18, -0.01, 0.04, -0.01, -0.01, 0.03, 0.01, -0.01, -0.01, -0.01, -0.01, -0.00, -0.00, 0.01, -0.00, 0.00, -0.01, -0.01, -0.02, -0.00, 0.00, -0.00, -0.07, -0.00, 0.03, 0.05, 0.01, -0.01, 0.00, 0.00, 0.02, 0.00, -0.00, 0.00, -0.00, -0.00, -0.00, -0.00, -0.00, -0.00, 0.00, 0.01, -0.01, -0.00, -0.00, 0.01, -0.01, -0.00, -0.01, -0.00, 0.00, 0.00, -0.00, 0.85, -0.00, -0.00, 0.00, 0.01, 0.00, 0.01, -0.00, -0.01, 0.00, -0.00, 0.08, 0.15, 0.00, 0.00, -0.01, 0.03, 0.04, 0.04 -c07220, -0.05, -0.09, -0.04, 0.51, -0.06, -0.05, 0.18, 1.00, -0.00, 0.03, -0.05, 0.00, 0.05, -0.04, -0.02, -0.03, -0.02, -0.02, -0.02, -0.00, -0.01, -0.01, 0.00, -0.03, -0.03, -0.04, -0.03, 0.01, 0.02, -0.12, -0.01, 0.09, 0.07, -0.00, -0.02, -0.05, -0.02, -0.04, -0.00, -0.00, 0.05, -0.01, -0.01, -0.01, -0.01, -0.00, -0.00, 0.00, -0.04, -0.02, -0.04, -0.07, -0.02, -0.02, -0.01, -0.03, -0.01, -0.00, -0.03, -0.01, 0.21, -0.01, -0.01, 0.00, 0.02, -0.01, 0.02, -0.00, -0.06, 0.02, 0.01, 0.22, 0.35, -0.00, 0.00, -0.03, -0.03, -0.05, -0.03 +c07220, -0.05, -0.09, -0.04, 0.51, -0.06, -0.05, 0.18, 1.00, -0.00, 0.03, -0.05, 0.00, 0.05, -0.04, -0.02, -0.03, -0.02, -0.02, -0.02, -0.00, -0.01, -0.00, 0.00, -0.03, -0.03, -0.04, -0.03, 0.01, 0.02, -0.12, -0.01, 0.09, 0.07, -0.00, -0.02, -0.05, -0.02, -0.04, -0.00, -0.00, 0.05, -0.01, -0.01, -0.01, -0.01, -0.00, -0.00, 0.00, -0.04, -0.02, -0.04, -0.07, -0.02, -0.02, -0.01, -0.03, -0.01, -0.00, -0.03, -0.01, 0.21, -0.01, -0.01, 0.00, 0.02, -0.01, 0.02, -0.00, -0.06, 0.02, 0.01, 0.22, 0.35, -0.00, 0.00, -0.03, -0.03, -0.05, -0.03 c09600, 0.06, 0.03, 0.10, -0.02, 0.06, 0.06, -0.01, -0.00, 1.00, -0.01, 0.05, 0.96, 0.01, 0.01, 0.08, 0.06, 0.07, 0.06, 0.05, -0.00, -0.06, -0.00, 0.01, 0.01, 0.00, 0.01, -0.02, -0.01, -0.01, 0.02, -0.00, -0.01, -0.01, -0.00, 0.00, 0.01, 0.00, -0.00, 0.00, -0.00, -0.00, 0.00, 0.00, 0.01, -0.00, -0.00, -0.00, 0.00, 0.00, 0.00, 0.10, 0.04, 0.04, 0.02, 0.03, 0.09, 0.09, 0.02, -0.04, 0.00, -0.01, 0.03, 0.01, -0.00, 0.00, -0.01, 0.00, 0.00, 0.27, -0.00, 0.00, -0.00, 0.00, 0.01, -0.00, 0.07, 0.01, 0.00, 0.01 c11070, -0.06, -0.09, -0.04, 0.41, -0.05, -0.05, 0.04, 0.03, -0.01, 1.00, -0.05, -0.01, 0.05, -0.05, -0.01, -0.02, -0.02, -0.02, -0.02, -0.01, -0.01, -0.00, -0.02, -0.02, -0.03, -0.04, -0.04, -0.00, 0.02, -0.11, -0.03, -0.02, -0.03, 0.00, -0.01, -0.04, -0.03, -0.03, -0.00, -0.01, 0.03, -0.01, -0.01, -0.01, -0.01, -0.00, 0.02, -0.01, -0.03, -0.02, -0.04, -0.08, -0.04, -0.02, -0.01, -0.02, -0.01, -0.00, -0.03, -0.00, 0.04, -0.01, -0.01, 0.06, -0.01, 0.70, 0.03, -0.00, -0.06, 0.02, 0.01, 0.23, 0.33, -0.01, -0.00, -0.02, -0.07, -0.10, -0.08 c21040, 0.89, 0.07, 0.66, -0.20, 0.87, 0.87, -0.01, -0.05, 0.05, -0.05, 1.00, 0.02, 0.03, 0.48, 0.46, 0.27, 0.40, 0.33, 0.37, -0.01, 0.06, 0.01, 0.07, 0.10, 0.02, 0.05, 0.45, -0.03, -0.03, 0.03, 0.01, -0.03, -0.02, -0.01, 0.23, 0.15, 0.04, 0.07, 0.01, -0.01, -0.02, 0.05, 0.21, 0.17, 0.06, 0.00, -0.00, 0.00, 0.09, -0.01, 0.71, 0.48, 0.34, 0.37, 0.28, 0.46, 0.11, 0.08, 0.39, 0.01, -0.01, 0.07, 0.22, -0.04, -0.01, -0.05, 0.00, 0.00, 0.87, -0.08, -0.01, -0.01, 0.03, 0.02, 0.07, 0.59, 0.49, 0.18, 0.20 @@ -20,7 +20,7 @@ e00650, 0.35, 0.06, 0.29, -0.07, 0.34, 0.34, -0.01, -0.02, e00700, 0.31, 0.03, 0.35, -0.08, 0.29, 0.29, -0.00, -0.02, 0.05, -0.02, 0.37, 0.03, 0.01, 0.16, 0.26, 0.14, 0.13, 0.11, 1.00, -0.00, 0.01, 0.00, 0.00, 0.05, 0.01, 0.02, 0.31, -0.01, -0.01, 0.02, 0.01, -0.01, -0.01, -0.01, 0.23, 0.10, 0.02, 0.04, 0.00, -0.00, -0.01, 0.02, 0.12, 0.16, 0.05, 0.00, -0.00, 0.00, 0.05, -0.01, 0.46, 0.22, 0.13, 0.16, 0.05, 0.14, 0.02, 0.00, 0.27, 0.01, -0.00, 0.02, 0.12, -0.02, -0.01, -0.02, -0.00, 0.00, 0.33, -0.02, 0.00, -0.00, 0.01, 0.01, 0.03, 0.10, 0.17, 0.08, 0.09 e00800, -0.01, -0.00, -0.00, -0.00, -0.01, -0.01, -0.00, -0.00, -0.00, -0.01, -0.01, -0.00, -0.02, -0.01, -0.00, -0.00, -0.00, -0.00, -0.00, 1.00, -0.00, -0.00, 0.00, -0.00, -0.00, -0.00, -0.00, 0.00, -0.00, -0.00, -0.00, -0.01, 0.00, -0.00, -0.00, -0.01, -0.00, -0.00, -0.00, 0.00, -0.00, -0.00, -0.00, -0.00, 0.00, -0.00, -0.00, -0.00, -0.00, 0.01, -0.00, -0.00, -0.00, -0.00, -0.00, -0.00, -0.00, -0.00, -0.00, -0.00, -0.00, -0.00, -0.00, 0.00, -0.00, -0.01, -0.00, -0.00, -0.01, 0.00, 0.00, -0.01, -0.01, -0.00, 0.00, -0.00, -0.01, -0.01, -0.01 e00900, 0.08, 0.01, 0.03, -0.06, 0.06, 0.05, 0.01, -0.01, -0.06, -0.01, 0.06, -0.06, 0.01, 0.02, -0.00, 0.01, -0.00, -0.01, 0.01, -0.00, 1.00, 0.01, -0.02, 0.01, 0.00, 0.00, -0.01, 0.01, -0.01, -0.00, 0.02, -0.01, -0.00, -0.02, -0.01, 0.12, 0.04, 0.20, -0.00, -0.00, -0.01, 0.00, 0.04, -0.02, 0.00, 0.00, -0.00, -0.00, 0.01, -0.00, 0.04, 0.08, 0.03, 0.02, 0.00, 0.02, 0.01, -0.00, -0.01, -0.00, 0.01, -0.00, 0.04, -0.01, -0.00, -0.01, 0.01, 0.00, 0.05, -0.74, -0.25, 0.01, 0.02, 0.00, -0.00, 0.00, 0.03, 0.00, 0.01 -e01100, 0.01, 0.00, 0.00, -0.01, 0.01, 0.01, -0.00, -0.01, -0.00, -0.00, 0.01, -0.00, 0.00, 0.01, -0.00, -0.00, 0.01, 0.01, 0.00, -0.00, 0.01, 1.00, 0.00, 0.00, 0.00, 0.00, 0.01, 0.00, -0.00, -0.00, 0.00, -0.00, -0.00, -0.00, 0.02, 0.01, 0.00, 0.00, -0.00, -0.00, -0.00, 0.00, -0.00, 0.01, 0.00, -0.00, -0.00, -0.00, 0.00, -0.00, 0.00, 0.01, -0.00, 0.00, -0.00, 0.00, -0.00, -0.00, 0.01, 0.00, -0.00, -0.00, -0.00, -0.00, -0.00, -0.01, 0.00, 0.00, 0.01, -0.01, 0.00, -0.00, 0.00, -0.00, 0.00, -0.00, 0.01, 0.01, 0.01 +e01100, 0.01, 0.00, 0.00, -0.01, 0.01, 0.01, -0.00, -0.00, -0.00, -0.00, 0.01, -0.00, 0.00, 0.01, -0.00, -0.00, 0.01, 0.01, 0.00, -0.00, 0.01, 1.00, 0.00, 0.00, 0.00, 0.00, 0.01, 0.00, -0.00, -0.00, 0.00, -0.00, -0.00, -0.00, 0.02, 0.01, 0.00, 0.00, -0.00, -0.00, -0.00, 0.00, -0.00, 0.01, 0.00, -0.00, -0.00, -0.00, 0.00, -0.00, 0.00, 0.01, -0.00, 0.00, -0.00, 0.00, -0.00, -0.00, 0.01, 0.00, -0.00, -0.00, -0.00, -0.00, -0.00, -0.01, 0.00, 0.00, 0.01, -0.01, 0.00, -0.00, 0.00, -0.00, 0.00, -0.00, 0.01, 0.01, 0.01 e01200, 0.11, 0.01, 0.03, -0.02, 0.08, 0.08, 0.00, 0.00, 0.01, -0.02, 0.07, -0.02, -0.00, 0.01, 0.02, 0.01, 0.02, 0.02, 0.00, 0.00, -0.02, 0.00, 1.00, -0.00, 0.00, -0.00, -0.03, 0.01, -0.00, -0.00, 0.00, 0.00, 0.00, 0.00, 0.01, -0.01, -0.01, -0.00, 0.00, 0.00, 0.00, -0.00, -0.00, -0.01, 0.00, -0.00, 0.00, -0.00, -0.01, 0.00, 0.02, 0.03, 0.05, 0.03, 0.02, 0.03, 0.01, 0.00, -0.02, 0.01, 0.00, -0.00, -0.00, -0.00, 0.00, 0.00, 0.00, 0.00, 0.07, 0.00, 0.00, -0.00, -0.00, 0.00, -0.00, 0.05, 0.01, 0.01, 0.00 e01400, 0.10, 0.15, 0.07, -0.08, 0.10, 0.10, -0.01, -0.03, 0.01, -0.02, 0.10, 0.01, 0.02, 0.04, 0.04, 0.07, 0.05, 0.05, 0.05, -0.00, 0.01, 0.00, -0.00, 1.00, 0.05, 0.05, 0.02, -0.00, -0.01, 0.12, 0.00, -0.01, -0.01, -0.01, 0.01, 0.03, 0.03, 0.02, 0.00, -0.00, -0.01, 0.02, 0.02, 0.01, 0.02, 0.00, -0.00, 0.12, 0.01, 0.02, 0.07, 0.13, 0.03, 0.03, 0.03, 0.07, 0.00, 0.00, 0.01, 0.00, -0.01, 0.01, 0.02, -0.02, -0.01, -0.03, -0.00, 0.01, 0.11, -0.01, -0.01, -0.01, -0.02, 0.00, -0.00, 0.04, 0.04, 0.02, 0.04 e01500, 0.03, 0.12, 0.03, -0.04, 0.03, 0.02, -0.01, -0.03, 0.00, -0.03, 0.02, -0.00, 0.02, 0.03, 0.01, 0.02, 0.01, 0.01, 0.01, -0.00, 0.00, 0.00, 0.00, 0.05, 1.00, 0.24, 0.00, -0.01, 0.01, 0.10, 0.00, -0.02, -0.00, -0.01, -0.00, 0.02, 0.02, 0.02, -0.00, -0.00, -0.01, 0.01, 0.00, 0.00, 0.00, -0.00, -0.00, 0.03, 0.04, 0.02, 0.03, 0.05, 0.01, 0.02, 0.00, 0.02, -0.00, 0.00, 0.00, -0.00, -0.01, 0.00, 0.00, -0.02, -0.01, -0.03, -0.00, 0.00, 0.03, -0.00, -0.00, -0.02, -0.02, -0.00, -0.00, 0.01, 0.04, 0.04, 0.06 diff --git a/taxcalc/tests/puf_var_wght_means_by_year.csv b/taxcalc/tests/puf_var_wght_means_by_year.csv index 46c910554..2b7451e67 100644 --- a/taxcalc/tests/puf_var_wght_means_by_year.csv +++ b/taxcalc/tests/puf_var_wght_means_by_year.csv @@ -6,9 +6,9 @@ c04600,Post-phase-out personal exemption, 7299, 7322, 7374, 7427, c04800,Federal regular taxable income, 40086, 44105, 45812, 45596, 47539, 49832, 52207, 53575, 54789, 56126, 57571, 59228, 60951, 62702, 64635, 66646 c05200,Regular tax on taxable income, 8601, 9801, 10188, 10050, 10641, 11243, 11804, 12044, 12258, 12518, 12819, 13183, 13571, 13963, 14407, 14870 c07180,Child care credit, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19 -c07220,Child tax credit (adjusted), 175, 170, 167, 162, 158, 153, 148, 144, 139, 136, 131, 128, 124, 120, 117, 113 +c07220,Child tax credit (adjusted), 174, 170, 166, 162, 158, 153, 148, 144, 139, 135, 131, 128, 124, 120, 117, 113 c09600,Federal AMT liability, 237, 253, 267, 274, 279, 289, 305, 323, 336, 349, 362, 374, 387, 401, 415, 431 -c11070,Extra child tax credit (refunded), 164, 158, 154, 150, 145, 141, 137, 134, 132, 130, 128, 126, 124, 121, 119, 117 +c11070,Extra child tax credit (refunded), 164, 159, 154, 150, 145, 141, 137, 134, 132, 130, 128, 126, 124, 122, 119, 117 c21040,Itemized deduction that is phased out, 227, 271, 282, 275, 296, 316, 332, 336, 340, 346, 353, 363, 374, 385, 398, 412 cmbtp,Estimate of income on (AMT) Form 6251 but not in AGI, 414, 432, 452, 461, 468, 485, 508, 533, 553, 571, 591, 611, 630, 653, 676, 699 data_source,1 if unit is created primarily from IRS-SOI PUF data; 0 if created primarily from CPS data (not used in tax-calculation logic), 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 @@ -67,7 +67,7 @@ e87530,Adjusted qualified lifetime learning expenses for all students, 104, eitc,Federal EITC, 412, 408, 405, 398, 394, 394, 394, 395, 399, 404, 410, 415, 420, 425, 429, 434 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 g20500,Itemizable gross (before 10% AGI disregard) casualty or theft loss, 31, 32, 34, 35, 36, 37, 39, 40, 42, 43, 45, 46, 47, 48, 50, 51 -iitax,Federal income tax liability, 7359, 8402, 8793, 8758, 9231, 9790, 10339, 10635, 10883, 11163, 11475, 11843, 12231, 12621, 13059, 13514 +iitax,Federal income tax liability, 7359, 8402, 8793, 8758, 9230, 9790, 10339, 10635, 10883, 11163, 11475, 11843, 12231, 12621, 13058, 13514 k1bx14p,Partner self-employment earnings/loss for taxpayer (included in e26270 total), -243, -269, -269, -254, -264, -280, -285, -280, -278, -280, -287, -296, -309, -314, -327, -333 k1bx14s,Partner self-employment earnings/loss for spouse (included in e26270 total), -9, -9, -9, -7, -7, -7, -6, -6, -6, -5, -6, -5, -6, -6, -7, -5 nu05,Number of dependents under 5 years old, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 diff --git a/taxcalc/tests/pufcsv_agg_expect.txt b/taxcalc/tests/pufcsv_agg_expect.txt index 523c29808..2bc38ed1f 100644 --- a/taxcalc/tests/pufcsv_agg_expect.txt +++ b/taxcalc/tests/pufcsv_agg_expect.txt @@ -12,12 +12,12 @@ AMT Income ($b) 8771.5 9427.3 9882.8 10021.5 10515.6 114 AMT Liability ($b) 38.5 41.0 43.9 45.7 47.5 23.6 25.1 26.6 27.8 28.9 AMT Filers (#m) 4.1 4.5 4.8 4.9 5.2 0.8 0.8 0.8 0.8 0.8 Tax before Credits ($b) 1340.3 1498.7 1580.6 1600.3 1699.8 1712.9 1829.5 1905.2 1974.4 2049.6 -Refundable Credits ($b) 105.6 104.0 104.3 104.4 105.0 120.2 121.2 122.0 123.7 126.5 -Nonrefundable Credits ($b) 67.0 66.9 67.4 67.2 68.4 127.2 130.1 131.7 132.9 134.5 +Refundable Credits ($b) 105.6 104.1 104.3 104.5 105.1 120.3 121.2 122.0 123.7 126.6 +Nonrefundable Credits ($b) 67.0 66.9 67.4 67.2 68.4 127.4 130.3 131.9 133.1 134.8 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) 26.2 33.9 35.5 33.1 39.4 44.2 46.9 46.7 47.1 48.0 -Ind Income Tax ($b) 1194.0 1361.6 1444.4 1461.7 1565.8 1509.7 1625.1 1698.3 1765.0 1836.6 +Ind Income Tax ($b) 1194.0 1361.6 1444.3 1461.7 1565.8 1509.4 1624.9 1698.0 1764.7 1836.3 Payroll Taxes ($b) 947.8 982.0 1026.6 1050.9 1094.3 1144.8 1207.7 1268.5 1322.9 1376.3 -Combined Liability ($b) 2141.9 2343.6 2470.9 2512.6 2660.0 2654.5 2832.8 2966.8 3087.9 3212.8 +Combined Liability ($b) 2141.8 2343.6 2470.9 2512.6 2660.0 2654.3 2832.6 2966.5 3087.6 3212.5 With Income Tax <= 0 (#m) 68.9 68.4 68.3 69.4 70.1 76.9 76.9 77.1 77.5 78.0 With Combined Tax <= 0 (#m) 39.5 39.8 39.9 40.6 41.3 43.3 43.6 44.0 44.4 45.0 diff --git a/taxcalc/tests/pufcsv_mtr_expect.txt b/taxcalc/tests/pufcsv_mtr_expect.txt index 41d2debab..5cd63acf0 100644 --- a/taxcalc/tests/pufcsv_mtr_expect.txt +++ b/taxcalc/tests/pufcsv_mtr_expect.txt @@ -6,55 +6,55 @@ ITAX mtr histogram bin edges: [-1.0, -0.3, -0.2, -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 1.0] PTAX and ITAX mtr histogram bin counts for e00200p: 248591 : 0 33076 0 0 0 0 0 207983 7532 0 -248591 : 5789 81 2041 8418 44176 77717 51577 32864 25134 794 +248591 : 5789 81 2041 8419 44157 77735 51584 32857 25134 794 PTAX and ITAX mtr histogram bin counts for e00200s: 122844 : 0 19895 0 0 0 0 0 93465 9484 0 -122844 : 1180 31 774 2714 12601 32570 27161 24534 20709 570 +122844 : 1180 31 774 2714 12588 32584 27166 24528 20709 570 PTAX and ITAX mtr histogram bin counts for e00900p: 248591 : 21872 27664 0 0 0 0 0 199055 0 0 -248591 : 5789 81 2038 8326 59654 65204 58264 30482 18442 311 +248591 : 5789 81 2038 8327 59635 65229 58258 30481 18442 311 PTAX and ITAX mtr histogram bin counts for e00300: 248591 : 248591 0 0 0 0 0 0 0 0 0 -248591 : 0 0 0 0 59798 78640 47677 32452 29198 826 +248591 : 0 0 0 0 59781 78657 47682 32447 29198 826 PTAX and ITAX mtr histogram bin counts for e00400: 248591 : 248591 0 0 0 0 0 0 0 0 0 248591 : 0 0 0 0 244266 4034 290 1 0 0 PTAX and ITAX mtr histogram bin counts for e00600: 248591 : 248591 0 0 0 0 0 0 0 0 0 -248591 : 0 0 0 0 59798 78640 47677 32452 29198 826 +248591 : 0 0 0 0 59781 78657 47682 32447 29198 826 PTAX and ITAX mtr histogram bin counts for e00650: 248591 : 248591 0 0 0 0 0 0 0 0 0 248591 : 0 0 10 71 139146 48048 60133 733 423 27 PTAX and ITAX mtr histogram bin counts for e01400: 248591 : 248591 0 0 0 0 0 0 0 0 0 -248591 : 0 0 0 0 59799 78669 51382 32934 25020 787 +248591 : 0 0 0 0 59782 78686 51387 32929 25020 787 PTAX and ITAX mtr histogram bin counts for e01700: 248591 : 248591 0 0 0 0 0 0 0 0 0 -248591 : 0 0 0 0 59800 78668 51382 32934 25020 787 +248591 : 0 0 0 0 59783 78685 51387 32929 25020 787 PTAX and ITAX mtr histogram bin counts for e02000: 248591 : 248591 0 0 0 0 0 0 0 0 0 -248591 : 0 0 0 0 59798 78640 47677 32452 29198 826 +248591 : 0 0 0 0 59781 78657 47682 32447 29198 826 PTAX and ITAX mtr histogram bin counts for e02400: 248591 : 248591 0 0 0 0 0 0 0 0 0 -248591 : 0 0 0 0 108285 45424 60199 33682 967 34 +248591 : 0 0 0 0 108262 45450 60196 33682 967 34 PTAX and ITAX mtr histogram bin counts for p22250: 248591 : 248591 0 0 0 0 0 0 0 0 0 -248591 : 0 0 1 1 71604 78494 54089 25418 18464 520 +248591 : 0 0 1 1 71585 78513 54094 25413 18464 520 PTAX and ITAX mtr histogram bin counts for p23250: 248591 : 248591 0 0 0 0 0 0 0 0 0 248591 : 0 0 6 55 146439 44873 51649 2944 2575 50 PTAX and ITAX mtr histogram bin counts for e18500: 248591 : 248591 0 0 0 0 0 0 0 0 0 -248591 : 25533 26425 20273 7876 168484 0 0 0 0 0 +248591 : 25533 26425 20293 7873 168467 0 0 0 0 0 PTAX and ITAX mtr histogram bin counts for e19200: 248591 : 248591 0 0 0 0 0 0 0 0 0 -248591 : 39910 33330 20601 5136 149614 0 0 0 0 0 +248591 : 39910 33330 20621 5133 149597 0 0 0 0 0 PTAX and ITAX mtr histogram bin counts for e26270: 248591 : 248591 0 0 0 0 0 0 0 0 0 -248591 : 0 0 0 0 59799 78669 51382 32934 25020 787 +248591 : 0 0 0 0 59782 78686 51387 32929 25020 787 PTAX and ITAX mtr histogram bin counts for e19800: 248591 : 248591 0 0 0 0 0 0 0 0 0 -248591 : 39758 32885 20527 5102 150319 0 0 0 0 0 +248591 : 39758 32885 20547 5099 150302 0 0 0 0 0 PTAX and ITAX mtr histogram bin counts for e20100: 248591 : 248591 0 0 0 0 0 0 0 0 0 -248591 : 39675 32845 20464 5094 150513 0 0 0 0 0 +248591 : 39675 32845 20484 5091 150496 0 0 0 0 0 diff --git a/taxcalc/tests/reforms_expect.csv b/taxcalc/tests/reforms_expect.csv index e766d649b..619c8d0bb 100644 --- a/taxcalc/tests/reforms_expect.csv +++ b/taxcalc/tests/reforms_expect.csv @@ -19,7 +19,7 @@ rid,res1,res2,res3,res4 18,34.4,35.9,37.0,39.3 19,66.3,69.8,73.4,78.5 20,100.2,104.8,108.6,114.6 -21,67.8,70.5,73.1,76.8 +21,67.8,70.5,73.1,76.9 22,7.8,8.6,7.6,7.7 23,0.7,0.8,0.8,0.9 24,46.8,48.6,50.4,53.5 @@ -39,7 +39,7 @@ rid,res1,res2,res3,res4 38,27.9,28.8,30.2,32.2 39,8.7,9.0,9.5,10.1 40,-0.5,-0.5,-0.6,-0.6 -41,51.6,51.0,50.8,50.2 +41,51.7,51.0,50.8,50.2 42,0.5,0.5,0.5,0.6 43,-0.2,-0.2,-0.2,-0.2 44,64.6,64.4,65.3,66.3 @@ -54,9 +54,9 @@ rid,res1,res2,res3,res4 53,-107.5,-109.0,-112.3,-115.9 54,28.7,31.2,33.0,32.3 55,85.4,89.8,95.8,101.9 -56,-8.8,-8.5,-8.2,-8.0 -57,-13.9,-13.6,-13.3,-13.1 -58,0.0,-30.3,-33.2,-38.2 +56,-16.8,-16.8,-16.7,-16.6 +57,-16.8,-16.8,-16.7,-16.6 +58,0.0,-30.3,-33.3,-38.2 59,-14.5,-16.0,-16.6,-16.1 60,-16.0,-17.6,-18.3,-17.8 61,-64.6,-65.0,-65.4,-65.6 diff --git a/taxcalc/tests/tbi_cps_expect.txt b/taxcalc/tests/tbi_cps_expect.txt index 5796d7c4b..c653119c4 100644 --- a/taxcalc/tests/tbi_cps_expect.txt +++ b/taxcalc/tests/tbi_cps_expect.txt @@ -1,13 +1,13 @@ TABLE aggr_1 RESULTS: { - "combined_tax_2": "2769.98", - "ind_tax_2": "1441.86", + "combined_tax_2": "2769.80", + "ind_tax_2": "1441.68", "payroll_tax_2": "1328.12" } TABLE aggr_2 RESULTS: { - "combined_tax_2": "3061.50", - "ind_tax_2": "1733.39", + "combined_tax_2": "3061.32", + "ind_tax_2": "1733.20", "payroll_tax_2": "1328.12" } TABLE aggr_d RESULTS: @@ -1414,17 +1414,17 @@ TABLE dist1_xbin RESULTS: "0.13", "0.51", "531.76", - "14.85", + "15.01", "1.89", "0.10", - "518.70", + "518.53", "330.18", - "848.88", + "848.71", "0.00", "299.29", "299.29", "3764.57", - "2915.69" + "2915.86" ], "$30-40K_2": [ "18.37", @@ -1518,17 +1518,17 @@ TABLE dist1_xbin RESULTS: "0.01", "0.07", "153.99", - "0.03", + "0.04", "1.93", "0.00", - "155.89", + "155.88", "35.86", - "191.75", + "191.73", "0.00", "19.51", "19.51", "709.02", - "517.27" + "517.29" ], "$75-100K_2": [ "20.36", @@ -1648,17 +1648,17 @@ TABLE dist1_xbin RESULTS: "0.26", "1.17", "1598.75", - "90.14", + "90.33", "10.39", "77.14", - "1441.86", + "1441.68", "1328.12", - "2769.98", + "2769.80", "0.00", "3253.20", "3253.20", "15954.52", - "13184.54" + "13184.72" ] } TABLE dist1_xdec RESULTS: @@ -1963,17 +1963,17 @@ TABLE dist1_xdec RESULTS: "0.18", "1.01", "983.72", - "16.81", + "16.99", "10.39", "0.16", - "977.14", + "976.95", "426.71", - "1403.85", + "1403.66", "0.00", "385.33", "385.33", "5704.43", - "4300.58" + "4300.77" ], "90-95_2": [ "8.37", @@ -1994,12 +1994,12 @@ TABLE dist1_xdec RESULTS: "0.07", "214.36", "173.82", - "388.18", + "388.17", "0.00", "206.97", "206.97", "1833.32", - "1445.14" + "1445.15" ], "95-99_2": [ "6.72", @@ -2015,17 +2015,17 @@ TABLE dist1_xdec RESULTS: "0.11", "0.46", "327.90", - "7.67", + "7.79", "1.64", "0.09", - "321.78", + "321.67", "181.53", - "503.32", + "503.20", "0.00", "148.88", "148.88", "2180.18", - "1676.86" + "1676.98" ], "ALL_2": [ "167.51", @@ -2041,17 +2041,17 @@ TABLE dist1_xdec RESULTS: "0.26", "1.17", "1598.75", - "90.14", + "90.33", "10.39", "77.14", - "1441.86", + "1441.68", "1328.12", - "2769.98", + "2769.80", "0.00", "3253.20", "3253.20", "15954.52", - "13184.54" + "13184.72" ], "Top 1%_2": [ "1.68", @@ -2067,17 +2067,17 @@ TABLE dist1_xdec RESULTS: "0.05", "0.51", "432.39", - "0.09", + "0.15", "8.69", "0.00", - "440.99", + "440.93", "71.36", - "512.35", + "512.29", "0.00", "29.49", "29.49", "1690.93", - "1178.58" + "1178.64" ] } TABLE dist2_xbin RESULTS: @@ -2200,17 +2200,17 @@ TABLE dist2_xbin RESULTS: "0.00", "0.00", "694.44", - "14.85", + "15.01", "1.89", "0.10", - "681.38", + "681.21", "330.18", - "1011.56", + "1011.39", "0.00", "299.29", "299.29", "3764.57", - "2753.00" + "2753.17" ], "$30-40K_2": [ "18.37", @@ -2304,17 +2304,17 @@ TABLE dist2_xbin RESULTS: "0.00", "0.01", "174.66", - "0.03", + "0.04", "1.93", "0.00", - "176.57", + "176.56", "35.86", - "212.43", + "212.41", "0.00", "19.51", "19.51", "709.02", - "496.59" + "496.61" ], "$75-100K_2": [ "20.36", @@ -2434,17 +2434,17 @@ TABLE dist2_xbin RESULTS: "0.09", "0.24", "1890.28", - "90.15", + "90.33", "10.39", "77.13", - "1733.39", + "1733.20", "1328.12", - "3061.50", + "3061.32", "0.00", "3253.20", "3253.20", "15954.52", - "12893.02" + "12893.20" ] } TABLE dist2_xdec RESULTS: @@ -2749,17 +2749,17 @@ TABLE dist2_xdec RESULTS: "0.02", "0.17", "1185.23", - "16.81", + "16.99", "10.39", "0.16", - "1178.65", + "1178.47", "426.71", - "1605.37", + "1605.18", "0.00", "-770.66", "-770.66", "5704.43", - "4099.07" + "4099.25" ], "90-95_2": [ "8.37", @@ -2785,7 +2785,7 @@ TABLE dist2_xdec RESULTS: "-413.94", "-413.94", "1833.32", - "1377.01" + "1377.02" ], "95-99_2": [ "6.72", @@ -2801,17 +2801,17 @@ TABLE dist2_xdec RESULTS: "0.00", "0.00", "429.41", - "7.67", + "7.79", "1.64", "0.09", - "423.29", + "423.18", "181.53", - "604.83", + "604.71", "0.00", "-297.76", "-297.76", "2180.18", - "1575.35" + "1575.47" ], "ALL_2": [ "167.51", @@ -2827,17 +2827,17 @@ TABLE dist2_xdec RESULTS: "0.09", "0.24", "1890.28", - "90.15", + "90.33", "10.39", "77.13", - "1733.39", + "1733.20", "1328.12", - "3061.50", + "3061.32", "0.00", "-6506.40", "-6506.40", "15954.52", - "12893.02" + "12893.20" ], "Top 1%_2": [ "1.68", @@ -2853,16 +2853,16 @@ TABLE dist2_xdec RESULTS: "0.02", "0.17", "464.26", - "0.09", + "0.15", "8.69", "0.00", - "472.87", + "472.80", "71.36", - "544.23", + "544.16", "0.00", "-58.97", "-58.97", "1690.93", - "1146.70" + "1146.77" ] } diff --git a/taxcalc/tests/tbi_puf_expect.txt b/taxcalc/tests/tbi_puf_expect.txt index d7a0e3f31..35be25ce4 100644 --- a/taxcalc/tests/tbi_puf_expect.txt +++ b/taxcalc/tests/tbi_puf_expect.txt @@ -1,13 +1,13 @@ TABLE aggr_1 RESULTS: { - "combined_tax_2": "2954.86", - "ind_tax_2": "1696.11", + "combined_tax_2": "2954.59", + "ind_tax_2": "1695.83", "payroll_tax_2": "1258.76" } TABLE aggr_2 RESULTS: { - "combined_tax_2": "3237.16", - "ind_tax_2": "1978.40", + "combined_tax_2": "3236.88", + "ind_tax_2": "1978.12", "payroll_tax_2": "1258.76" } TABLE aggr_d RESULTS: @@ -1364,7 +1364,7 @@ TABLE dist1_xbin RESULTS: "403.25", "39.88", "3.29", - "2.68", + "2.69", "363.99", "419.01", "783.00", @@ -1414,17 +1414,17 @@ TABLE dist1_xbin RESULTS: "0.33", "2.53", "444.04", - "17.30", + "17.53", "6.07", "0.02", - "432.79", + "432.56", "265.17", - "697.96", + "697.73", "0.00", "44.18", "44.18", "2990.29", - "2292.33" + "2292.55" ], "$30-40K_2": [ "15.90", @@ -1468,15 +1468,15 @@ TABLE dist1_xbin RESULTS: "27.00", "7.11", "0.60", - "8.69", - "11.80", + "8.70", + "11.79", "56.59", - "68.39", + "68.38", "0.00", "118.39", "118.39", "617.74", - "549.35" + "549.36" ], "$50-75K_2": [ "23.78", @@ -1497,7 +1497,7 @@ TABLE dist1_xbin RESULTS: "8.20", "62.61", "143.25", - "205.87", + "205.86", "0.00", "181.38", "181.38", @@ -1518,17 +1518,17 @@ TABLE dist1_xbin RESULTS: "0.16", "1.44", "226.63", - "5.26", + "5.29", "6.83", "0.00", - "228.21", + "228.18", "52.78", - "280.98", + "280.95", "0.00", "12.38", "12.38", "1162.04", - "881.06" + "881.09" ], "$75-100K_2": [ "15.93", @@ -1546,8 +1546,8 @@ TABLE dist1_xbin RESULTS: "112.10", "15.81", "0.81", - "1.86", - "95.23", + "1.87", + "95.22", "142.25", "237.48", "0.00", @@ -1648,17 +1648,17 @@ TABLE dist1_xbin RESULTS: "0.72", "20.24", "1896.31", - "126.45", + "126.71", "45.48", - "119.23", - "1696.11", + "119.25", + "1695.83", "1258.76", - "2954.86", + "2954.59", "0.00", "1082.59", "1082.59", "14992.94", - "12038.08" + "12038.35" ] } TABLE dist1_xdec RESULTS: @@ -1835,15 +1835,15 @@ TABLE dist1_xdec RESULTS: "23.38", "7.35", "0.34", - "19.72", + "19.73", "-3.35", "61.29", - "57.94", + "57.93", "0.00", "149.41", "149.41", "665.75", - "607.80" + "607.81" ], "50-60_2": [ "17.77", @@ -1862,7 +1862,7 @@ TABLE dist1_xdec RESULTS: "12.84", "0.80", "9.47", - "22.25", + "22.24", "85.09", "107.33", "0.00", @@ -1913,15 +1913,15 @@ TABLE dist1_xdec RESULTS: "140.10", "18.60", "0.89", - "2.01", + "2.02", "120.38", "173.38", - "293.77", + "293.76", "0.00", "140.66", "140.66", "1670.66", - "1376.89" + "1376.90" ], "80-90_2": [ "17.75", @@ -1963,17 +1963,17 @@ TABLE dist1_xdec RESULTS: "0.63", "19.86", "1340.57", - "42.92", + "43.18", "39.88", "0.52", - "1337.02", + "1336.76", "455.12", - "1792.14", + "1791.88", "0.00", "96.57", "96.57", "7231.85", - "5439.71" + "5439.97" ], "90-95_2": [ "8.87", @@ -1989,17 +1989,17 @@ TABLE dist1_xdec RESULTS: "0.03", "0.18", "216.03", - "14.59", + "14.63", "1.35", "0.51", - "202.28", + "202.24", "185.61", - "387.89", + "387.85", "0.00", "48.93", "48.93", "1772.06", - "1384.17" + "1384.21" ], "95-99_2": [ "7.10", @@ -2015,17 +2015,17 @@ TABLE dist1_xdec RESULTS: "0.40", "3.06", "406.43", - "13.46", + "13.68", "7.58", "0.01", - "400.54", + "400.32", "196.17", - "596.70", + "596.49", "0.00", "32.76", "32.76", "2516.12", - "1919.41" + "1919.63" ], "ALL_2": [ "177.52", @@ -2041,17 +2041,17 @@ TABLE dist1_xdec RESULTS: "0.72", "20.24", "1896.31", - "126.45", + "126.71", "45.48", - "119.23", - "1696.11", + "119.25", + "1695.83", "1258.76", - "2954.86", + "2954.59", "0.00", "1082.59", "1082.59", "14992.94", - "12038.08" + "12038.35" ], "Top 1%_2": [ "1.78", @@ -2067,12 +2067,12 @@ TABLE dist1_xdec RESULTS: "0.20", "16.63", "718.11", - "14.86", + "14.87", "30.96", "0.00", "734.20", "73.35", - "807.55", + "807.54", "0.00", "14.87", "14.87", @@ -2150,10 +2150,10 @@ TABLE dist2_xbin RESULTS: "491.05", "39.88", "3.29", - "2.68", - "451.79", + "2.69", + "451.78", "419.01", - "870.80", + "870.79", "0.00", "196.10", "196.10", @@ -2200,17 +2200,17 @@ TABLE dist2_xbin RESULTS: "0.03", "0.68", "573.07", - "17.30", + "17.53", "6.07", "0.02", - "561.82", + "561.59", "265.17", - "826.99", + "826.76", "0.00", "44.18", "44.18", "2990.29", - "2163.30" + "2163.53" ], "$30-40K_2": [ "15.90", @@ -2254,15 +2254,15 @@ TABLE dist2_xbin RESULTS: "27.00", "7.11", "0.60", - "8.69", - "11.80", + "8.70", + "11.79", "56.59", - "68.39", + "68.38", "0.00", "118.39", "118.39", "617.74", - "549.35" + "549.36" ], "$50-75K_2": [ "23.78", @@ -2304,17 +2304,17 @@ TABLE dist2_xbin RESULTS: "0.03", "0.68", "257.01", - "5.26", + "5.29", "6.83", "0.00", - "258.59", + "258.56", "52.78", - "311.37", + "311.33", "0.00", "12.38", "12.38", "1162.04", - "850.68" + "850.71" ], "$75-100K_2": [ "15.93", @@ -2332,8 +2332,8 @@ TABLE dist2_xbin RESULTS: "126.98", "15.81", "0.81", - "1.86", - "110.11", + "1.87", + "110.10", "142.25", "252.36", "0.00", @@ -2411,7 +2411,7 @@ TABLE dist2_xbin RESULTS: "11.93", "26.18", "0.00", - "590.24", + "590.23", "40.61", "630.84", "0.00", @@ -2434,17 +2434,17 @@ TABLE dist2_xbin RESULTS: "0.20", "16.52", "2177.32", - "126.46", + "126.72", "45.48", - "119.23", - "1977.11", + "119.25", + "1976.83", "1258.76", - "3235.86", + "3235.59", "0.00", "1082.59", "1082.59", "14992.94", - "11757.08" + "11757.35" ] } TABLE dist2_xdec RESULTS: @@ -2621,15 +2621,15 @@ TABLE dist2_xdec RESULTS: "23.38", "7.35", "0.34", - "19.72", + "19.73", "-3.35", "61.29", - "57.94", + "57.93", "0.00", "149.41", "149.41", "665.75", - "607.80" + "607.81" ], "50-60_2": [ "17.77", @@ -2699,15 +2699,15 @@ TABLE dist2_xdec RESULTS: "159.09", "18.60", "0.89", - "2.01", - "139.37", + "2.02", + "139.36", "173.38", - "312.75", + "312.74", "0.00", "140.66", "140.66", "1670.66", - "1357.90" + "1357.91" ], "80-90_2": [ "17.75", @@ -2733,7 +2733,7 @@ TABLE dist2_xdec RESULTS: "123.76", "123.76", "2438.05", - "1896.33" + "1896.34" ], "90-100_2": [ "17.76", @@ -2749,17 +2749,17 @@ TABLE dist2_xdec RESULTS: "0.12", "16.19", "1544.93", - "42.93", + "43.19", "39.88", "0.52", - "1541.37", + "1541.11", "455.12", - "1996.49", + "1996.23", "0.00", "96.57", "96.57", "7231.85", - "5235.37" + "5235.62" ], "90-95_2": [ "8.87", @@ -2775,17 +2775,17 @@ TABLE dist2_xdec RESULTS: "0.00", "0.12", "279.77", - "14.59", + "14.63", "1.35", "0.51", - "266.02", + "265.98", "185.61", - "451.63", + "451.59", "0.00", "48.93", "48.93", "1772.06", - "1320.43" + "1320.47" ], "95-99_2": [ "7.10", @@ -2801,17 +2801,17 @@ TABLE dist2_xdec RESULTS: "0.03", "0.85", "514.36", - "13.46", + "13.68", "7.58", "0.01", - "508.46", + "508.25", "196.17", - "704.63", + "704.42", "0.00", "32.76", "32.76", "2516.12", - "1811.49" + "1811.70" ], "ALL_2": [ "177.52", @@ -2827,17 +2827,17 @@ TABLE dist2_xdec RESULTS: "0.20", "16.51", "2177.34", - "126.46", + "126.72", "45.48", - "119.23", - "1977.13", + "119.25", + "1976.85", "1258.76", - "3235.89", + "3235.61", "0.00", "1082.59", "1082.59", "14992.94", - "11757.06" + "11757.33" ], "Top 1%_2": [ "1.78", @@ -2853,7 +2853,7 @@ TABLE dist2_xdec RESULTS: "0.10", "15.21", "750.80", - "14.87", + "14.88", "30.96", "0.00", "766.88", @@ -2863,6 +2863,6 @@ TABLE dist2_xdec RESULTS: "14.87", "14.87", "2943.67", - "2103.44" + "2103.45" ] } diff --git a/taxcalc/tests/test_cpscsv.py b/taxcalc/tests/test_cpscsv.py index d983b2c59..cb40885b9 100644 --- a/taxcalc/tests/test_cpscsv.py +++ b/taxcalc/tests/test_cpscsv.py @@ -71,7 +71,7 @@ def test_agg(tests_path, cps_fullsample): msg = '' for cyr in range(calc_start_year, calc_start_year + nyrs): if cyr == calc_start_year: - reltol = 0.014 + reltol = 0.0141 else: reltol = 0.007 if not np.allclose(taxes_subsample[cyr], taxes_fullsample[cyr], diff --git a/taxcalc/tests/test_policy.py b/taxcalc/tests/test_policy.py index 232484cbf..ed0fb8f70 100644 --- a/taxcalc/tests/test_policy.py +++ b/taxcalc/tests/test_policy.py @@ -953,3 +953,13 @@ def test_indexing_rates_for_update(): wgrates = pol._indexing_rates_for_update('_SS_Earnings_c', 2017, 10) pirates = pol._indexing_rates_for_update('_II_em', 2017, 10) assert len(wgrates) == len(pirates) + + +def test_reform_with_cpi_offset(): + """ + Implement a reform that includes the _cpi_offset policy parameter. + """ + indexing_reform = {2020: {'_cpi_offset': [-0.0025]}} + pol = Policy() # current-law policy + pol.implement_reform(indexing_reform) + assert not pol.parameter_errors diff --git a/taxcalc/tests/test_reforms.py b/taxcalc/tests/test_reforms.py index 9e43c1e70..41bf40968 100644 --- a/taxcalc/tests/test_reforms.py +++ b/taxcalc/tests/test_reforms.py @@ -14,6 +14,7 @@ from taxcalc import nonsmall_diffs +@pytest.mark.pre_release def test_reform_json_and_output(tests_path): """ Check that each JSON reform file can be converted into a reform dictionary @@ -67,8 +68,14 @@ def res_and_out_are_same(base): with open(base + '.out') as outfile: exp_res = outfile.read() # check to see if act_res & exp_res have differences - return not nonsmall_diffs(act_res.splitlines(True), - exp_res.splitlines(True)) + diffs = nonsmall_diffs(act_res.splitlines(True), + exp_res.splitlines(True), small=1) + dump = True + if dump and diffs: + print('{} ACTUAL:\n{}', base, act_res) + print('{} EXPECT:\n{}', base, exp_res) + return not diffs + # specify Records object containing cases data tax_year = 2020 cases_path = os.path.join(tests_path, '..', 'reforms', 'cases.csv') diff --git a/taxcalc/validation/taxsim/README.md b/taxcalc/validation/taxsim/README.md index 4d20b487e..26bffba98 100644 --- a/taxcalc/validation/taxsim/README.md +++ b/taxcalc/validation/taxsim/README.md @@ -42,8 +42,11 @@ Validation Results **2018-12-17** : Same results for a 2017 INPUT file that specifies the first twelve of the TAXSIM-27 input variables, which include demographic variables and labor income, but set to zero all -the TAXSIM-27 input variables numbered from 13 through 27. (This is -the a17 assumption set.) +the TAXSIM-27 input variables numbered from 13 through 27. This is +the **a17** assumption set. + +Reran the a17 test with same results on 2019-01-29 with the newest +version of TAXSIM-27. **2018-12-17** : Same results for a 2017 INPUT file that specifies the first twenty-one of the TAXSIM-27 input variables, which include @@ -54,8 +57,14 @@ because they specify trasfer income that is not taxed under the federal income tax or because they specify rent paid that does not affect federal income tax liability. Three of the remaining four input variables are itemized expense amounts and the fourth is -child-care expenses. (This is the b17 assumption set.) +child-care expenses. This is the **b17** assumption set. +Reran the b17 test with same results on 2019-01-29 with the newest +version of TAXSIM-27. + **2018-12-17** : Same results for a 2017 INPUT file that specifies all the non-state TAXSIM-27 input variables to be randomly generated -values. (This is the c17 assumption set.) +values. This is the **c17** assumption set. + +Reran the c17 test with same results on 2019-01-29 with the newest +version of TAXSIM-27. diff --git a/taxcalc/validation/taxsim/a18.taxdiffs-expect b/taxcalc/validation/taxsim/a18.taxdiffs-expect index 0216846da..81f6fa4cf 100644 --- a/taxcalc/validation/taxsim/a18.taxdiffs-expect +++ b/taxcalc/validation/taxsim/a18.taxdiffs-expect @@ -1,6 +1,5 @@ TAXDIFF:ovar= 6 no-diffs -TAXDIFF:ovar,#diffs,#smdiffs,maxdiff[id]= 7 4513 0 22.00 [9688] - #big_vardiffs_with_big_inctax_diff= 4440 +TAXDIFF:ovar= 7 no-diffs TAXDIFF:ovar,#diffs,#smdiffs,maxdiff[id]= 9 124 0 0.90 [173] #big_vardiffs_with_big_inctax_diff= 8 TAXDIFF:ovar= 10 no-diffs @@ -11,17 +10,17 @@ TAXDIFF:ovar= 15 no-diffs TAXDIFF:ovar= 16 no-diffs TAXDIFF:ovar= 17 no-diffs TAXDIFF:ovar,#diffs,#smdiffs,maxdiff[id]= 18 14799 0 52.76 [28551] - #big_vardiffs_with_big_inctax_diff= 13545 -TAXDIFF:ovar,#diffs,#smdiffs,maxdiff[id]= 22 32307 0 2500.00 [77] - #big_vardiffs_with_big_inctax_diff= 13964 -TAXDIFF:ovar,#diffs,#smdiffs,maxdiff[id]= 23 2903 2 1500.00 [10677] - #big_vardiffs_with_big_inctax_diff= 2901 + #big_vardiffs_with_big_inctax_diff= 13517 +TAXDIFF:ovar,#diffs,#smdiffs,maxdiff[id]= 22 5028 0 6.33 [1681] + #big_vardiffs_with_big_inctax_diff= 5000 +TAXDIFF:ovar,#diffs,#smdiffs,maxdiff[id]= 23 1193 0 -6.33 [147] + #big_vardiffs_with_big_inctax_diff= 1193 TAXDIFF:ovar= 24 no-diffs TAXDIFF:ovar,#diffs,#smdiffs,maxdiff[id]= 25 10918 45 13.21 [56] #big_vardiffs_with_big_inctax_diff= 10873 TAXDIFF:ovar= 26 no-diffs TAXDIFF:ovar= 27 no-diffs TAXDIFF:ovar,#diffs,#smdiffs,maxdiff[id]= 28 14799 0 9.23 [93] - #big_vardiffs_with_big_inctax_diff= 13545 -TAXDIFF:ovar,#diffs,#smdiffs,maxdiff[id]= 4 22646 46 2409.23 [8903] - #big_inctax_diffs= 22600 + #big_vardiffs_with_big_inctax_diff= 13517 +TAXDIFF:ovar,#diffs,#smdiffs,maxdiff[id]= 4 18422 45 -13.21 [242] + #big_inctax_diffs= 18377 diff --git a/taxcalc/validation/taxsim/output-taxsim.zip b/taxcalc/validation/taxsim/output-taxsim.zip index f30aa4e9e..b3fc3b418 100644 Binary files a/taxcalc/validation/taxsim/output-taxsim.zip and b/taxcalc/validation/taxsim/output-taxsim.zip differ diff --git a/taxcalc/validation/taxsim/process_taxcalc_output.py b/taxcalc/validation/taxsim/process_taxcalc_output.py index 723500b84..60d13a3a1 100644 --- a/taxcalc/validation/taxsim/process_taxcalc_output.py +++ b/taxcalc/validation/taxsim/process_taxcalc_output.py @@ -121,8 +121,8 @@ def extract_output(out): ovar[19] = out['taxbc'] ovar[20] = 0.0 # always set exemption surtax to zero ovar[21] = 0.0 # always set general tax credit to zero - ovar[22] = out['c07220'] + out['dep_credit'] # child tax credit - ovar[23] = out['c11070'] # additional child tax credit + ovar[22] = out['c07220'] # non-refundable child tax credit + ovar[23] = out['c11070'] # refundable additional child tax credit ovar[24] = out['c07180'] # child care credit ovar[25] = out['eitc'] # federal EITC ovar[26] = out['c62100'] # federal AMT taxable income