Skip to content

Commit

Permalink
Merge pull request #1381 from MaxGhenis/MaxGhenis/issue1004
Browse files Browse the repository at this point in the history
Add FPG-based basic income element
  • Loading branch information
MaxGhenis authored Sep 18, 2022
2 parents f86df74 + 38bd84c commit 820435d
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 32 deletions.
6 changes: 6 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- bump: minor
changes:
added:
- Federal poverty guideline-based basic income element.
changed:
- Made all basic income variables tax unit-level.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
description: A basic income is provided to tax units at this percentage of the federal poverty guideline
values:
0000-01-01: 0
metadata:
unit: /1
name: bi_fpg_percent
label: Basic income as a percent of tax unit's poverty line
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
- name: Basic income with phase-out applied.
period: 2022
absolute_error_margin: 1
input:
people:
adult:
basic_income_before_phase_out: 10_000
child:
basic_income_before_phase_out: 5_000
tax_units:
tax_unit:
members: [adult, child]
basic_income_phase_out: 5_000
basic_income_before_phase_out: 10_000
basic_income_phase_out: 4_000
basic_income_eligible: true
output:
basic_income: [6_667, 3_333]
basic_income: 6_000
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,12 @@
tax_unit:
members: [adult, child]
output:
basic_income_before_phase_out: [10_000, 5_000]
basic_income_before_phase_out: 15_000

- name: 100% of FPG.
period: 2022
input:
contrib.ubi_center.basic_income.fpg_percent: 1
tax_unit_fpg: 10_000
output:
basic_income_before_phase_out: 10_000
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,14 @@

class basic_income(Variable):
value_type = float
entity = Person
entity = TaxUnit
label = "Basic income"
unit = USD
documentation = "Total basic income payments for this person. Phase-outs as an equal percentage to all tax unit members."
documentation = "Total basic income payments for this filer."
definition_period = YEAR

def formula(person, period, parameters):
eligible = person.tax_unit("basic_income_eligible", period)
basic_income = person("basic_income_before_phase_out", period)
tax_unit = person.tax_unit
tax_unit_basic_income = tax_unit.sum(basic_income)
tax_unit_phase_out = tax_unit("basic_income_phase_out", period)
percent_reduction = where(
tax_unit_basic_income > 0,
tax_unit_phase_out / tax_unit_basic_income,
0,
)
return basic_income * eligible * (1 - percent_reduction)
def formula(tax_unit, period, parameters):
eligible = tax_unit("basic_income_eligible", period)
basic_income = tax_unit("basic_income_before_phase_out", period)
phase_out = tax_unit("basic_income_phase_out", period)
return eligible * (basic_income - phase_out)
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@

class basic_income_before_phase_out(Variable):
value_type = float
entity = Person
entity = TaxUnit
label = "Basic income before phase-outs"
unit = USD
documentation = (
"Total basic income payments for this person, before phasing out."
)
definition_period = YEAR

def formula(person, period, parameters):
def formula(tax_unit, period, parameters):
p = parameters(period).contrib.ubi_center.basic_income
# Start with person-level amount.
person = tax_unit.members
age = person("age", period)
return p.amount_by_age.calc(age)
amount = p.amount_by_age.calc(age)
person_level_amount = tax_unit.sum(amount)
# Now compute FPG amount.
fpg = tax_unit("tax_unit_fpg", period)
fpg_amount = p.fpg_percent * fpg
return person_level_amount + fpg_amount

0 comments on commit 820435d

Please sign in to comment.