Skip to content
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:
fixes:
- Mississippi taxable income.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ values:
2021-01-01:
- irs_employment_income # Wages, salaries, tips, etc.
- self_employment_income
- qualified_business_income
- partnership_s_corp_income
- capital_gains
- rental_income
- farm_income
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
ms_total_exemptions_joint: [15_000, 0, 0]
ms_total_exemptions: 15_000
ms_taxable_income_indiv: [13_200, 8_200, 0]
ms_taxable_income_joint: [21_400, 0, 0]
ms_taxable_income_joint: [3_400, 18_000, 0]
ms_income_tax_before_credits_indiv: [390, 158, 0]
ms_income_tax_before_credits_joint: [800, 0, 0]
ms_income_tax_before_credits_joint: [0, 630, 0]
ms_files_separately: true
ms_agi: [23_000, 18_000, 0]
ms_income_tax: 548
Expand Down Expand Up @@ -61,3 +61,92 @@
state_fips: 28 # MS
output: # expected results from patched TAXSIM35 2024-02-19 version
ms_income_tax: 2_286

- name: Tax unit with taxsimid 86116 in j21.its.csv and j21.ots.csv
absolute_error_margin: 0.01
period: 2021
input:
people:
person1:
age: 54
employment_income: 140010
qualified_dividend_income: 505.0
taxable_interest_income: 5505.0
short_term_capital_gains: 505.0
long_term_capital_gains: 505.0
rent: 23000
self_employment_income: 157010
business_is_qualified: true
business_is_sstb: false
w2_wages_from_qualified_business: 100e6
ssi: 0 # not in TAXSIM35
state_supplement: 0 # not in TAXSIM35
wic: 0 # not in TAXSIM35
ma_covid_19_essential_employee_premium_pay_program: 0 # not in TAXSIM35
person2:
age: 54
employment_income: 1010
qualified_dividend_income: 505.0
taxable_interest_income: 5505.0
short_term_capital_gains: 505.0
long_term_capital_gains: 505.0
ssi: 0 # not in TAXSIM35
state_supplement: 0 # not in TAXSIM35
wic: 0 # not in TAXSIM35
ma_covid_19_essential_employee_premium_pay_program: 0 # not in TAXSIM35
person3:
age: 16
ssi: 0 # not in TAXSIM35
state_supplement: 0 # not in TAXSIM35
wic: 0 # not in TAXSIM35
ma_covid_19_essential_employee_premium_pay_program: 0 # not in TAXSIM35
person4:
age: 16
ssi: 0 # not in TAXSIM35
state_supplement: 0 # not in TAXSIM35
wic: 0 # not in TAXSIM35
ma_covid_19_essential_employee_premium_pay_program: 0 # not in TAXSIM35
person5:
age: 16
ssi: 0 # not in TAXSIM35
state_supplement: 0 # not in TAXSIM35
wic: 0 # not in TAXSIM35
ma_covid_19_essential_employee_premium_pay_program: 0 # not in TAXSIM35
person6:
age: 16
ssi: 0 # not in TAXSIM35
state_supplement: 0 # not in TAXSIM35
wic: 0 # not in TAXSIM35
ma_covid_19_essential_employee_premium_pay_program: 0 # not in TAXSIM35
tax_units:
tax_unit:
members: [person1, person2, person3, person4, person5, person6]
premium_tax_credit: 0 # not in TAXSIM35
local_income_tax: 0 # not in TAXSIM35
state_sales_tax: 0 # not in TAXSIM35
ca_use_tax: 0 # not in TAXSIM35
il_use_tax: 0 # not in TAXSIM35
nm_2021_income_rebate: 0 # not in TAXSIM35
nm_additional_2021_income_rebate: 0 # not in TAXSIM35
nm_supplemental_2021_income_rebate: 0 # not in TAXSIM35
ny_supplemental_eitc: 0 # not in TAXSIM35
ok_use_tax: 0 # not in TAXSIM35
pa_use_tax: 0 # not in TAXSIM35
vt_renter_credit: 0 # not in TAXSIM35
spm_units:
spm_unit:
members: [person1, person2, person3, person4, person5, person6]
snap: 0 # not in TAXSIM35
tanf: 0 # not in TAXSIM35
households:
household:
members: [person1, person2, person3, person4, person5, person6]
state_fips: 28 # MS
output: # expected results from patched TAXSIM35 2024-03-09 version
ms_agi: [301_764.53, 8_030, 0, 0, 0, 0] # TAXSIM 301764.54 + 8030 = 309794.54
ms_taxable_income_joint: [279_164.53, 8_030, 0, 0, 0, 0] #TAXSIM 279164 + 8030 = 287194.54
ms_deductions_joint: [4_600, 0, 0, 0, 0, 0]
ms_total_exemptions_joint: [18000,0,0,0,0,0]
# ms_income_tax_before_credits_joint: [14089.727, 0, 0, 0, 0, 0]
# ms_income_tax_before_credits_indiv: [14253.227, 0, 0, 0, 0, 0]
ms_income_tax: 13_839.427 # TAXSIM 13819.73
Original file line number Diff line number Diff line change
@@ -1,40 +1,45 @@
- name: Calculation
- name: Both head and spouse have positive taxable income
period: 2023
input:
state_code: MS
ms_agi: 2_000
ms_deductions_joint: 200
ms_total_exemptions: 300
people:
head:
ms_unadjusted_taxable_income_joint: 500
is_tax_unit_head: true
spouse:
ms_unadjusted_taxable_income_joint: 300
is_tax_unit_head: false
tax_units:
tax_unit:
members: [head,spouse]
spm_units:
spm_unit:
members: [head,spouse]
households:
household:
members: [head,spouse]
state_code: MS
output:
ms_taxable_income_joint: 1_500
ms_taxable_income_joint: [500,300]

- name: Capped at 0
- name: Only one of head or spouse has positive taxable income
period: 2023
input:
state_code: MS
ms_agi: 100
ms_deductions_joint: 200
ms_total_exemptions: 300
output:
ms_taxable_income_joint: 0

- name: MS prorate fraction unit test 1
period: 2021
input:
people:
person1:
head:
ms_unadjusted_taxable_income_joint: -100
is_tax_unit_head: true
ms_agi: 5_000
ms_deductions_joint: 1_000
ms_total_exemptions_joint: 1_500
person2:
spouse:
ms_unadjusted_taxable_income_joint: 300
is_tax_unit_head: false
ms_agi: 3_000
ms_deductions_joint: 0
ms_total_exemptions_joint: 0
tax_units:
tax_unit:
members: [head,spouse]
spm_units:
spm_unit:
members: [head,spouse]
households:
household:
members: [person1, person2]
members: [head,spouse]
state_code: MS
output:
ms_taxable_income_joint: [5_500, 0]
ms_taxable_income_joint: [200,0]
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
- name: Positive taxable income for head or spouse
period: 2023
input:
state_code: MS
ms_agi: 2_000
ms_deductions_joint: 200
ms_total_exemptions_joint: 300
output:
ms_unadjusted_taxable_income_joint: 1_500 #2000-(200+300)

- name: Negative taxable income for head or spouse
period: 2023
input:
state_code: MS
ms_agi: 100
ms_deductions_joint: 200
ms_total_exemptions_joint: 300
output:
ms_unadjusted_taxable_income_joint: -400 #100-(200+300)
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
from policyengine_us.model_api import *


class ms_taxable_income_joint(Variable):
value_type = float
entity = Person
label = "Mississippi taxable income when married couple file jointly"
unit = USD
definition_period = YEAR
reference = (
"https://www.dor.ms.gov/sites/default/files/Forms/Individual/80100221.pdf#page=13",
"https://www.dor.ms.gov/sites/default/files/Forms/Individual/80105228.pdf", # Line 38 - 49,
)
defined_for = StateCode.MS

def formula(person, period, parameters):
# MS allowes negative taxable income when married couple file jointly
ms_unadjusted_taxable_income_joint = person(
"ms_unadjusted_taxable_income_joint", period
)
any_spouse_negative_income = person.tax_unit.any(
ms_unadjusted_taxable_income_joint < 0
)

# 1. both head and spouse have positive taxable income (includes 0)

# 2. at least one head or spouse has negative taxable income
# assign total net_income to tax unit head
is_head = person("is_tax_unit_head", period)

total_taxable_income_attributed_to_head = (
person.tax_unit.sum(ms_unadjusted_taxable_income_joint) * is_head
)
return where(
any_spouse_negative_income,
total_taxable_income_attributed_to_head,
ms_unadjusted_taxable_income_joint,
)
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from policyengine_us.model_api import *


class ms_taxable_income_joint(Variable):
class ms_unadjusted_taxable_income_joint(Variable):
value_type = float
entity = Person
label = "Mississippi taxable income when married couple file jointly"
label = "Mississippi taxable income for head or spouse when married couple file jointly"
unit = USD
definition_period = YEAR
reference = (
Expand All @@ -14,13 +14,12 @@ class ms_taxable_income_joint(Variable):
defined_for = StateCode.MS

def formula(person, period, parameters):
# assign total net_income to tax unit head
is_head = person("is_tax_unit_head", period)
agi = person("ms_agi", period)
head_agi = is_head * person.tax_unit.sum(agi)

deductions_and_exemptions = add(
person.tax_unit,
person,
period,
["ms_deductions_joint", "ms_total_exemptions_joint"],
)
return max_(head_agi - deductions_and_exemptions, 0)
# MS allows for negative taxable income
return agi - deductions_and_exemptions