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

Split UBI_21 into UBI_2164 and UBI_65 [3.0] #2463

Merged
merged 14 commits into from
Aug 20, 2020
4 changes: 2 additions & 2 deletions docs/guide/input_vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -706,8 +706,8 @@ _IRS Form Location:_
2013-2016: imputed from CPS data


## `nu05`
_Description_: Number of dependents under 5 years old
## `nu06`
_Description_: Number of dependents under 6 years old
_Datatype_: int
_Availability_: taxdata_puf, taxdata_cps
_IRS Form Location:_
Expand Down
35 changes: 26 additions & 9 deletions docs/guide/policy_params.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ are placed in an Other Parameters group at the end of the section.

### Offsets

#### `CPI_offset`
#### `parameter_indexing_CPI_offset`
_Description:_ Values are zero before 2017; reforms that introduce indexing with chained CPI would have values around -0.0025 beginning in the year before the first year policy parameters will have values computed with chained CPI.
_Notes:_ See April 2013 CBO report entitled 'What Would Be the Effect on the Deficit of Using the Chained CPI to Index Benefit Programs and the Tax Code?', which includes this: 'The chained CPI grows more slowly than the traditional CPI does: an average of about 0.25 percentage points more slowly per year over the past decade.' <https://www.cbo.gov/publication/44089>
_Has An Effect When Using:_ _PUF data:_ True _CPS data:_ True
Expand Down Expand Up @@ -1004,8 +1004,8 @@ _Valid Range:_ min = 0 and max = 1
_Out-of-Range Action:_ error


#### `ACTC_rt_bonus_under5family`
_Description:_ For families with qualifying children under 5 years old, this bonus rate is added to the fraction of earnings (additional child tax credit rate) used in calculating the ACTC.
#### `ACTC_rt_bonus_under6family`
_Description:_ For families with qualifying children under 6 years old, this bonus rate is added to the fraction of earnings (additional child tax credit rate) used in calculating the ACTC.
_Has An Effect When Using:_ _PUF data:_ True _CPS data:_ True
_Can Be Inflation Indexed:_ False _Is Inflation Indexed:_ False
_Value Type:_ float
Expand Down Expand Up @@ -1088,8 +1088,8 @@ _Valid Range:_ min = 0 and max = 9e+99
_Out-of-Range Action:_ error


#### `CTC_c_under5_bonus`
_Description:_ The maximum amount of child tax credit allowed for each child is increased by this amount for qualifying children under 5 years old.
#### `CTC_c_under6_bonus`
_Description:_ The maximum amount of child tax credit allowed for each child is increased by this amount for qualifying children under 6 years old.
_Has An Effect When Using:_ _PUF data:_ True _CPS data:_ True
_Can Be Inflation Indexed:_ True _Is Inflation Indexed:_ False
_Value Type:_ float
Expand Down Expand Up @@ -3567,8 +3567,8 @@ _Valid Range:_ min = 0 and max = 9e+99
_Out-of-Range Action:_ error


#### `CTC_new_c_under5_bonus`
_Description:_ The maximum amount of the new refundable child tax credit allowed for each child is increased by this amount for qualifying children under 5 years old.
#### `CTC_new_c_under6_bonus`
_Description:_ The maximum amount of the new refundable child tax credit allowed for each child is increased by this amount for qualifying children under 6 years old.
_Has An Effect When Using:_ _PUF data:_ True _CPS data:_ True
_Can Be Inflation Indexed:_ True _Is Inflation Indexed:_ False
_Value Type:_ float
Expand Down Expand Up @@ -3952,8 +3952,25 @@ _Valid Range:_ min = 0 and max = 9e+99
_Out-of-Range Action:_ error


#### `UBI_21`
_Description:_ UBI benefit provided to people 21 and over.
#### `UBI_2164`
_Description:_ UBI benefit provided to people 21-64 years of age.
_Has An Effect When Using:_ _PUF data:_ True _CPS data:_ True
_Can Be Inflation Indexed:_ True _Is Inflation Indexed:_ True
_Value Type:_ float
_Known Values:_
2013: 0.0
2014: 0.0
2015: 0.0
2016: 0.0
2017: 0.0
2018: 0.0
2019: 0.0
_Valid Range:_ min = 0 and max = 9e+99
_Out-of-Range Action:_ error


#### `UBI_65`
_Description:_ UBI benefit provided to people 65 and over.
_Has An Effect When Using:_ _PUF data:_ True _CPS data:_ True
_Can Be Inflation Indexed:_ True _Is Inflation Indexed:_ True
_Value Type:_ float
Expand Down
20 changes: 17 additions & 3 deletions taxcalc/calcfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,8 @@ def SSBenefits(MARS, ymod, e02400, SS_thd50, SS_thd85,


@iterate_jit(nopython=True)
def UBI(nu18, n1820, n21, UBI_u18, UBI_1820, UBI_21, UBI_ecrt,
def UBI(nu18, n1820, n21, age_head, age_spouse, elderly_dependents,
UBI_u18, UBI_1820, UBI_2164, UBI_65, UBI_ecrt,
ubi, taxable_ubi, nontaxable_ubi):
"""
Calculates total and taxable Universal Basic Income (UBI) amount.
Expand All @@ -372,11 +373,19 @@ def UBI(nu18, n1820, n21, UBI_u18, UBI_1820, UBI_21, UBI_ecrt,

n21: Number of people in the tax unit age 21+

age_head: Age of filer head.

age_spouse: Age of spouse.

elderly_dependents: Number of elderly dependents.

UBI_u18: UBI benefit for those under 18

UBI_1820: UBI benefit for those between 18 to 20

UBI_21: UBI benefit for those 21 or more
UBI_2164: UBI benefit for those between 21 to 64

UBI_65: UBI benefit for those aged 65 or older

UBI_ecrt: Fraction of UBI benefits that are not included in AGI

Expand All @@ -388,7 +397,12 @@ def UBI(nu18, n1820, n21, UBI_u18, UBI_1820, UBI_21, UBI_ecrt,

nontaxable_ubi: amount of UBI that is nontaxable
"""
ubi = nu18 * UBI_u18 + n1820 * UBI_1820 + n21 * UBI_21
# Calculate number of people age 65+ as 1 if head is 65+, plus 1 if spouse
# is 65+, plus number of elderly dependents.
n65 = (age_head >= 65) + (age_spouse >= 65) + elderly_dependents
n2164 = n21 - n65
assert n2164 >= 0
ubi = nu18 * UBI_u18 + n1820 * UBI_1820 + n2164 * UBI_2164 + n65 * UBI_65
taxable_ubi = ubi * (1. - UBI_ecrt)
nontaxable_ubi = ubi - taxable_ubi
return ubi, taxable_ubi, nontaxable_ubi
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,4 +737,4 @@ def __getattr__(self, attr):
attr[1:], year=list(range(self.start_year, self.end_year + 1))
)
else:
raise AttributeError(f"{attr} not definied.")
raise AttributeError(f"{attr} not defined.")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, thanks @MaxGhenis!

3 changes: 2 additions & 1 deletion taxcalc/policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ class instance: Policy
'CTC_c_under5_bonus': 'was renamed CTC_c_under6_bonus.',
'ACTC_rt_bonus_under5family':
'was renamed ACTC_rt_bonus_under6family.',
'CTC_new_c_under5_bonus': 'was renamed CTC_new_c_under6_bonus.'
'CTC_new_c_under5_bonus': 'was renamed CTC_new_c_under6_bonus.',
'UBI_21': 'was split into UBI_2164 and UBI_65.'
}
# (2) specify which Policy parameters have been redefined recently
REDEFINED_PARAMS = {}
Expand Down
56 changes: 53 additions & 3 deletions taxcalc/policy_current_law.json
Original file line number Diff line number Diff line change
Expand Up @@ -16005,9 +16005,59 @@
"cps": true
}
},
"UBI_21": {
"title": "UBI benefit for those 21 and over",
"description": "UBI benefit provided to people 21 and over.",
"UBI_2164": {
"title": "UBI benefit for those 21 through 64 over",
"description": "UBI benefit provided to people 21-64 years of age.",
"notes": "",
"section_1": "Universal Basic Income",
"section_2": "UBI Benefits",
"indexable": true,
"indexed": true,
"type": "float",
"value": [
{
"year": 2013,
"value": 0.0
},
{
"year": 2014,
"value": 0.0
},
{
"year": 2015,
"value": 0.0
},
{
"year": 2016,
"value": 0.0
},
{
"year": 2017,
"value": 0.0
},
{
"year": 2018,
"value": 0.0
},
{
"year": 2019,
"value": 0.0
}
],
"validators": {
"range": {
"min": 0,
"max": 9e+99
}
},
"compatible_data": {
"puf": true,
"cps": true
}
},
"UBI_65": {
"title": "UBI benefit for those 65 and over",
"description": "UBI benefit provided to people 65 and over.",
"notes": "",
"section_1": "Universal Basic Income",
"section_2": "UBI Benefits",
Expand Down
3 changes: 2 additions & 1 deletion taxcalc/reforms/2017_law.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,6 @@
"AGI_surtax_thd": {"2017": [9e99, 9e99, 9e99, 9e99, 9e99]},
"UBI_u18": {"2017": 0},
"UBI_1820": {"2017": 0},
"UBI_21": {"2017": 0}
"UBI_2164": {"2017": 0},
"UBI_65": {"2017": 0}
}
5 changes: 3 additions & 2 deletions taxcalc/tests/test_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,8 @@ def test_distribution_tables(cps_subsample):
reform = {
'UBI_u18': {2014: 1000},
'UBI_1820': {2014: 1000},
'UBI_21': {2014: 1000}
'UBI_2164': {2014: 1000},
'UBI_65': {2014: 1000}
}
pol.implement_reform(reform)
assert not pol.parameter_errors
Expand Down Expand Up @@ -865,7 +866,7 @@ def test_calc_all_benefits_amounts(cps_subsample):
Testing how benefits are handled in the calc_all method
'''
# set a reform with a positive UBI amount
ubi_ref = {'UBI_21': {2020: 1000}}
ubi_ref = {'UBI_2164': {2020: 1000}}

# create baseline calculator
pol = Policy()
Expand Down
3 changes: 2 additions & 1 deletion taxcalc/tests/test_compatible_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ def fixture_reform_xx():
'ID_BenefitSurtax_crt': 0.1,
'UBI_u18': 1000,
'UBI_1820': 1000,
'UBI_21': 1000,
'UBI_2164': 1000,
'UBI_65': 1000,
'PT_brk7': [1000000, 1000000, 1000000, 1000000, 1000000],
'II_credit_prt': 0.1,
'II_credit': [100, 100, 100, 100, 100],
Expand Down