Skip to content

Commit

Permalink
Add switch to phase basic income in (PolicyEngine#5080)
Browse files Browse the repository at this point in the history
* Add switch to phase basic income in
Fixes PolicyEngine#5079

* format
  • Loading branch information
PavelMakarchuk authored Sep 16, 2024
1 parent 9c723ae commit 633032b
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 8 deletions.
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:
- Add switch to basic income phase-in.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
description: Basic income is phased in if this is true.
values:
0000-01-01: false
metadata:
unit: bool
period: year
label: Basic income phase-in in effect
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
gov.contrib.ubi_center.basic_income.amount.person.by_age[3].amount: 10_000
gov.contrib.ubi_center.basic_income.amount.person.by_age[0].amount: 5_000
gov.contrib.ubi_center.basic_income.amount.person.marriage_bonus: 0.2
gov.contrib.ubi_center.basic_income.phase_in.in_effect: true
people:
adult:
age: 26
Expand All @@ -77,12 +78,35 @@
output:
basic_income_before_phase_out: 15_000

- name: Phase-in not in effect
period: 2022
input:
gov.contrib.ubi_center.basic_income.amount.person.by_age[3].amount: 10_000
gov.contrib.ubi_center.basic_income.amount.person.by_age[0].amount: 5_000
gov.contrib.ubi_center.basic_income.amount.person.marriage_bonus: 0.2
people:
adult:
age: 26
child:
age: 4
tax_units:
tax_unit:
members: [adult, child]
basic_income_phase_in: 12_000
families:
family:
members: [adult, child]
is_married: false
output:
basic_income_before_phase_out: 15_000

- name: Not fully phased in
period: 2022
input:
gov.contrib.ubi_center.basic_income.amount.person.by_age[3].amount: 10_000
gov.contrib.ubi_center.basic_income.amount.person.by_age[0].amount: 5_000
gov.contrib.ubi_center.basic_income.amount.person.marriage_bonus: 0.2
gov.contrib.ubi_center.basic_income.phase_in.in_effect: true
people:
adult:
age: 26
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,39 @@ class basic_income_before_phase_out(Variable):
definition_period = YEAR

def formula(tax_unit, period, parameters):
p = parameters(period).gov.contrib.ubi_center.basic_income.amount
p = parameters(period).gov.contrib.ubi_center.basic_income
# Start with flat person-level amount.
total_flat_amount = p.person.flat * tax_unit("tax_unit_size", period)
total_flat_amount = p.amount.person.flat * tax_unit(
"tax_unit_size", period
)
# Add per-age person-level amount.
person = tax_unit.members
age = person("age", period)
amount_by_age = p.person.by_age.calc(age)
amount_by_age = p.amount.person.by_age.calc(age)
total_amount_by_age = tax_unit.sum(amount_by_age)
# If available, apply a marriage bonus
married = tax_unit.family("is_married", period)
marriage_bonus_rate = p.person.marriage_bonus * total_amount_by_age
marriage_bonus_rate = (
p.amount.person.marriage_bonus * total_amount_by_age
)
post_marriage_bonus_amount = total_amount_by_age + marriage_bonus_rate
applicable_amount_by_age = where(
married, post_marriage_bonus_amount, total_amount_by_age
)
# Now compute FPG amount.
fpg = tax_unit("tax_unit_fpg", period)
fpg_amount = p.tax_unit.fpg_percent * fpg
fpg_amount = p.amount.tax_unit.fpg_percent * fpg

# Disability amount
disabled = person("is_ssi_disabled", period)
disabled_amount = tax_unit.sum(disabled * p.person.disability)
disabled_amount = tax_unit.sum(disabled * p.amount.person.disability)
base_amount = (
total_flat_amount
+ applicable_amount_by_age
+ fpg_amount
+ disabled_amount
)
phase_in_amount = tax_unit("basic_income_phase_in", period)
return min_(base_amount, phase_in_amount)
if p.phase_in.in_effect:
phase_in_amount = tax_unit("basic_income_phase_in", period)
return min_(base_amount, phase_in_amount)
return base_amount

0 comments on commit 633032b

Please sign in to comment.