Skip to content

Commit 9f4d22f

Browse files
MaxGhenisclaude
andcommitted
Add SSI takeup variable and apply in benefit calculation
- Add takes_up_ssi_if_eligible with default_value=True - Apply takeup multiplier in ssi.py for microsimulation - Follows new pattern from PR #7326 (no random() in country package) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent c76d5be commit 9f4d22f

File tree

5 files changed

+21
-3
lines changed

5 files changed

+21
-3
lines changed

changelog_entry.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
changes:
33
added:
44
- Add liquid asset input variables (bank_account_assets, stock_assets, bond_assets), ssi_countable_resources, and spm_unit_cash_assets aggregation
5+
- Add takes_up_ssi_if_eligible variable for SSI takeup modeling
56
changed:
67
- SSI resource test now uses actual imputed assets instead of random pass rate
8+
- SSI benefit now applies takeup in microsimulation

policyengine_us/tests/policy/baseline/gov/territories/pr/tax/income/pr_agi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
alimony_expense: 10_000
1515
state_code: PR
1616
output:
17-
pr_agi: 0
17+
pr_agi: 0

policyengine_us/tests/policy/baseline/gov/territories/pr/tax/income/pr_agi_person.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
filing_status: SEPARATE
1515
state_code: PR
1616
output:
17-
pr_agi_person: 20_000
17+
pr_agi_person: 20_000

policyengine_us/variables/gov/ssa/ssi/ssi.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,15 @@ def formula(person, period, parameters):
3030
individual_max = p.individual * MONTHS_IN_YEAR
3131
capped_benefit = min_(benefit, individual_max)
3232

33-
return where(
33+
final_benefit = where(
3434
deeming_applies,
3535
capped_benefit,
3636
benefit,
3737
)
38+
39+
# Apply takeup in microsimulation
40+
takes_up = person("takes_up_ssi_if_eligible", period)
41+
is_in_microsim = hasattr(person.simulation, "dataset")
42+
if is_in_microsim:
43+
return final_benefit * takes_up
44+
return final_benefit
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from policyengine_us.model_api import *
2+
3+
4+
class takes_up_ssi_if_eligible(Variable):
5+
value_type = bool
6+
entity = Person
7+
label = "Takes up SSI if eligible"
8+
definition_period = YEAR
9+
default_value = True

0 commit comments

Comments
 (0)