Skip to content

Commit

Permalink
Merge pull request #88 from rickecon/ar
Browse files Browse the repository at this point in the history
Merging
  • Loading branch information
rickecon authored Nov 21, 2024
2 parents 833fad0 + aacad55 commit f76173d
Show file tree
Hide file tree
Showing 33 changed files with 259 additions and 133 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [0.3.5] - 2024-11-21 00:30:00

### Added

- Updated and fixed Arkansas parameters, variables and tests.

## [0.3.4] - 2024-11-14 00:30:00

### Added
Expand Down Expand Up @@ -245,6 +251,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- First prototype version based off of openfisca-us and tax-calculator.


[0.3.5]: https://github.com/TheCGO/fiscalsim-us/compare/v0.3.5...v0.3.5
[0.3.4]: https://github.com/TheCGO/fiscalsim-us/compare/v0.3.3...v0.3.4
[0.3.3]: https://github.com/TheCGO/fiscalsim-us/compare/v0.3.2...v0.3.3
[0.3.2]: https://github.com/TheCGO/fiscalsim-us/compare/v0.3.1...v0.3.2
Expand Down
5 changes: 5 additions & 0 deletions changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,8 @@
added:
- Updated and fixed Louisiana parameters, variables and tests.
date: 2024-11-14 00:30:00
- bump: patch
changes:
added:
- Updated and fixed Arkansas parameters, variables and tests.
date: 2024-11-21 00:30:00
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
description: The exemption for traditional IRA distributions is limited to filers above this age.
values:
2021-01-01: 59.5

metadata:
unit: currency-USD
period: year
label: Traditional IRA distribution age threshold
reference:
- title: Internal Revenue Services - IRA withdrawal rules
href: https://www.irs.gov/newsroom/what-if-i-withdraw-money-from-my-ira#:~:text=Generally%2C%20early%20withdrawal%20from%20an,premium%20after%20a%20job%20loss.
- title: Publication 590-B (2022), Distributions from Individual Retirement Arrangements (IRAs) - Traditional IRAs - What Acts Result in Penalties or Additional Taxes? - Early Distributions - Age 59½ Rule - After age 59½ and before age 72
href: https://www.irs.gov/publications/p590b#en_US_2022_publink100090242
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ metadata:
- filing_status
JOINT:
2022-01-01: 3_000
WIDOW:
SURVIVING_SPOUSE:
2022-01-01: 3_000
HEAD_OF_HOUSEHOLD:
2022-01-01: 3_000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ metadata:
- filing_status
JOINT:
2022-01-01: 27_292
WIDOW:
SURVIVING_SPOUSE:
2022-01-01: 22_790
HEAD_OF_HOUSEHOLD:
2022-01-01: 22_790
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ metadata:
- filing_status
JOINT:
2022-01-01: 7
WIDOW:
SURVIVING_SPOUSE:
2022-01-01: 9
HEAD_OF_HOUSEHOLD:
2022-01-01: 9
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ metadata:
href: https://codes.findlaw.com/ar/title-26-taxation/ar-code-sect-26-51-301/
- title: Arkansas 2022 Tax Tables
href: https://www.dfa.arkansas.gov/images/uploads/incomeTaxOffice/2022_TaxTables.pdf

breakdown:
- filing_status
JOINT:
2022-01-01: 22_676
WIDOW:
SURVIVING_SPOUSE:
2022-01-01: 19_118
HEAD_OF_HOUSEHOLD:
2022-01-01: 19_118
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ metadata:
reference:
- title: Arkansas Code Title 26. Taxation § 26-51-301. Subsection f
href: https://codes.findlaw.com/ar/title-26-taxation/ar-code-sect-26-51-301/

breakdown:
- filing_status
JOINT:
2022-01-01: 7
WIDOW:
SURVIVING_SPOUSE:
2022-01-01: 6
HEAD_OF_HOUSEHOLD:
2022-01-01: 6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ metadata:
- filing_status
JOINT:
2022-01-01: 100
WIDOW:
SURVIVING_SPOUSE:
2022-01-01: 50
HEAD_OF_HOUSEHOLD:
2022-01-01: 50
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ brackets:
2023-01-01: 4_501
rate:
2022-01-01: 0.04
2024-01-01: 0.039
- threshold:
2022-01-01: 8_801
2023-01-01: 9_101
2024-01-01: .inf
rate:
2022-01-01: 0.049
2023-01-01: 0.047
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ brackets:
2021-01-01: 0.05
2022-01-01: 0.049
2023-01-01: 0.047
2024-01-01: 0.039
- threshold:
2021-01-01: 39_700
2022-01-01: .inf
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- name: Single household with $11,180 taxable income
- name: Single household with $11,180 taxable income
period: 2022
input:
state_code: AR
Expand Down Expand Up @@ -56,7 +56,7 @@
state_code: AR
ar_taxable_income: 23_730
tax_unit_dependents: 2
filing_status: WIDOW
filing_status: SURVIVING_SPOUSE
ar_standard_deduction: 2_270
ar_itemized_deductions: 500
ar_agi: 26_000
Expand All @@ -69,7 +69,7 @@
state_code: AR
ar_taxable_income: 21_730
tax_unit_dependents: 2
filing_status: WIDOW
filing_status: SURVIVING_SPOUSE
ar_standard_deduction: 2_270
ar_itemized_deductions: 500
ar_agi: 24_000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
age_spouse: 0
ar_head_retirement_income: 0
ar_spouse_retirement_income: 0
deaf_head: 0
deaf_head: 0
deaf_spouse: 0
tax_unit_dependents: 0
ar_qual_dependents: 0
Expand All @@ -26,12 +26,12 @@
age_spouse: 56
ar_head_retirement_income: 0
ar_spouse_retirement_income: 0
deaf_head: 0
deaf_head: 0
deaf_spouse: 0
tax_unit_dependents: 1
ar_qual_dependents: 0
output:
ar_personal_credits: 87
ar_personal_credits: 58
- name: Joint household, above 65, 0 dependents, no disabilities, no retirement income
period: 2022
input:
Expand All @@ -43,12 +43,12 @@
age_spouse: 87
ar_head_retirement_income: 0
ar_spouse_retirement_income: 0
deaf_head: 0
deaf_head: 0
deaf_spouse: 0
tax_unit_dependents: 0
ar_qual_dependents: 0
output:
ar_personal_credits: 174
ar_personal_credits: 29
- name: Joint household, above 65, 0 dependents, no disabilities, with retirement income
period: 2022
input:
Expand All @@ -60,12 +60,12 @@
age_spouse: 87
ar_head_retirement_income: 20_000
ar_spouse_retirement_income: 20_000
deaf_head: 0
deaf_head: 0
deaf_spouse: 0
tax_unit_dependents: 0
ar_qual_dependents: 0
output:
ar_personal_credits: 116
ar_personal_credits: 29
- name: Joint household, below 65, 2 dependents, 1 with disabilities, spouse is blind and deaf
period: 2022
input:
Expand All @@ -77,9 +77,9 @@
age_spouse: 39
ar_head_retirement_income: 0
ar_spouse_retirement_income: 0
deaf_head: 0
deaf_head: 0
deaf_spouse: 1
tax_unit_dependents: 2
ar_qual_dependents: 1
output:
ar_personal_credits: 674
ar_personal_credits: 587
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def formula(tax_unit, period, parameters):
threshold = p.phase_out.threshold[filing_status]
al_agi = tax_unit("al_agi", period)
# No "or fraction thereof" clause, so use integer (floor) division rather than ceiling.
excess_income = max(0, al_agi - threshold)
excess_income = max_(0, al_agi - threshold)
increments = excess_income // increment
reduction = increments * rate

return max(base_amount - reduction, min_amount)
return max_(base_amount - reduction, min_amount)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from fiscalsim_us.model_api import *
from numpy import round
import numpy as np


class ar_high_income_reduction(Variable):
Expand All @@ -25,17 +25,37 @@ def formula(tax_unit, period, parameters):

def round_to_nearest_50(num):
# Calculate the nearest multiple of 100
nearest_multiple_of_100 = round(num / 100, 0) * 100
nearest_multiple_of_100 = np.round(num / 100, 0) * 100

# Get the last two digits
last_two_digits = num % 100

# Determine the closest ending in "50"
if last_two_digits <= 50 and last_two_digits >= 1:
rounded_income = nearest_multiple_of_100 + 50
return rounded_income
if np.isscalar(num):
if last_two_digits <= 50 and last_two_digits >= 1:
rounded_income = nearest_multiple_of_100 + 50
return rounded_income
else:
rounded_income = nearest_multiple_of_100 - 50
return rounded_income
else:
rounded_income = nearest_multiple_of_100 - 50
rounded_income = np.zeros_like(num)
rounded_income[
(last_two_digits <= 50) & (last_two_digits >= 1)
] = (
nearest_multiple_of_100[
(last_two_digits <= 50) & (last_two_digits >= 1)
]
+ 50
)
rounded_income[
(last_two_digits > 50) | (last_two_digits < 1)
] = (
nearest_multiple_of_100[
(last_two_digits > 50) | (last_two_digits < 1)
]
- 50
)
return rounded_income

std_ded = tax_unit("ar_standard_deduction", period)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from fiscalsim_us.model_api import *
from numpy import round
import numpy as np


class ar_income_tax_before_non_refundable_credits(Variable):
Expand All @@ -21,31 +21,78 @@ def formula(tax_unit, period, parameters):

def round_to_nearest_50(num):
# Calculate the nearest multiple of 100
nearest_multiple_of_100 = round(num / 100, 0) * 100
nearest_multiple_of_100 = np.round(num / 100, 0) * 100

# Get the last two digits
last_two_digits = num % 100

# Determine the closest ending in "50"
if last_two_digits <= 50 and last_two_digits >= 1:
rounded_income = nearest_multiple_of_100 + 50
return rounded_income
if np.isscalar(num):
if last_two_digits <= 50 and last_two_digits >= 1:
rounded_income = nearest_multiple_of_100 + 50
return rounded_income
else:
rounded_income = nearest_multiple_of_100 - 50
return rounded_income
else:
rounded_income = nearest_multiple_of_100 - 50
rounded_income = np.zeros_like(num)
rounded_income[
(last_two_digits <= 50) & (last_two_digits >= 1)
] = (
nearest_multiple_of_100[
(last_two_digits <= 50) & (last_two_digits >= 1)
]
+ 50
)
rounded_income[
(last_two_digits > 50) | (last_two_digits < 1)
] = (
nearest_multiple_of_100[
(last_two_digits > 50) | (last_two_digits < 1)
]
- 50
)
return rounded_income

rounded_taxable_income = round_to_nearest_50(taxable_income)

tax = round(
where(
taxable_income <= high_income_threshold,
p.rates.calc(rounded_taxable_income),
p.high_income_rates.calc(rounded_taxable_income),
if np.isscalar(rounded_taxable_income):
tax = np.round(
where(
taxable_income <= high_income_threshold,
p.rates.calc(rounded_taxable_income),
p.high_income_rates.calc(rounded_taxable_income),
)
- litc
- high_income_reduction,
0,
)
else:
tax = np.zeros_like(rounded_taxable_income)
tax[taxable_income <= high_income_threshold] = np.round(
p.rates.calc(
rounded_taxable_income[
taxable_income <= high_income_threshold
]
)
- litc[taxable_income <= high_income_threshold]
- high_income_reduction[
taxable_income <= high_income_threshold
],
0,
)
tax[taxable_income > high_income_threshold] = np.round(
p.high_income_rates.calc(
rounded_taxable_income[
taxable_income > high_income_threshold
]
)
- litc[taxable_income > high_income_threshold]
- high_income_reduction[
taxable_income > high_income_threshold
],
0,
)
- litc
- high_income_reduction,
0,
)

lump_sum_dist_tax = tax_unit("ar_lump_sum_dist_tax", period)

Expand Down
Loading

0 comments on commit f76173d

Please sign in to comment.