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

Attribute the standard and itemized deductions in Montana to each spouse respectively #4317

Merged
merged 4 commits into from
Apr 19, 2024
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: patch
changes:
fixed:
- Attribute the standard and itemized deductions in Montana to each spouse respectively.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
mt_itemized_deductions_indiv: 10_000
mt_tax_unit_itemizes: true
output:
mt_tax_unit_deductions_exemptions_indiv: 10_000
mt_deductions_indiv: 10_000

- name: Tax unit does not itemize
period: 2021
Expand All @@ -16,4 +16,4 @@
mt_itemized_deductions_indiv: 10_000
mt_tax_unit_itemizes: false
output:
mt_tax_unit_deductions_exemptions_indiv: 12_950
mt_deductions_indiv: 12_950
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,22 @@
person1:
is_tax_unit_head: true
mt_agi: 20_000
mt_dependent_exemptions_person: 5_000
person2:
is_tax_unit_spouse: true
mt_agi: 18_000
mt_dependent_exemptions_person: 5_000
person3:
mt_agi: 0
tax_units:
tax_unit:
members: [person1, person2, person3]
mt_tax_unit_deductions_exemptions_indiv: 10_000
households:
household:
members: [person1, person2, person3]
state_code: MT
output:
mt_head_deductions_exemptions_indiv: 6_000
mt_head_dependent_exemptions_indiv: 6_000

- name: The AGI difference is attributed to the person with the higher AGI and the rest is halved, spouse larger AGI
period: 2021
Expand All @@ -28,21 +29,22 @@
person1:
is_tax_unit_head: true
mt_agi: 10_000
mt_dependent_exemptions_person: 5_000
person2:
is_tax_unit_spouse: true
mt_agi: 18_000
mt_dependent_exemptions_person: 5_000
person3:
mt_agi: 0
tax_units:
tax_unit:
members: [person1, person2, person3]
mt_tax_unit_deductions_exemptions_indiv: 10_000
households:
household:
members: [person1, person2, person3]
state_code: MT
output:
mt_head_deductions_exemptions_indiv: 1_000
mt_head_dependent_exemptions_indiv: 1_000

- name: Head has greater AGI and deductions are below the delta
period: 2021
Expand All @@ -51,21 +53,22 @@
person1:
is_tax_unit_head: true
mt_agi: 20_000
mt_dependent_exemptions_person: 0
person2:
is_tax_unit_spouse: true
mt_agi: 18_000
mt_dependent_exemptions_person: 1_000
person3:
mt_agi: 0
tax_units:
tax_unit:
members: [person1, person2, person3]
mt_tax_unit_deductions_exemptions_indiv: 1_000
households:
household:
members: [person1, person2, person3]
state_code: MT
output:
mt_head_deductions_exemptions_indiv: 1_000
mt_head_dependent_exemptions_indiv: 1_000

- name: Spouse has greater AGI and deductions are below the delta
period: 2021
Expand All @@ -74,18 +77,19 @@
person1:
is_tax_unit_head: true
mt_agi: 18_000
mt_dependent_exemptions_person: 200
person2:
is_tax_unit_spouse: true
mt_agi: 20_000
mt_dependent_exemptions_person: 800
person3:
mt_agi: 0
tax_units:
tax_unit:
members: [person1, person2, person3]
mt_tax_unit_deductions_exemptions_indiv: 1_000
households:
household:
members: [person1, person2, person3]
state_code: MT
output:
mt_head_deductions_exemptions_indiv: 0
mt_head_dependent_exemptions_indiv: 0
Original file line number Diff line number Diff line change
Expand Up @@ -64,39 +64,30 @@
mt_personal_exemptions_indiv: [2_580, 2_580, 0, 0, 0, 0]
mt_dependent_exemptions_person: [0, 0, 2_580, 2_580, 2_580, 2_580]

- name: Tax unit with taxsimid 34790 in e21.its.csv and e21.ots.csv
- name: Tax unit with taxsimid 22630 in e21.its.csv and e21.ots.csv
absolute_error_margin: 0.01
period: 2021
input:
people:
person1:
age: 33
employment_income: 7_010
age: 59
taxable_interest_income: 5_505
person2:
age: 33
employment_income: 136_010
age: 59
employment_income: 27010
taxable_interest_income: 5_505
person3:
age: 16
person4:
age: 16
person5:
age: 16
person6:
age: 16
tax_units:
tax_unit:
members: [person1, person2, person3, person4, person5, person6]
members: [person1, person2]
premium_tax_credit: 0 # not in TAXSIM35
spm_units:
spm_unit:
members: [person1, person2, person3, person4, person5, person6]
members: [person1, person2]
snap: 0 # not in TAXSIM35
tanf: 0 # not in TAXSIM35
households:
household:
members: [person1, person2, person3, person4, person5, person6]
members: [person1, person2]
state_fips: 30 # MT
output: # expected results from patched TAXSIM35 2024-03-09 version
mt_income_tax: 7_812.64
output: # expected results from patched TAXSIM35 2024-03-21 version
mt_income_tax: 1140.90
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
members: [person1, person2]
state_code: MT
output:
mt_taxable_income_indiv: [0, 0]
mt_taxable_income_indiv: [1_000, 0]

- name: First, the gap between spouse and head is closed, after which the amount is allocated equally
period: 2021
Expand All @@ -94,7 +94,7 @@
members: [person1, person2]
state_code: MT
output:
mt_taxable_income_indiv: [4_000, 4_000]
mt_taxable_income_indiv: [2_000, 6_000]

- name: If the AGI is equal, the amount is allocated equally, excluding the exemptions
period: 2021
Expand Down Expand Up @@ -123,4 +123,4 @@
members: [person1, person2, person3]
state_code: MT
output:
mt_taxable_income_indiv: [12_000, 14_000, 0]
mt_taxable_income_indiv: [11_000, 15_000, 0]
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from policyengine_us.model_api import *


class mt_deductions_indiv(Variable):
value_type = float
entity = Person
label = "The total amount of Montana deductions and exemptions when married filing separately"
unit = USD
definition_period = YEAR

def formula(person, period, parameters):
standard_deduction = person("mt_standard_deduction_indiv", period)
itemized_deductions = person("mt_itemized_deductions_indiv", period)
itemizes = person.tax_unit("mt_tax_unit_itemizes", period)
return where(itemizes, itemized_deductions, standard_deduction)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from policyengine_us.model_api import *


class mt_head_deductions_exemptions_indiv(Variable):
class mt_head_dependent_exemptions_indiv(Variable):
value_type = float
entity = TaxUnit
label = "The total amount of Montana deductions and exemptions when married filing separately attributed to the head of the tax unit"
Expand All @@ -11,8 +11,8 @@ class mt_head_deductions_exemptions_indiv(Variable):
def formula(tax_unit, period, parameters):
person = tax_unit.members
mt_agi = person("mt_agi", period)
total_deductions_exemptions = tax_unit(
"mt_tax_unit_deductions_exemptions_indiv", period
dependent_exemptions = add(
tax_unit, period, ["mt_dependent_exemptions_person"]
)
head = person("is_tax_unit_head", period)
spouse = person("is_tax_unit_spouse", period)
Expand All @@ -23,15 +23,15 @@ def formula(tax_unit, period, parameters):
# The head only gets this portion if they have larger AGI.
agi_difference = np.abs(head_agi - spouse_agi)
deductions_capped_at_agi_difference = min_(
agi_difference, total_deductions_exemptions
agi_difference, dependent_exemptions
)
equalizing_amount = (
deductions_capped_at_agi_difference * head_exceeds_spouse_agi
)
# Halve the remaining deductions amount
# Both head and spouse receive this amount.
remaining_deductions_exemptions = (
total_deductions_exemptions - deductions_capped_at_agi_difference
dependent_exemptions - deductions_capped_at_agi_difference
)
halved_remaining_deductions = remaining_deductions_exemptions / 2
return halved_remaining_deductions + equalizing_amount

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ class mt_taxable_income_indiv(Variable):
def formula(person, period, parameters):
mt_agi = person("mt_agi", period)
exemptions = person("mt_personal_exemptions_indiv", period)
reduced_agi = max_(mt_agi - exemptions, 0)
deductions_and_exemptions = person.tax_unit(
"mt_tax_unit_deductions_exemptions_indiv", period
deductions = person("mt_deductions_indiv", period)
reduced_agi = max_(mt_agi - exemptions - deductions, 0)
dependent_exemptions = add(
person.tax_unit, period, ["mt_dependent_exemptions_person"]
)
head = person("is_tax_unit_head", period)
head_deductions = person.tax_unit(
"mt_head_deductions_exemptions_indiv", period
"mt_head_dependent_exemptions_indiv", period
)
spouse_deductions = deductions_and_exemptions - head_deductions
spouse_deductions = dependent_exemptions - head_deductions
capped_head_agi = max_(reduced_agi - head_deductions, 0)
capped_spouse_agi = max_(reduced_agi - spouse_deductions, 0)
return where(head, capped_head_agi, capped_spouse_agi)
Loading