Skip to content

Commit

Permalink
Merge pull request #3039 from PolicyEngine/PavelMakarchuk/issue3038
Browse files Browse the repository at this point in the history
Kentucky Family Size Tax Credit
  • Loading branch information
MaxGhenis authored Sep 19, 2023
2 parents 31ea1af + dc80f29 commit 397f95c
Show file tree
Hide file tree
Showing 18 changed files with 348 additions and 39 deletions.
6 changes: 3 additions & 3 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- bump: patch
- bump: minor
changes:
fixed:
- Revert kentucky family size tax credit pull request 2908.
added:
- Kentucky family size tax credit.
41 changes: 29 additions & 12 deletions docs/examples/income-sources.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2054,9 +2054,18 @@
"\n",
"household_benefits = sim.calculate(\"household_benefits\")\n",
"household_pensions = sim.calculate(\"pension_income\", map_to=\"household\")\n",
"household_investment_income = sim.calculate(\"net_investment_income\", map_to=\"household\")\n",
"household_earnings = sim.calculate(\"employment_income\", map_to=\"household\") + sim.calculate(\"self_employment_income\", map_to=\"household\")\n",
"total_income = household_benefits + household_pensions + household_investment_income + household_earnings\n",
"household_investment_income = sim.calculate(\n",
" \"net_investment_income\", map_to=\"household\"\n",
")\n",
"household_earnings = sim.calculate(\n",
" \"employment_income\", map_to=\"household\"\n",
") + sim.calculate(\"self_employment_income\", map_to=\"household\")\n",
"total_income = (\n",
" household_benefits\n",
" + household_pensions\n",
" + household_investment_income\n",
" + household_earnings\n",
")\n",
"\n",
"equivalised_income = sim.calculate(\"equiv_household_net_income\")\n",
"household_count_people = sim.calculate(\"people\", map_to=\"household\")\n",
Expand All @@ -2082,22 +2091,30 @@
" income_sources.append(income_source)\n",
" income_source_values = income_source_decodes[income_source]\n",
" values.append(\n",
" np.maximum(income_source_values[in_decile].sum(), 0) / total_income[in_decile].sum()\n",
" np.maximum(income_source_values[in_decile].sum(), 0)\n",
" / total_income[in_decile].sum()\n",
" )\n",
" cumulative_income += np.maximum(\n",
" income_source_values[in_decile].sum(), 0\n",
" )\n",
" cumulative_income += np.maximum(income_source_values[in_decile].sum(), 0)\n",
" # Add 'other income'\n",
" percentiles.append(percentile)\n",
" income_sources.append(\"Other\")\n",
" values.append(1 - cumulative_income / total_income[in_decile].sum())\n",
"\n",
"df = pd.DataFrame({\n",
" \"Percentile\": percentiles,\n",
" \"Income source\": income_sources,\n",
" \"Value\": values,\n",
"})\n",
"df = pd.DataFrame(\n",
" {\n",
" \"Percentile\": percentiles,\n",
" \"Income source\": income_sources,\n",
" \"Value\": values,\n",
" }\n",
")\n",
"\n",
"# Order by state support, other income, pensions, investment, earnings\n",
"df[\"Income source\"] = pd.Categorical(df[\"Income source\"], [\"State support\", \"Other\", \"Pensions\", \"Investment\", \"Earnings\"])\n",
"df[\"Income source\"] = pd.Categorical(\n",
" df[\"Income source\"],\n",
" [\"State support\", \"Other\", \"Pensions\", \"Investment\", \"Earnings\"],\n",
")\n",
"df = df.sort_values([\"Percentile\", \"Income source\"], ascending=[True, False])\n",
"\n",
"import plotly.express as px\n",
Expand All @@ -2118,7 +2135,7 @@
" yaxis=dict(\n",
" tickformat=\".0%\",\n",
" title=\"Percentage of income\",\n",
" tickvals=[0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, .7, .8, .9, 1],\n",
" tickvals=[0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1],\n",
" ),\n",
" xaxis=dict(\n",
" title=\"Income percentile\",\n",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
description: Kentucky caps the family size at this number when calculating the poverty threshold for the family size tax credit.
values:
2005-01-01: 4
metadata:
label: Kentucky family size tax credit family size cap
period: year
unit: people
reference:
- title: Kentucky 141.066, (1) (e) (4)
href: https://apps.legislature.ky.gov/law/statutes/statute.aspx?id=49188
- title: 2022 Kentucky individual tax credit schedule, ITC
href: https://revenue.ky.gov/Forms/Schedule%20ITC%202022.pdf#page=2
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
description: Kentucky provides a credit for a fraction of tax liability, based on modified gross income as a percent of a modified poverty line.
metadata:
type: single_amount
threshold_unit: /1
amount_unit: /1
label: Kentucky family size tax credit rate
reference:
- title: Kentucky 141.066, (3)
href: https://apps.legislature.ky.gov/law/statutes/statute.aspx?id=49188
- title: 2022 Kentucky individual tax credit schedule, ITC
href: https://revenue.ky.gov/Forms/Schedule%20ITC%202022.pdf#page=2

brackets:
- threshold:
2005-01-01: -.inf
amount:
2005-01-01: 1
- threshold:
2005-01-01: 1
amount:
2005-01-01: 0.9
- threshold:
2005-01-01: 1.04
amount:
2005-01-01: 0.8
- threshold:
2005-01-01: 1.08
amount:
2005-01-01: 0.7
- threshold:
2005-01-01: 1.12
amount:
2005-01-01: 0.6
- threshold:
2005-01-01: 1.16
amount:
2005-01-01: 0.5
- threshold:
2005-01-01: 1.2
amount:
2005-01-01: 0.4
- threshold:
2005-01-01: 1.24
amount:
2005-01-01: 0.3
- threshold:
2005-01-01: 1.27
amount:
2005-01-01: 0.2
- threshold:
2005-01-01: 1.3
amount:
2005-01-01: 0.1
- threshold:
2005-01-01: 1.33
amount:
2005-01-01: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
description: Kentucky non-refundable tax credits.
metadata:
unit: list
label: Kentucky non-refundable credits
values:
2021-01-01:
- ky_family_size_tax_credit
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
- name: 20% rate
period: 2023
input:
state_code: KY
ky_family_size_tax_credit_rate: 0.2
ky_income_tax_before_non_refundable_credits: 1_000
output:
ky_family_size_tax_credit: 200

- name: 0% rate
period: 2023
input:
state_code: KY
ky_family_size_tax_credit_rate: 0
ky_income_tax_before_non_refundable_credits: 1_000
output:
ky_family_size_tax_credit: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
- name: No income
period: 2023
input:
state_code: KY
ky_modified_agi: 0
state_group: CONTIGUOUS_US
tax_unit_size: 1
output:
ky_family_size_tax_credit_rate: 1

- name: One person with income at fpg
period: 2022
input:
state_code: KY
ky_modified_agi: 13_590
state_group: CONTIGUOUS_US
tax_unit_size: 1
output:
ky_family_size_tax_credit_rate: 1

- name: Seven person, capped at 4 # fpg = 13_590 + 3 * 4_720 = 27_750, 119%
period: 2022
input:
state_code: KY
ky_modified_agi: 33_000
state_group: CONTIGUOUS_US
tax_unit_size: 7
output:
ky_family_size_tax_credit_rate: 0.5

- name: Three people with income over fpg
period: 2022
input:
state_code: KY
ky_modified_agi: 50_000
state_group: CONTIGUOUS_US
tax_unit_size: 3
output:
ky_family_size_tax_credit_rate: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
- name: State AGI over federal AGI
period: 2023
input:
state_code: KY
adjusted_gross_income: 900
tax_exempt_form_4972_lumpsum_distributions: 10
ky_agi: 1_000
output:
ky_modified_agi: 1_010

- name: State AGI under federal AGI
period: 2023
input:
state_code: KY
adjusted_gross_income: 2_000
tax_exempt_form_4972_lumpsum_distributions: 10
ky_agi: 1_000
output:
ky_modified_agi: 2_010
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
- name: No income
period: 2023
input:
ky_taxable_income: 0
state_code: KY
output:
ky_income_tax_before_non_refundable_credits: 0

- name: 2023 tax rate
period: 2023
input:
ky_taxable_income: 1_000
state_code: KY
output:
ky_income_tax_before_non_refundable_credits: 45

- name: 2022 tax rate
period: 2022
input:
ky_taxable_income: 1_000
state_code: KY
output:
ky_income_tax_before_non_refundable_credits: 50

- name: 2021 tax rate
period: 2021
input:
ky_taxable_income: 1_000
state_code: KY
output:
ky_income_tax_before_non_refundable_credits: 50
Original file line number Diff line number Diff line change
@@ -1,31 +1,18 @@
- name: No income
- name: Subtractions
period: 2023
input:
ky_taxable_income: 0
ky_income_tax_before_non_refundable_credits: 1_100
state_code: KY
ky_non_refundable_credits: 1_000
output:
ky_income_tax_before_refundable_credits: 0
ky_income_tax_before_refundable_credits: 100

- name: 2023 tax rate
- name: Capped at 0
period: 2023
input:
ky_taxable_income: 1_000
state_code: KY
output:
ky_income_tax_before_refundable_credits: 45

- name: 2022 tax rate
period: 2022
input:
ky_taxable_income: 1_000
ky_income_tax_before_non_refundable_credits: 1_000
state_code: KY
ky_non_refundable_credits: 1_100
output:
ky_income_tax_before_refundable_credits: 50
ky_income_tax_before_refundable_credits: 0

- name: 2021 tax rate
period: 2021
input:
ky_taxable_income: 1_000
state_code: KY
output:
ky_income_tax_before_refundable_credits: 50
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from policyengine_us.model_api import *


class ky_family_size_tax_credit(Variable):
value_type = float
entity = TaxUnit
label = "Kentucky family size tax credit"
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):
rate = tax_unit("ky_family_size_tax_credit_rate", period)
income = tax_unit(
"ky_income_tax_before_non_refundable_credits", period
)
return rate * income
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from policyengine_us.model_api import *


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("tax_unit_size", 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)
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from policyengine_us.model_api import *


class ky_modified_agi(Variable):
value_type = float
entity = TaxUnit
label = "Kentucky modified adjusted gross income for the family size tax credit"
unit = USD
definition_period = YEAR
reference = "https://revenue.ky.gov/Forms/740%20Packet%20Instructions%205-9-23.pdf#page=22"
defined_for = StateCode.KY

def formula(tax_unit, period, parameters):
fed_agi = tax_unit("adjusted_gross_income", period)
# Lump sum distributions which are not included in federal AGI are added to the federal AGI
# Tax exempt interest from municipal bonds (non-Kentucky) is also added but excluded in this calculation
tax_exempt_lump_sum = tax_unit(
"tax_exempt_form_4972_lumpsum_distributions", period
)
total_fed_agi = fed_agi + tax_exempt_lump_sum

ky_agi = tax_unit("ky_agi", period)
# Lump sum distributions which are not included in federal AGI are added to the state AGI
total_ky_agi = ky_agi + tax_exempt_lump_sum
return max_(total_fed_agi, total_ky_agi)
11 changes: 11 additions & 0 deletions policyengine_us/variables/gov/states/ky/tax/income/ky_agi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from policyengine_us.model_api import *


class ky_agi(Variable):
value_type = float
entity = TaxUnit
label = "Kentucky adjusted gross income"
unit = USD
definition_period = YEAR
reference = "https://revenue.ky.gov/Forms/740%20Packet%20Instructions%205-9-23.pdf#page=11"
defined_for = StateCode.KY
Loading

0 comments on commit 397f95c

Please sign in to comment.