-
Notifications
You must be signed in to change notification settings - Fork 183
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
Added YAML files for Age Curve and Rating Areas for SLCSP #5480
base: master
Are you sure you want to change the base?
Added YAML files for Age Curve and Rating Areas for SLCSP #5480
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we want to use a single_amount
type parameter
brackets:
- threshold:
2023-01-01: 0
amount:
2023-01-01: 1
- threshold:
2023-01-01: 21
amount:
2023-01-01: 1.5748
- threshold:
2023-01-01: 25
amount:
2023-01-01: 1.5811
- threshold:
2023-01-01: 30
amount:
2023-01-01: 1.7874
....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
metadata:
type: single_amount
amount_unit: /1
threshold_unit: year
....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similar for all yaml files
@@ -0,0 +1,215 @@ | |||
description: Age curve factors for ACA premium pricing in Alabama, normalized to age |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you rename the file to alabama.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same for all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to docs/gov/aca
and moved the file that generates the yamls
metadata: | ||
type: single_amount | ||
period: year | ||
amount_unit: /1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
amount_unit: /1 | |
amount_unit: /1 | |
threshold_unit: int |
href: https://www.cms.gov/cciio/programs-and-initiatives/health-insurance-market-reforms/downloads/statespecagecrv053117.pdf | ||
brackets: | ||
- threshold: | ||
'0000-01-01': 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'0000-01-01': 0 | |
0000-01-01: 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All time period
And lets use a start date from the references
reference: | ||
- title: CMS Market Rating Reforms State Specific Age Curve Variations | ||
href: https://www.cms.gov/cciio/programs-and-initiatives/health-insurance-market-reforms/downloads/statespecagecrv053117.pdf | ||
values: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
values: |
metadata: | ||
type: amount | ||
period: month | ||
unit: USD/month |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unit: USD/month | |
unit: currency-USD |
@@ -0,0 +1,1043 @@ | |||
description: Second Lowest Cost Silver Plan (SLCSP) premiums by rating area, normalized to age 0. | |||
metadata: | |||
type: amount |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type: amount |
else: | ||
return household("county_fips", period) | ||
|
||
class aca_slspc_trimmed_age(Variable): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets make one class per file:
Lets make aca_slspc_trimmed_age
a new .py file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same for the other classes
person_costs = tax_unit.members("person_aca_slspc", period) | ||
return tax_unit.sum(person_costs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
person_costs = tax_unit.members("person_aca_slspc", period) | |
return tax_unit.sum(person_costs) | |
return add(tax_unit, period, ["person_aca_slspc"] |
policyengine_us/variables/household/demographic/geographic/slspc.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets add unit tests for each individual file, - this will show whether the structure works - I might have more suggestions but would like to see test outputs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok!
…pc.py Co-authored-by: Pavel Makarchuk <[email protected]>
..._us/parameters/gov/hhs/medicaid/geography/standard_county_names/standardized_county_names.py
Outdated
Show resolved
Hide resolved
...engine_us/parameters/gov/hhs/medicaid/geography/standard_county_names/unmatched_counties.txt
Outdated
Show resolved
Hide resolved
breakdown: | ||
- state_code | ||
- range(1, 67) | ||
amount_unit:currency-USD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
amount_unit:currency-USD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete
definition_period = MONTH | ||
|
||
def formula(household, period, parameters): | ||
state = household("state_code", period).decode_to_str() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
state = household("state_code", period).decode_to_str() | |
state = person.household("state_code_str", period) |
|
||
class slspc_age_adjusted_cost(Variable): | ||
value_type = float | ||
entity = Household |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
entity = Household | |
entity = Person |
@@ -0,0 +1,28 @@ | |||
from policyengine_us.model_api import * | |||
|
|||
class slspc_age_adjusted_cost(Variable): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class slspc_age_adjusted_cost(Variable): | |
class slspc_age_adjusted_cost_person(Variable): |
|
||
def formula(household, period, parameters): | ||
state = household("state_code", period).decode_to_str() | ||
age = household("age", period) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
age = household("age", period) | |
age = person("monthly_age", period) |
def formula(household, period, parameters): | ||
state = household("state_code", period).decode_to_str() | ||
age = household("age", period) | ||
base_cost = household("slspc_baseline_cost_at_age_0", period) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
base_cost = household("slspc_baseline_cost_at_age_0", period) | |
base_cost = person.household("slspc_baseline_cost_at_age_0", period) |
special_states = ["district_of_columbia", "alabama", "massachusetts", | ||
"minnesota", "mississippi", "oregon", "utah"] | ||
curve_name = state.lower() if state.lower() in special_states else "default" | ||
age_curve = parameters.gov.aca.age_curves[curve_name] | ||
|
||
# Find applicable bracket | ||
brackets = age_curve.brackets | ||
applicable_bracket = max( | ||
(b for b in brackets if b.threshold <= age), | ||
key=lambda b: b.threshold | ||
) | ||
|
||
return base_cost * applicable_bracket.amount |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions for code:
p = parameters(period).gov.aca.age_curved
applicable_rate = select(
[ state_code == "AL",
state_code == "DC",
....],
[p.alabama.calc(age),
p.district_of_columbia.calc(age),
....],
default = p.default.calc(age),
)
return base_cost * applicable_rate
@@ -0,0 +1,19 @@ | |||
from policyengine_us.model_api import * | |||
|
|||
class slspc_baseline_cost_at_age_0(Variable): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class slspc_baseline_cost_at_age_0(Variable): | |
class slspc_baseline_base_cost(Variable): |
class slspc_baseline_cost_at_age_0(Variable): | ||
value_type = float | ||
entity = Household | ||
label = "Second-lowest ACA silver-plan cost at age 0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
label = "Second-lowest ACA silver-plan cost at age 0" | |
label = "Second-lowest ACA silver-plan base cost" | |
documentation = "Second-lowest ACA silver-plan cost at age 0" |
Fixes #5037