Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nonrefundable credits to state dependent exemption reform #5404

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- bump: minor
changes:
added:
- Add non-refundable credits to state dependent exemption reform.
76 changes: 41 additions & 35 deletions docs/usage/structural_reform_dating.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,30 +38,33 @@
"from policyengine_us import Microsimulation\n",
"from policyengine_core.reforms import Reform\n",
"\n",
"reform_1 = Reform.from_dict({\n",
" \"gov.contrib.salt_phase_out.in_effect\": {\n",
" \"2024-01-01.2100-12-31\": True\n",
" },\n",
" \"gov.contrib.salt_phase_out.rate.joint[1].rate\": {\n",
" \"2024-01-01.2100-12-31\": 0.001\n",
" },\n",
" \"gov.contrib.salt_phase_out.rate.joint[1].threshold\": {\n",
" \"2024-01-01.2100-12-31\": 200000\n",
" },\n",
" \"gov.contrib.salt_phase_out.rate.other[1].rate\": {\n",
" \"2024-01-01.2100-12-31\": 0.001\n",
" },\n",
" \"gov.contrib.salt_phase_out.rate.other[1].threshold\": {\n",
" \"2024-01-01.2100-12-31\": 400000\n",
" }\n",
"}, country_id=\"us\")\n",
"reform_1 = Reform.from_dict(\n",
" {\n",
" \"gov.contrib.salt_phase_out.in_effect\": {\n",
" \"2024-01-01.2100-12-31\": True\n",
" },\n",
" \"gov.contrib.salt_phase_out.rate.joint[1].rate\": {\n",
" \"2024-01-01.2100-12-31\": 0.001\n",
" },\n",
" \"gov.contrib.salt_phase_out.rate.joint[1].threshold\": {\n",
" \"2024-01-01.2100-12-31\": 200000\n",
" },\n",
" \"gov.contrib.salt_phase_out.rate.other[1].rate\": {\n",
" \"2024-01-01.2100-12-31\": 0.001\n",
" },\n",
" \"gov.contrib.salt_phase_out.rate.other[1].threshold\": {\n",
" \"2024-01-01.2100-12-31\": 400000\n",
" },\n",
" },\n",
" country_id=\"us\",\n",
")\n",
"\n",
"\n",
"baseline_sim_1 = Microsimulation()\n",
"reformed_sim_1 = Microsimulation(reform=reform_1)\n",
"baseline_salt_1 = baseline_sim_1.calculate(\"salt_deduction\", period=2026)\n",
"reformed_salt_1 = reformed_sim_1.calculate(\"salt_deduction\", period=2026)\n",
"print(f\"Diff: {reformed_salt_1.sum() - baseline_salt_1.sum()}\")\n"
"print(f\"Diff: {reformed_salt_1.sum() - baseline_salt_1.sum()}\")"
]
},
{
Expand Down Expand Up @@ -95,23 +98,26 @@
"from policyengine_us import Microsimulation\n",
"from policyengine_core.reforms import Reform\n",
"\n",
"reform_2 = Reform.from_dict({\n",
" \"gov.contrib.salt_phase_out.in_effect\": {\n",
" \"2026-01-01.2100-12-31\": True\n",
" },\n",
" \"gov.contrib.salt_phase_out.rate.joint[1].rate\": {\n",
" \"2026-01-01.2100-12-31\": 0.001\n",
" },\n",
" \"gov.contrib.salt_phase_out.rate.joint[1].threshold\": {\n",
" \"2026-01-01.2100-12-31\": 200000\n",
" },\n",
" \"gov.contrib.salt_phase_out.rate.other[1].rate\": {\n",
" \"2026-01-01.2100-12-31\": 0.001\n",
" },\n",
" \"gov.contrib.salt_phase_out.rate.other[1].threshold\": {\n",
" \"2026-01-01.2100-12-31\": 400000\n",
" }\n",
"}, country_id=\"us\")\n",
"reform_2 = Reform.from_dict(\n",
" {\n",
" \"gov.contrib.salt_phase_out.in_effect\": {\n",
" \"2026-01-01.2100-12-31\": True\n",
" },\n",
" \"gov.contrib.salt_phase_out.rate.joint[1].rate\": {\n",
" \"2026-01-01.2100-12-31\": 0.001\n",
" },\n",
" \"gov.contrib.salt_phase_out.rate.joint[1].threshold\": {\n",
" \"2026-01-01.2100-12-31\": 200000\n",
" },\n",
" \"gov.contrib.salt_phase_out.rate.other[1].rate\": {\n",
" \"2026-01-01.2100-12-31\": 0.001\n",
" },\n",
" \"gov.contrib.salt_phase_out.rate.other[1].threshold\": {\n",
" \"2026-01-01.2100-12-31\": 400000\n",
" },\n",
" },\n",
" country_id=\"us\",\n",
")\n",
"\n",
"\n",
"baseline_sim_2 = Microsimulation(start_instant=\"2026-01-01\")\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ metadata:
- title: 2023 Nebraska Individual Income Tax Booklet
href: https://revenue.nebraska.gov/sites/revenue.nebraska.gov/files/doc/tax-forms/2023/incometax/f_1040n_booklet_2023_Final.pdf#page=19
- title: Nebraska Revised Statute 77-2716 (15)(a)
href: https://nebraskalegislature.gov/laws/statutes.php?statute=77-2716
href: https://nebraskalegislature.gov/laws/statutes.php?statute=77-2716
9 changes: 9 additions & 0 deletions policyengine_us/reforms/state_dependent_exemptions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,12 @@ Vermont: Remove the dependents from the personal exemptions
Virginia: Only apply the personal exemptions to the head and spouse
West Virginia: Change the `tax_unit_size` to `head_spouse_count`
Wisconsin: Change the `tax_unit_size` to `head_spouse_count`
Arizona: Neutralize dependent exemptions
Arkansas: Neutralize dependent exemptions
Delaware: Change the `tax_unit_size` to `head_spouse_count`
Idaho: Neutralize dependent exemptions CTC
Iowa: Change the `tax_unit_size` to `head_spouse_count`
Kentucky: Change the `tax_unit_size` in family_size to `head_spouse_count`
Maine: Neutralize dependent exemptions
Nebraska: Change the `tax_unit_size` to `head_spouse_count`
Oklahoma: Remove CTC portion and update return
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from policyengine_us.model_api import *
from policyengine_core.periods import period as period_


def create_repeal_state_dependent_exemptions() -> Reform:
Expand Down Expand Up @@ -392,6 +393,75 @@ def formula(tax_unit, period, parameters):
p = parameters(period).gov.states.wi.tax.income
return tax_unit("head_spouse_count", period) * p.exemption.base

class de_personal_credit(Variable):
value_type = float
entity = TaxUnit
label = "Delaware personal credit"
unit = USD
definition_period = YEAR
reference = "https://revenuefiles.delaware.gov/2022/PIT-RES_TY22_2022-02_Instructions.pdf"
defined_for = StateCode.DE

def formula(tax_unit, period, parameters):
p = parameters(period).gov.states.de.tax.income.credits
head_spouse_count = tax_unit("head_spouse_count", period)
return p.personal_credits.personal * head_spouse_count

class ky_family_size_tax_credit_rate(Variable):
value_type = float
entity = TaxUnit
label = "Kentucky family size tax credit rate"
unit = "/1"
definition_period = YEAR
reference = "https://apps.legislature.ky.gov/law/statutes/statute.aspx?id=49188"
defined_for = StateCode.KY

def formula(tax_unit, period, parameters):
income = tax_unit("ky_modified_agi", period)
fpg = parameters(period).gov.hhs.fpg
# This will be CONTIGUOUS_US for Kentucky.
state_group = tax_unit.household("state_group", period)
p1 = fpg.first_person[state_group]
padd = fpg.additional_person[state_group]
family_size = tax_unit("head_spouse_count", period)
# No more than 4 people are accounted for in the credit
p = parameters(period).gov.states.ky.tax.income.credits.family_size
capped_family_size = min_(family_size, p.family_size_cap)
poverty_index = p1 + padd * (capped_family_size - 1)
share = income / poverty_index
return p.rate.calc(share, right=True)

class ok_child_care_child_tax_credit(Variable):
value_type = float
entity = TaxUnit
label = "Oklahoma Child Care/Child Tax Credit"
unit = USD
definition_period = YEAR
reference = (
"https://oklahoma.gov/content/dam/ok/en/tax/documents/forms/individuals/past-year/2021/511-Pkt-2021.pdf"
"https://oklahoma.gov/content/dam/ok/en/tax/documents/forms/individuals/current/511-Pkt.pdf"
)
defined_for = StateCode.OK

def formula(tax_unit, period, parameters):
p = parameters(period).gov.states.ok.tax.income.credits
# determine AGI eligibility
us_agi = tax_unit("adjusted_gross_income", period)
agi_eligible = us_agi <= p.child.agi_limit
# determine OK cdcc amount
us_cdcc = tax_unit("cdcc", period)
ok_cdcc = us_cdcc * p.child.cdcc_fraction
# determine prorated fraction
ok_agi = tax_unit("ok_agi", period)
# Compute OK AGI as a share of US AGI.
# Use a mask rather than where to avoid a divide-by-zero warning.
agi_ratio = np.zeros_like(us_agi)
mask = us_agi != 0
agi_ratio[mask] = ok_agi[mask] / us_agi[mask]
prorate = min_(1, max_(0, agi_ratio))
# receive greater of OK cdcc or OK ctc amounts prorated if AGI eligible
return agi_eligible * prorate * ok_cdcc

class reform(Reform):
def apply(self):
self.neutralize_variable("al_dependent_exemption")
Expand All @@ -406,6 +476,10 @@ def apply(self):
self.neutralize_variable("nc_child_deduction")
self.neutralize_variable("nm_deduction_for_certain_dependents")
self.neutralize_variable("mt_dependent_exemptions_person")
self.neutralize_variable("az_dependent_tax_credit")
self.neutralize_variable("ar_personal_credit_dependent")
self.neutralize_variable("id_ctc")
self.neutralize_variable("me_dependent_exemption_credit")
self.update_variable(hi_regular_exemptions)
self.update_variable(md_total_personal_exemptions)
self.update_variable(mi_personal_exemptions)
Expand All @@ -419,10 +493,13 @@ def apply(self):
self.update_variable(ca_exemptions)
self.update_variable(ga_exemptions)
self.update_variable(in_base_exemptions)
self.update_variable(ia_exemption_credit)
self.update_variable(ks_count_exemptions)
self.update_variable(ma_income_tax_exemption_threshold)
self.update_variable(wi_base_exemption)
self.update_variable(ia_exemption_credit)
self.update_variable(de_personal_credit)
self.update_variable(ky_family_size_tax_credit_rate)
self.update_variable(ok_child_care_child_tax_credit)

return reform

Expand All @@ -433,9 +510,18 @@ def create_repeal_state_dependent_exemptions_reform(
if bypass:
return create_repeal_state_dependent_exemptions()

p = parameters(period).gov.contrib.repeal_state_dependent_exemptions
p = parameters.gov.contrib.repeal_state_dependent_exemptions

reform_active = False
current_period = period_(period)

for i in range(5):
if p(current_period).in_effect:
reform_active = True
break
current_period = current_period.offset(1, "year")

if p.in_effect:
if reform_active:
return create_repeal_state_dependent_exemptions()
else:
return None
Expand Down
Loading