Skip to content

Commit

Permalink
Personal Credit Reform (PolicyEngine#4906)
Browse files Browse the repository at this point in the history
* Personal Credit Reform
Fixes PolicyEngine#4905

* reform structure

* testing

* add phase in to the basic income

* test

* circular ref.

* include ss

* remove reform

* desc.

* ss

* test fix
  • Loading branch information
PavelMakarchuk authored Aug 18, 2024
1 parent 7eacb11 commit 276f5bf
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 1 deletion.
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:
added:
- Personal Credit reform.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
description: Social Security benefits are treated as earnings under the basic income phase in if this is selected.
values:
0000-01-01: false
metadata:
unit: bool
label: SS benefits treated as earnings for basic income
period: year
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
description: Basic incomes phase in per person if this is selected; otherwise, they phase in at a flat rate irrespective of household size.
values:
0000-01-01: false
metadata:
unit: bool
label: Phase in basic income per person
period: year
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
description: The basic income phases in at this rate.
values:
0000-01-01: 1
metadata:
unit: /1
label: Basic income phase-in rate
period: year
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
input:
gov.contrib.ubi_center.basic_income.amount.person.flat: 100
tax_unit_size: 2
basic_income_phase_in: 400
output:
basic_income_before_phase_out: 200

Expand All @@ -19,6 +20,7 @@
tax_units:
tax_unit:
members: [adult, child]
basic_income_phase_in: 20_000
output:
basic_income_before_phase_out: 15_000

Expand All @@ -27,6 +29,7 @@
input:
gov.contrib.ubi_center.basic_income.amount.tax_unit.fpg_percent: 1
tax_unit_fpg: 10_000
tax_unit_earned_income: 10_000
output:
basic_income_before_phase_out: 10_000

Expand All @@ -44,6 +47,7 @@
tax_units:
tax_unit:
members: [adult, child]
basic_income_phase_in: 20_000
families:
family:
members: [adult, child]
Expand All @@ -65,9 +69,32 @@
tax_units:
tax_unit:
members: [adult, child]
basic_income_phase_in: 20_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
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: 12_000
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
- name: Three people phased in at 70% with earned income
period: 2022
input:
gov.contrib.ubi_center.basic_income.phase_in.rate: 0.7
gov.contrib.ubi_center.basic_income.phase_in.per_person: false
gov.contrib.ubi_center.basic_income.phase_in.include_ss_benefits_as_earnings: false
tax_unit_earned_income: 2_000
tax_unit_size: 3
tax_unit_social_security: 0
output:
basic_income_phase_in: 1_400

- name: Five people phased in at 30% with earned income, phased in per person
period: 2022
input:
gov.contrib.ubi_center.basic_income.phase_in.rate: 0.3
gov.contrib.ubi_center.basic_income.phase_in.per_person: true
gov.contrib.ubi_center.basic_income.phase_in.include_ss_benefits_as_earnings: true
tax_unit_earned_income: 2_000
tax_unit_size: 5
tax_unit_social_security: 0
output:
basic_income_phase_in: 3_000

- name: SS included in earnings
period: 2022
input:
gov.contrib.ubi_center.basic_income.phase_in.rate: 0.3
gov.contrib.ubi_center.basic_income.phase_in.per_person: false
gov.contrib.ubi_center.basic_income.phase_in.include_ss_benefits_as_earnings: true
tax_unit_earned_income: 2_000
tax_unit_size: 5
tax_unit_social_security: 3_000
output:
basic_income_phase_in: 1_500
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ def formula(tax_unit, period, parameters):
# Disability amount
disabled = person("is_ssi_disabled", period)
disabled_amount = tax_unit.sum(disabled * p.person.disability)
return (
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)
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from policyengine_us.model_api import *


class basic_income_phase_in(Variable):
value_type = float
entity = TaxUnit
label = "Basic income phase-in"
definition_period = YEAR
unit = USD

def formula(tax_unit, period, parameters):
p = parameters(period).gov.contrib.ubi_center.basic_income.phase_in
earnings = tax_unit("tax_unit_earned_income", period)
if p.include_ss_benefits_as_earnings:
ss_benefits = tax_unit("tax_unit_social_security", period)
earnings += ss_benefits
if p.per_person:
tax_unit_size = tax_unit("tax_unit_size", period)
rate = p.rate * tax_unit_size
else:
rate = p.rate
return rate * earnings

0 comments on commit 276f5bf

Please sign in to comment.