From 2ddb4a13601f44e86a2b99c2faf7a36f27a5bada Mon Sep 17 00:00:00 2001 From: martinholmer Date: Mon, 26 Mar 2018 15:16:35 -0400 Subject: [PATCH 1/2] Streamline calculation of dependent credit --- taxcalc/calculate.py | 6 ++-- taxcalc/current_law_policy.json | 44 ++++++------------------- taxcalc/functions.py | 45 +++++++++++++------------- taxcalc/records_variables.json | 2 +- taxcalc/reforms/RyanBrady.json | 6 ++-- taxcalc/reforms/TCJA_House.out | 6 ++-- taxcalc/reforms/TCJA_House_Amended.out | 6 ++-- taxcalc/tests/reforms.json | 4 +-- 8 files changed, 49 insertions(+), 70 deletions(-) diff --git a/taxcalc/calculate.py b/taxcalc/calculate.py index 6fb82c1bb..ec066dbef 100644 --- a/taxcalc/calculate.py +++ b/taxcalc/calculate.py @@ -20,8 +20,8 @@ DependentCare, ALD_InvInc_ec_base, CapGains, SSBenefits, UBI, AGI, ItemDedCap, ItemDed, StdDed, AdditionalMedicareTax, F2441, EITC, - SchR, ChildTaxCredit, AdditionalCTC, CTC_new, - PersonalTaxCredit, + ChildDepTaxCredit, AdditionalCTC, CTC_new, + PersonalTaxCredit, SchR, AmOppCreditParts, EducationTaxCredit, NonrefundableCredits, C1040, IITAX, BenefitSurtax, BenefitLimitation, @@ -1420,7 +1420,7 @@ def _calc_one_year(self, zero_out_calc_vars=False): self._taxinc_to_amt() F2441(self.__policy, self.__records) EITC(self.__policy, self.__records) - ChildTaxCredit(self.__policy, self.__records) + ChildDepTaxCredit(self.__policy, self.__records) PersonalTaxCredit(self.__policy, self.__records) AmOppCreditParts(self.__policy, self.__records) SchR(self.__policy, self.__records) diff --git a/taxcalc/current_law_policy.json b/taxcalc/current_law_policy.json index 03cf0c5b7..b1ae6f392 100644 --- a/taxcalc/current_law_policy.json +++ b/taxcalc/current_law_policy.json @@ -5118,37 +5118,13 @@ "compatible_data": {"puf": true, "cps": true} }, - "_DependentCredit_c": { - "long_name": "Nonrefundable credit for dependents", - "description": "This nonrefundable credit is applied to (child and non-child) dependents and phases out with the Child Tax Credit. The dependent credit's phaseout begins when the CTC's phaseout ends.", - "section_1": "Nonrefundable Credits", - "section_2": "Child Tax Credit", - "irs_ref": "", - "notes": "The Ryan-Brady tax proposal sets this at $500", - "row_var": "FLPDYR", - "row_label": ["2013"], - "start_year": 2013, - "cpi_inflatable": true, - "cpi_inflated": false, - "col_var": "", - "col_label": "", - "boolean_value": false, - "integer_value": false, - "value": [0.0], - "range": {"min": 0, "max": 9e99}, - "out_of_range_minmsg": "", - "out_of_range_maxmsg": "", - "out_of_range_action": "stop", - "compatible_data": {"puf": true, "cps": true} - }, - "_DependentCredit_Child_c": { - "long_name": "Nonrefundable credit for children, on top of the child tax credit", - "description": "This nonrefundable credit is applied to children and phases out with the Child Tax Credit. The dependent credit's phaseout begins when the CTC's phaseout ends.", + "long_name": "Nonrefundable credit for child dependents on top of the child tax credit", + "description": "This nonrefundable credit is applied to child dependents and begins phasing out after the CTC phaseout ends.", "section_1": "Nonrefundable Credits", "section_2": "Child Tax Credit", "irs_ref": "", - "notes": "First introduced in TCJA bills", + "notes": "Become current-law policy with passage of TCJA", "row_var": "FLPDYR", "row_label": ["2013", "2014", @@ -5193,12 +5169,12 @@ }, "_DependentCredit_Nonchild_c": { - "long_name": "Nonrefundable credit for non-child dependents", - "description": "This nonrefundable credit is applied to non-child dependents and phases out with the Child Tax Credit. The dependent credit's phaseout begins when the CTC's phaseout ends.", + "long_name": "Nonrefundable credit for non-child dependents on top of the child tax credit", + "description": "This nonrefundable credit is applied to non-child dependents and begins phasing out after the CTC phaseout ends.", "section_1": "Nonrefundable Credits", "section_2": "Child Tax Credit", "irs_ref": "", - "notes": "First introduced in TCJA bills", + "notes": "Become current-law policy with passage of TCJA", "row_var": "FLPDYR", "row_label": ["2013", "2014", @@ -5244,11 +5220,11 @@ "_DependentCredit_before_CTC": { "long_name": "Stack the Dependent Credit before the Child Tax Credit", - "description": "Stack the draw down of the Dependent Credit against liabilities before the drawdown of the Child Tax Credit.", + "description": "Place the drawdown of the nonrefundable Dependent Credit against tax liability before the drawdown of the Child Tax Credit.", "section_1": "Nonrefundable Credits", "section_2": "Child Tax Credit", "irs_ref": "", - "notes": "", + "notes": "Become part of current-law policy with passage of TCJA", "row_var": "FLPDYR", "row_label": ["2013", "2014", @@ -5277,8 +5253,8 @@ }, "_FilerCredit_c": { - "long_name": "Nonrefundable credit for filer and spouse", - "description": "This nonrefundable credit is applied to the filer and spouse and phases out with the Child Tax Credit. The filer credit's phaseout begins when the CTC's phaseout ends.", + "long_name": "Nonrefundable credit for each filing unit", + "description": "This nonrefundable credit is applied to the filing unit and begins phasing out after the CTC phaseout ends.", "section_1": "Nonrefundable Credits", "section_2": "Child Tax Credit", "irs_ref": "", diff --git a/taxcalc/functions.py b/taxcalc/functions.py index 99c8f04a9..d993151da 100644 --- a/taxcalc/functions.py +++ b/taxcalc/functions.py @@ -1,3 +1,4 @@ + """ Tax-Calculator functions that calculate payroll and individual income taxes. @@ -1210,34 +1211,34 @@ def EITC(MARS, DSI, EIC, c00100, e00300, e00400, e00600, c01000, @iterate_jit(nopython=True) -def ChildTaxCredit(n24, MARS, c00100, exact, - CTC_c, CTC_ps, CTC_prt, prectc, nu05, - CTC_c_under5_bonus, XTOT, num, - DependentCredit_Child_c, DependentCredit_Nonchild_c, - DependentCredit_c, FilerCredit_c, dep_credit): - """ - Computes prectc amount and dependent credit. - """ - # calculate prectc amount - prectc = CTC_c * n24 + CTC_c_under5_bonus * nu05 - modAGI = c00100 # no deducted foreign earned income to add - if modAGI > CTC_ps[MARS - 1]: +def ChildDepTaxCredit(n24, MARS, c00100, exact, + CTC_c, CTC_ps, CTC_prt, prectc, nu05, + CTC_c_under5_bonus, XTOT, num, + 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 - dep_credit = (DependentCredit_c * max(0, XTOT - num) + - DependentCredit_Child_c * n24 + + # 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 CTC_prt > 0. and c00100 > CTC_ps[MARS - 1]: - thresh = CTC_ps[MARS - 1] + n24 * CTC_c / CTC_prt - excess = c00100 - thresh - if exact == 1: # exact calculation as on tax forms - excess = 1000. * math.ceil(excess / 1000.) - dep_phaseout = CTC_prt * (c00100 - excess) - dep_credit = max(0., dep_credit - dep_phaseout) + if dep_credit > 0. and CTC_prt > 0.: + thresh = CTC_ps[MARS - 1] + base_ctc / CTC_prt + if modAGI > thresh: + excess = modAGI - thresh + 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) diff --git a/taxcalc/records_variables.json b/taxcalc/records_variables.json index ade4c4b9f..29f502145 100644 --- a/taxcalc/records_variables.json +++ b/taxcalc/records_variables.json @@ -966,7 +966,7 @@ }, "dep_credit": { "type": "float", - "desc": "search taxcalc/functions.py for how calculated and used", + "desc": "Dependent Credit added on top of Child Tax Credit", "form": {"2013-20??": "calculated variable"} }, "personal_refundable_credit": { diff --git a/taxcalc/reforms/RyanBrady.json b/taxcalc/reforms/RyanBrady.json index fb848a713..5eecdf88b 100644 --- a/taxcalc/reforms/RyanBrady.json +++ b/taxcalc/reforms/RyanBrady.json @@ -22,7 +22,7 @@ // - 5: _NIIT_rt // - 6: _STD // - 7: _II_em -// - 8: _DependentCredit_c +// - 8: _DependentCredit_Child_c, _DependentCredit_Nonchild_c // - 9: _CTC_ps // - 10: _ID* { @@ -73,7 +73,9 @@ {"2017": [[0, 0, 0, 0, 0]]}, "_II_em": {"2017": [0]}, - "_DependentCredit_c": + "_DependentCredit_Child_c": + {"2017": [500]}, + "_DependentCredit_Nonchild_c": {"2017": [500]}, "_CTC_ps": {"2017": [[75000, 150000, 75000, 75000, 75000]]}, diff --git a/taxcalc/reforms/TCJA_House.out b/taxcalc/reforms/TCJA_House.out index 55a8d965c..166ac42e1 100644 --- a/taxcalc/reforms/TCJA_House.out +++ b/taxcalc/reforms/TCJA_House.out @@ -8,6 +8,6 @@ 6 0 0 0 0 0 0 0 0 7 180000 0 56209 123791 14942 8942 27540 157288 8 0 0 0 0 0 0 0 0 -9 240000 0 43718 196282 27758 23008 36720 198632 -10 600000 0 37473 562527 136297 134397 66067 431850 -sums 1080000 0 168627 911373 182449 165671 139507 843855 \ No newline at end of file +9 240000 0 43718 196282 27758 22308 36720 199332 +10 600000 0 37473 562527 136297 132997 66067 433250 +sums 1080000 0 168627 911373 182449 163571 139507 845955 \ No newline at end of file diff --git a/taxcalc/reforms/TCJA_House_Amended.out b/taxcalc/reforms/TCJA_House_Amended.out index 55a8d965c..166ac42e1 100644 --- a/taxcalc/reforms/TCJA_House_Amended.out +++ b/taxcalc/reforms/TCJA_House_Amended.out @@ -8,6 +8,6 @@ 6 0 0 0 0 0 0 0 0 7 180000 0 56209 123791 14942 8942 27540 157288 8 0 0 0 0 0 0 0 0 -9 240000 0 43718 196282 27758 23008 36720 198632 -10 600000 0 37473 562527 136297 134397 66067 431850 -sums 1080000 0 168627 911373 182449 165671 139507 843855 \ No newline at end of file +9 240000 0 43718 196282 27758 22308 36720 199332 +10 600000 0 37473 562527 136297 132997 66067 433250 +sums 1080000 0 168627 911373 182449 163571 139507 845955 \ No newline at end of file diff --git a/taxcalc/tests/reforms.json b/taxcalc/tests/reforms.json index 6e2684f33..17fabebfd 100644 --- a/taxcalc/tests/reforms.json +++ b/taxcalc/tests/reforms.json @@ -618,7 +618,7 @@ "name": "Set Dependend Credit for Children at $500", "output_type": "iitax", "compare_with": {}, - "expected": "Tax-Calculator,-8.4,-8.1,-7.9,-7.6" + "expected": "Tax-Calculator,-12.4,-12.3,-12.2,-12.1" }, "57": { @@ -629,7 +629,7 @@ "name": "Set Dependend Credit for Children at $500 AND stack dependent credit before CTC", "output_type": "iitax", "compare_with": {}, - "expected": "Tax-Calculator,-14.3,-14.0,-13.8,-13.3" + "expected": "Tax-Calculator,-18.3,-18.2,-18.1,-17.8" }, "58": { From e77e3223daba03987157cc2fa9487f1e0933073c Mon Sep 17 00:00:00 2001 From: martinholmer Date: Tue, 27 Mar 2018 19:05:54 -0400 Subject: [PATCH 2/2] Revise _DependentCredit_* values in 2017_law.json file --- taxcalc/reforms/2017_law.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/taxcalc/reforms/2017_law.json b/taxcalc/reforms/2017_law.json index 8339ed242..e88c371fb 100644 --- a/taxcalc/reforms/2017_law.json +++ b/taxcalc/reforms/2017_law.json @@ -15,7 +15,7 @@ // - 1: _II_rt? and _PT_rt? // - 2: four _PT_excl_* parameters // - 3: _CTC_c and _CTC_ps and _ACTC_Income_thd -// - 4: four different _DependentCredit_* parameters +// - 4: three different _DependentCredit_* parameters // - 5: three _ALD_* parameters // - 6: seven different _ID_* parameters // NOTE: this reform projects pre-TCJA 2017 parameter values forward using the @@ -46,8 +46,7 @@ "_ACTC_Income_thd": {"2018": [3000.0]}, "_DependentCredit_Child_c": {"2018": [0.0]}, "_DependentCredit_Nonchild_c": {"2018": [0.0]}, - "_DependentCredit_Nonchild_c": {"2018": [0.0]}, - "_DependentCredit_before_CTC": {"2018": [0.0]}, + "_DependentCredit_before_CTC": {"2018": [false]}, "_ALD_AlimonyPaid_hc": {"2019": [0.0]}, "_ALD_AlimonyReceived_hc": {"2019": [1.0]}, "_ALD_DomesticProduction_hc": {"2018": [0.0]},