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

Added YAML files for Age Curve and Rating Areas for SLCSP #5480

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

daphnehanse11
Copy link
Collaborator

@daphnehanse11 daphnehanse11 commented Jan 14, 2025

Fixes #5037

@PavelMakarchuk PavelMakarchuk changed the title Fixes #issue5037 Added YAML files for Age Curve and Rating Areas for SLSCP Added YAML files for Age Curve and Rating Areas for SLSCP Jan 14, 2025
Copy link
Collaborator

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
....

Copy link
Collaborator

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
  ....

Copy link
Collaborator

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
Copy link
Collaborator

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

same for all

Copy link
Collaborator

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

metadata:
type: single_amount
period: year
amount_unit: /1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
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
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
'0000-01-01': 0
0000-01-01: 0

Copy link
Collaborator

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:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
values:

metadata:
type: amount
period: month
unit: USD/month
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
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
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
type: amount

@MaxGhenis MaxGhenis changed the title Added YAML files for Age Curve and Rating Areas for SLSCP Added YAML files for Age Curve and Rating Areas for SLCSP Jan 15, 2025
else:
return household("county_fips", period)

class aca_slspc_trimmed_age(Variable):
Copy link
Collaborator

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

Copy link
Collaborator

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

Comment on lines +110 to +111
person_costs = tax_unit.members("person_aca_slspc", period)
return tax_unit.sum(person_costs)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
person_costs = tax_unit.members("person_aca_slspc", period)
return tax_unit.sum(person_costs)
return add(tax_unit, period, ["person_aca_slspc"]

Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok!

breakdown:
- state_code
- range(1, 67)
amount_unit:currency-USD
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
amount_unit:currency-USD

Copy link
Collaborator

Choose a reason for hiding this comment

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

delete

Copy link
Collaborator

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()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
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
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
entity = Household
entity = Person

@@ -0,0 +1,28 @@
from policyengine_us.model_api import *

class slspc_age_adjusted_cost(Variable):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
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)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
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)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
base_cost = household("slspc_baseline_cost_at_age_0", period)
base_cost = person.household("slspc_baseline_cost_at_age_0", period)

Comment on lines +16 to +28
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
Copy link
Collaborator

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):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
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"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use constant age curve for ACA SLCSP
2 participants