diff --git a/changelog.d/ssi-ineligible-child-allocation-scope.fixed.md b/changelog.d/ssi-ineligible-child-allocation-scope.fixed.md new file mode 100644 index 00000000000..9b326e2b6d8 --- /dev/null +++ b/changelog.d/ssi-ineligible-child-allocation-scope.fixed.md @@ -0,0 +1 @@ +Limit SSI ineligible-child allocations to the co-resident children 20 CFR 416.1160(d) names: in spousal deeming, the couple's children and the claimant's siblings and step-siblings; in parental deeming, the parents' children. Count students under 22 (21 before June 16, 2008) as children, and leave out married children and household heads. Compute SSI and Medicaid deeming budgets month by month, including the student earned-income exclusion, and apply New Hampshire's and Oklahoma's allocation-child rules and Missouri's and Virginia's Medicaid child definitions. diff --git a/policyengine_us/parameters/gov/hhs/medicaid/eligibility/categories/senior_or_disabled/income/deeming/ineligible_child_age_limit.yaml b/policyengine_us/parameters/gov/hhs/medicaid/eligibility/categories/senior_or_disabled/income/deeming/ineligible_child_age_limit.yaml new file mode 100644 index 00000000000..dcb73283f0f --- /dev/null +++ b/policyengine_us/parameters/gov/hhs/medicaid/eligibility/categories/senior_or_disabled/income/deeming/ineligible_child_age_limit.yaml @@ -0,0 +1,136 @@ +description: Medicaid limits parental income allocations to ineligible children under this age in states that use more restrictive eligibility criteria than Supplemental Security Income. +# Values apply from the shared Medicaid income model's coverage baseline. +metadata: + unit: year + period: year + label: Medicaid parental allocation ineligible child age limit + breakdown: + - state_code + reference: + - title: 42 USC 1396a(r)(2) - Income and resource methodologies + href: https://www.govinfo.gov/content/pkg/USCODE-2024-title42/html/USCODE-2024-title42-chap7-subchapXIX-sec1396a.htm + - title: 42 CFR 435.601(d)(2)-(3) - Income and resource methodologies + href: https://www.ecfr.gov/current/title-42/section-435.601#p-435.601(d)(2) + - title: Missouri DSS 0805.020.15 - Deeming Parental Income, step 1 + href: https://dssmanuals.mo.gov/mo-healthnet-for-the-aged-blind-and-disabled/0805-000-00/0805-020-00/0805-020-15/ + - title: Virginia Medicaid Manual M0530.002 B.2 - Nonblind Nondisabled Child + href: https://www.dmas.virginia.gov/media/mghpujpo/m05-1-1-26.pdf#page=57 + +AL: + 2015-01-01: .inf +AK: + 2015-01-01: .inf +AZ: + 2015-01-01: .inf +AR: + 2015-01-01: .inf +CA: + 2015-01-01: .inf +CO: + 2015-01-01: .inf +CT: + 2015-01-01: .inf +DE: + 2015-01-01: .inf +FL: + 2015-01-01: .inf +GA: + 2015-01-01: .inf +HI: + 2015-01-01: .inf +ID: + 2015-01-01: .inf +IL: + 2015-01-01: .inf +IN: + 2015-01-01: .inf +IA: + 2015-01-01: .inf +KS: + 2015-01-01: .inf +KY: + 2015-01-01: .inf +LA: + 2015-01-01: .inf +ME: + 2015-01-01: .inf +MD: + 2015-01-01: .inf +MA: + 2015-01-01: .inf +MI: + 2015-01-01: .inf +MN: + 2015-01-01: .inf +MS: + 2015-01-01: .inf +MO: + 2015-01-01: 18 +MT: + 2015-01-01: .inf +NE: + 2015-01-01: .inf +NV: + 2015-01-01: .inf +NH: + 2015-01-01: .inf +NJ: + 2015-01-01: .inf +NM: + 2015-01-01: .inf +NY: + 2015-01-01: .inf +NC: + 2015-01-01: .inf +ND: + 2015-01-01: .inf +OH: + 2015-01-01: .inf +OK: + 2015-01-01: .inf +OR: + 2015-01-01: .inf +PA: + 2015-01-01: .inf +RI: + 2015-01-01: .inf +SC: + 2015-01-01: .inf +SD: + 2015-01-01: .inf +TN: + 2015-01-01: .inf +TX: + 2015-01-01: .inf +UT: + 2015-01-01: .inf +VT: + 2015-01-01: .inf +VA: + 2015-01-01: 21 +WA: + 2015-01-01: .inf +WV: + 2015-01-01: .inf +WI: + 2015-01-01: .inf +WY: + 2015-01-01: .inf +DC: + 2015-01-01: .inf +GU: + 2015-01-01: .inf +MP: + 2015-01-01: .inf +PW: + 2015-01-01: .inf +PR: + 2015-01-01: .inf +VI: + 2015-01-01: .inf +AA: + 2015-01-01: .inf +AE: + 2015-01-01: .inf +AP: + 2015-01-01: .inf diff --git a/policyengine_us/parameters/gov/hhs/medicaid/eligibility/categories/senior_or_disabled/income/deeming/ineligible_child_requires_nonblind_nondisabled.yaml b/policyengine_us/parameters/gov/hhs/medicaid/eligibility/categories/senior_or_disabled/income/deeming/ineligible_child_requires_nonblind_nondisabled.yaml new file mode 100644 index 00000000000..e0a88c8ac21 --- /dev/null +++ b/policyengine_us/parameters/gov/hhs/medicaid/eligibility/categories/senior_or_disabled/income/deeming/ineligible_child_requires_nonblind_nondisabled.yaml @@ -0,0 +1,131 @@ +description: Medicaid requires ineligible children to be neither blind nor disabled for parental income allocations in these states. +metadata: + unit: bool + period: year + label: Medicaid parental allocation requires nonblind nondisabled child + breakdown: + - state_code + reference: + - title: 42 USC 1396a(r)(2) - Income and resource methodologies + href: https://www.govinfo.gov/content/pkg/USCODE-2024-title42/html/USCODE-2024-title42-chap7-subchapXIX-sec1396a.htm + - title: Virginia Medicaid Manual M0530.002 B.2 - Nonblind Nondisabled Child + href: https://www.dmas.virginia.gov/media/mghpujpo/m05-1-1-26.pdf#page=57 + +AL: + 2015-01-01: false +AK: + 2015-01-01: false +AZ: + 2015-01-01: false +AR: + 2015-01-01: false +CA: + 2015-01-01: false +CO: + 2015-01-01: false +CT: + 2015-01-01: false +DE: + 2015-01-01: false +FL: + 2015-01-01: false +GA: + 2015-01-01: false +HI: + 2015-01-01: false +ID: + 2015-01-01: false +IL: + 2015-01-01: false +IN: + 2015-01-01: false +IA: + 2015-01-01: false +KS: + 2015-01-01: false +KY: + 2015-01-01: false +LA: + 2015-01-01: false +ME: + 2015-01-01: false +MD: + 2015-01-01: false +MA: + 2015-01-01: false +MI: + 2015-01-01: false +MN: + 2015-01-01: false +MS: + 2015-01-01: false +MO: + 2015-01-01: false +MT: + 2015-01-01: false +NE: + 2015-01-01: false +NV: + 2015-01-01: false +NH: + 2015-01-01: false +NJ: + 2015-01-01: false +NM: + 2015-01-01: false +NY: + 2015-01-01: false +NC: + 2015-01-01: false +ND: + 2015-01-01: false +OH: + 2015-01-01: false +OK: + 2015-01-01: false +OR: + 2015-01-01: false +PA: + 2015-01-01: false +RI: + 2015-01-01: false +SC: + 2015-01-01: false +SD: + 2015-01-01: false +TN: + 2015-01-01: false +TX: + 2015-01-01: false +UT: + 2015-01-01: false +VT: + 2015-01-01: false +VA: + 2015-01-01: true +WA: + 2015-01-01: false +WV: + 2015-01-01: false +WI: + 2015-01-01: false +WY: + 2015-01-01: false +DC: + 2015-01-01: false +GU: + 2015-01-01: false +MP: + 2015-01-01: false +PW: + 2015-01-01: false +PR: + 2015-01-01: false +VI: + 2015-01-01: false +AA: + 2015-01-01: false +AE: + 2015-01-01: false +AP: + 2015-01-01: false diff --git a/policyengine_us/parameters/gov/ssa/ssi/eligibility/child/deeming_student_age_limit.yaml b/policyengine_us/parameters/gov/ssa/ssi/eligibility/child/deeming_student_age_limit.yaml new file mode 100644 index 00000000000..a788b1884cb --- /dev/null +++ b/policyengine_us/parameters/gov/ssa/ssi/eligibility/child/deeming_student_age_limit.yaml @@ -0,0 +1,14 @@ +description: The Social Security Administration treats a student regularly attending school as an ineligible child for deeming below this age. + +values: + 1974-01-01: 21 + 2008-06-16: 22 +metadata: + label: SSI ineligible child deeming student age limit + unit: year + period: year + reference: + - title: POMS SI 01310.115 A.3 - Ineligible child for deeming purposes + href: https://secure.ssa.gov/poms.nsf/lnx/0501310115 + - title: 73 FR 28033 - Parent-to-Child Deeming From Stepparents, effective June 16, 2008 + href: https://www.federalregister.gov/documents/2008/05/15/E8-10800/parent-to-child-deeming-from-stepparents diff --git a/policyengine_us/parameters/gov/states/nh/dhhs/ssp/ineligible_child/age_limit.yaml b/policyengine_us/parameters/gov/states/nh/dhhs/ssp/ineligible_child/age_limit.yaml new file mode 100644 index 00000000000..c00445f2b68 --- /dev/null +++ b/policyengine_us/parameters/gov/states/nh/dhhs/ssp/ineligible_child/age_limit.yaml @@ -0,0 +1,10 @@ +description: New Hampshire counts a sibling under this age as an ineligible child when it allocates parental income to a blind or disabled child under the adult category financial assistance program. +values: + 2012-04-04: 18 + +metadata: + unit: year + label: New Hampshire SSP ineligible child age limit + reference: + - title: He-W 652.03(h)(1) + href: https://gc.nh.gov/rules/state_agencies/he-w600.html diff --git a/policyengine_us/parameters/gov/states/nh/dhhs/ssp/ineligible_child/secondary_student_age_limit.yaml b/policyengine_us/parameters/gov/states/nh/dhhs/ssp/ineligible_child/secondary_student_age_limit.yaml new file mode 100644 index 00000000000..35ef1642ca5 --- /dev/null +++ b/policyengine_us/parameters/gov/states/nh/dhhs/ssp/ineligible_child/secondary_student_age_limit.yaml @@ -0,0 +1,10 @@ +description: New Hampshire counts a sibling under this age who is a full-time student in a secondary school, or in equivalent vocational or technical training, as an ineligible child when it allocates parental income under the adult category financial assistance program. +values: + 2012-04-04: 20 + +metadata: + unit: year + label: New Hampshire SSP ineligible child secondary student age limit + reference: + - title: He-W 652.03(h)(1) + href: https://gc.nh.gov/rules/state_agencies/he-w600.html diff --git a/policyengine_us/parameters/gov/states/ok/dhs/ssp/ineligible_child_age_limit.yaml b/policyengine_us/parameters/gov/states/ok/dhs/ssp/ineligible_child_age_limit.yaml new file mode 100644 index 00000000000..a04f6564d50 --- /dev/null +++ b/policyengine_us/parameters/gov/states/ok/dhs/ssp/ineligible_child_age_limit.yaml @@ -0,0 +1,12 @@ +description: Oklahoma counts a child under this age who is not blind or disabled as an ineligible child under the State Supplemental Payment program. +values: + 2026-01-01: 18 + +metadata: + unit: year + label: Oklahoma SSP ineligible child age limit + reference: + - title: OAC 340:15-1-2, definition of ineligible child, as proposed in OKDHS circulation WF 22-15 (January 18, 2022) + href: https://oklahoma.gov/content/dam/ok/en/okdhs/documents/okdhs-pdf-library/policy/proposed-policy/2022-perms/22-15%20Circulation.pdf#page=7 + - title: OAC 340:15-1-6(b)(1) + href: https://www.law.cornell.edu/regulations/oklahoma/OAC-340-15-1-6 diff --git a/policyengine_us/tests/core/test_ssi_annual_income_inputs.py b/policyengine_us/tests/core/test_ssi_annual_income_inputs.py new file mode 100644 index 00000000000..92c44fcef8b --- /dev/null +++ b/policyengine_us/tests/core/test_ssi_annual_income_inputs.py @@ -0,0 +1,222 @@ +"""SSI monthly budgets must preserve existing annual input overrides. + +Policy examples and monthly allocation caps are covered in YAML. These tests +exercise Core's period conversion, supplied-input detection and branch caches, +which require the Python API. Small Core systems reuse production variable +classes and either share read-only country parameters or supply only +abolition flags. They never construct or copy another country model. +This belongs to Rest/core. +""" + +import numpy as np +import pytest +from policyengine_core.parameters import ParameterNode +from policyengine_core.periods import period as make_period +from policyengine_core.simulations import Simulation +from policyengine_core.taxbenefitsystems import TaxBenefitSystem + +from policyengine_us.entities import Household, MaritalUnit, Person, TaxUnit +from policyengine_us.system import system as country_system +from policyengine_us.tools.period_branch import get_override_branch +from policyengine_us.variables.gov.ssa.ssi.eligibility.income.deemed.from_ineligible_spouse._ssi_annual_spousal_deeming import ( + ssi_budget_spousal_deeming_applies, +) + +YEAR = 2026 +MONTH = "2026-01" +ANNUAL_CURRENCY_VARIABLES = ( + "ssi_countable_income", + "ssi_unearned_income_deemed_from_ineligible_parent", + "ssi_earned_income_deemed_from_ineligible_spouse", + "ssi_unearned_income_deemed_from_ineligible_spouse", + "ssi_income_deemed_from_ineligible_spouse", + "ssi_ineligible_child_allocation", + "ssi_in_kind_support_and_maintenance", + "ssi_pmv_amount", + "medicaid_optional_senior_or_disabled_countable_income", + "medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent", + "medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse", +) + +ANNUAL_INPUT_VARIABLES = (*ANNUAL_CURRENCY_VARIABLES, "is_ssi_spousal_deeming_applies") + + +def make_small_system(parameters): + result = TaxBenefitSystem(entities=[Person, MaritalUnit, TaxUnit, Household]) + names = ( + "parent_1_id", + "parent_2_id", + "person_id", + "is_tax_unit_head_or_spouse", + "is_tax_unit_dependent", + "tax_unit_married", + "is_ssi_eligible_individual", + "is_ssi_ineligible_spouse", + "ssi_earned_income", + "ssi_unearned_income", + "ssi_spousal_deeming_child_allocations", + *ANNUAL_INPUT_VARIABLES, + *(f"{name}_monthly" for name in ANNUAL_INPUT_VARIABLES), + ) + result.add_variables(*(type(country_system.variables[name]) for name in names)) + result.parameters = parameters + return result + + +@pytest.fixture(scope="module") +def small_system(): + return make_small_system(country_system.parameters) + + +@pytest.mark.parametrize("input_period", [YEAR, MONTH]) +@pytest.mark.parametrize("name", ANNUAL_INPUT_VARIABLES) +def test_annual_input_overrides_reach_monthly_budgets(small_system, name, input_period): + amount = 1_200 if name in ANNUAL_CURRENCY_VARIABLES else True + monthly = 100 if name in ANNUAL_CURRENCY_VARIABLES else True + changed = 2_400 if name in ANNUAL_CURRENCY_VARIABLES else False + changed_monthly = 200 if name in ANNUAL_CURRENCY_VARIABLES else False + simulation = Simulation( + tax_benefit_system=small_system, + situation={ + "people": { + "claimant": { + name: {input_period: amount}, + # Supplied inputs bypass the formula's eligibility gate. + "is_ssi_eligible_individual": {YEAR: False}, + } + }, + "marital_units": {"unit": {"members": ["claimant"]}}, + }, + ) + assert small_system.variables[name].definition_period == "year" + np.testing.assert_array_equal(simulation.calculate(name, YEAR), [amount]) + np.testing.assert_array_equal(simulation.calculate(name, MONTH), [monthly]) + np.testing.assert_array_equal( + simulation.calculate(f"{name}_monthly", MONTH), [monthly] + ) + + branch = get_override_branch( + simulation, "annual_override", YEAR, {name: np.array([changed])} + ) + np.testing.assert_array_equal( + branch.calculate(f"{name}_monthly", MONTH), [changed_monthly] + ) + np.testing.assert_array_equal( + simulation.calculate(f"{name}_monthly", MONTH), [monthly] + ) + + +def spouse_income_simulation(system, allocations): + return Simulation( + tax_benefit_system=system, + situation={ + "people": { + "claimant": { + "person_id": {YEAR: 1}, + "is_tax_unit_head_or_spouse": {YEAR: True}, + "is_tax_unit_dependent": {YEAR: False}, + "is_ssi_ineligible_spouse": {YEAR: False}, + "ssi_earned_income": {YEAR: 0}, + "ssi_unearned_income": {YEAR: 0}, + "ssi_spousal_deeming_child_allocations": allocations, + }, + "spouse": { + "person_id": {YEAR: 2}, + "is_tax_unit_head_or_spouse": {YEAR: True}, + "is_tax_unit_dependent": {YEAR: False}, + "is_ssi_ineligible_spouse": {YEAR: True}, + "ssi_earned_income": {YEAR: 12_000}, + "ssi_unearned_income": {YEAR: 0}, + "ssi_spousal_deeming_child_allocations": { + month: 0 for month in allocations + }, + }, + }, + "marital_units": {"couple": {"members": ["claimant", "spouse"]}}, + "tax_units": { + "couple": { + "members": ["claimant", "spouse"], + "tax_unit_married": {YEAR: True}, + } + }, + "households": {"home": {"members": ["claimant", "spouse"]}}, + }, + ) + + +def test_computed_annual_cache_does_not_replace_monthly_budgets(small_system): + name = "ssi_earned_income_deemed_from_ineligible_spouse" + allocations = { + f"2026-{month:02d}": 0 if month <= 6 else 200 for month in range(1, 13) + } + simulation = spouse_income_simulation(small_system, allocations) + # Six months of $1,000 and six of $800 are not $900 in every month. + np.testing.assert_array_equal(simulation.calculate(name, YEAR), [10_800, 0]) + np.testing.assert_array_equal( + simulation.calculate(f"{name}_monthly", MONTH), [1_000, 0] + ) + np.testing.assert_array_equal( + simulation.calculate(f"{name}_monthly", "2026-07"), [800, 0] + ) + + if hasattr(simulation, "_get_store_history"): + # Core 3.33+ invalidates inherited calculations on direct set_input. + branch = simulation.get_branch("first_annual_override") + branch.set_input(name, YEAR, [24_000, 0]) + else: + branch = get_override_branch( + simulation, "first_annual_override", YEAR, {name: np.array([24_000, 0])} + ) + np.testing.assert_array_equal( + branch.calculate(f"{name}_monthly", MONTH), [2_000, 0] + ) + np.testing.assert_array_equal( + simulation.calculate(f"{name}_monthly", MONTH), [1_000, 0] + ) + + +@pytest.mark.parametrize( + "mode, expected", + [("normal", 1_000), ("neutralized", 0), ("abolished", 0)], +) +def test_disabled_annual_interface_reaches_monthly_budget(mode, expected): + name = "ssi_earned_income_deemed_from_ineligible_spouse" + parameters = ParameterNode( + "", + data={ + "gov": { + "abolitions": {name: {"values": {"2026-01-01": mode == "abolished"}}} + } + }, + ) + system = make_small_system(parameters) + if mode == "neutralized": + system.neutralize_variable(name) + simulation = spouse_income_simulation(system, {MONTH: 0}) + + # Raw spouse earnings would otherwise deem 1,000 in this month. + np.testing.assert_array_equal( + simulation.calculate("ssi_earned_income", MONTH), [0, 1_000] + ) + np.testing.assert_array_equal( + simulation.calculate(f"{name}_monthly", MONTH), [expected, 0] + ) + + +def test_abolished_deeming_flag_reaches_annual_screens_as_a_boolean_array(): + name = "is_ssi_spousal_deeming_applies" + parameters = ParameterNode( + "", data={"gov": {"abolitions": {name: {"values": {"2026-01-01": True}}}}} + ) + simulation = spouse_income_simulation(make_small_system(parameters), {MONTH: 0}) + person = simulation.populations["person"] + + flag = ssi_budget_spousal_deeming_applies( + person, make_period(str(YEAR)), parameters + ) + # The input adapter returns a scalar zero for an abolished name. Annual + # screens negate the flag and pass it to select, which takes boolean + # arrays only. + assert flag.dtype == bool + np.testing.assert_array_equal(flag, [False, False]) + np.testing.assert_array_equal(np.select([flag, ~flag], [1, 2]), [2, 2]) diff --git a/policyengine_us/tests/core/test_ssi_monthly_ism_properties.py b/policyengine_us/tests/core/test_ssi_monthly_ism_properties.py index 263b95b4c82..33e4ac69e74 100644 --- a/policyengine_us/tests/core/test_ssi_monthly_ism_properties.py +++ b/policyengine_us/tests/core/test_ssi_monthly_ism_properties.py @@ -20,17 +20,17 @@ from policyengine_core.periods import period as make_period from policyengine_us import Simulation from policyengine_us.system import system -from policyengine_us.variables.gov.ssa.ssi.eligibility.income.ism.ssi_in_kind_support_and_maintenance import ( - ssi_in_kind_support_and_maintenance, +from policyengine_us.variables.gov.ssa.ssi.eligibility.income.ism.ssi_in_kind_support_and_maintenance_monthly import ( + ssi_in_kind_support_and_maintenance_monthly, ) -from policyengine_us.variables.gov.ssa.ssi.eligibility.income.ism.ssi_pmv_amount import ( - ssi_pmv_amount, +from policyengine_us.variables.gov.ssa.ssi.eligibility.income.ism.ssi_pmv_amount_monthly import ( + ssi_pmv_amount_monthly, ) from policyengine_us.variables.gov.ssa.ssi.eligibility.income.ism.ssi_pmv_applies import ( ssi_pmv_applies, ) -from policyengine_us.variables.gov.ssa.ssi.eligibility.income.ssi_countable_income import ( - ssi_countable_income, +from policyengine_us.variables.gov.ssa.ssi.eligibility.income.ssi_countable_income_monthly import ( + ssi_countable_income_monthly, ) from policyengine_us.variables.gov.ssa.ssi.eligibility.status.ssi_federal_living_arrangement import ( SSIFederalLivingArrangement, @@ -283,9 +283,9 @@ def results(): values = { name: sim.calculate(name, period) for name in ( - "ssi_countable_income", - "ssi_in_kind_support_and_maintenance", - "ssi_pmv_amount", + "ssi_countable_income_monthly", + "ssi_in_kind_support_and_maintenance_monthly", + "ssi_pmv_amount_monthly", "ssi", "is_ssi_eligible_individual", ) @@ -299,7 +299,10 @@ def results(): out["independent_2026"] = _independent_reference_values(sim, reference_rows) out["actual_2026"] = _supplement_values(sim, reference_rows) out["reference_rows"] = reference_rows - for name in ("ssi_countable_income", "ssi_resources_deemed_from_ineligible_parent"): + for name in ( + "ssi_countable_income_monthly", + "ssi_resources_deemed_from_ineligible_parent", + ): out[name] = sim.calculate(name, "2026-01") return out, food_only, no_income @@ -317,19 +320,24 @@ def _months(out, year, name, months=range(1, 13)): @pytest.mark.parametrize("year", [2023, 2025]) def test_months_match_when_nothing_changes_within_the_year(results, year): out, _, _ = results - for name in ("ssi_countable_income", "ssi_in_kind_support_and_maintenance"): + for name in ( + "ssi_countable_income_monthly", + "ssi_in_kind_support_and_maintenance_monthly", + ): values = _months(out, year, name) _assert_constant(values) for name in ("ssi", *(SUPPLEMENTS[state] for state in STATES)): values = _months(out, year, name) _assert_constant(values) np.testing.assert_allclose( - out[year][:N], 12 * _months(out, year, "ssi_countable_income")[0], rtol=1e-6 + out[year][:N], + 12 * _months(out, year, "ssi_countable_income_monthly")[0], + rtol=1e-6, ) # ISM is capped by the PMV, a monthly amount (one-third of the federal # benefit rate plus $20, well under $600), not an annual one. - ism = _months(out, year, "ssi_in_kind_support_and_maintenance") - pmv = _months(out, year, "ssi_pmv_amount") + ism = _months(out, year, "ssi_in_kind_support_and_maintenance_monthly") + pmv = _months(out, year, "ssi_pmv_amount_monthly") assert np.all(ism <= pmv + 1e-6) assert np.all(pmv < 600) @@ -339,7 +347,7 @@ def test_2024_food_income_changes_payments_from_december(results): before = range(1, 12) after = [12] for name in ( - "ssi_countable_income", + "ssi_countable_income_monthly", "ssi", *(SUPPLEMENTS[state] for state in STATES), ): @@ -350,7 +358,7 @@ def test_2024_food_income_changes_payments_from_december(results): late = _months(out, 2024, name, after)[:, food_only] _assert_constant(early) _assert_constant(late) - late_ism = _months(out, 2024, "ssi_in_kind_support_and_maintenance", after) + late_ism = _months(out, 2024, "ssi_in_kind_support_and_maintenance_monthly", after) assert not late_ism[:, food_only].any() ssi_nov = _months(out, 2024, "ssi", [11])[0] ssi_dec = _months(out, 2024, "ssi", [12])[0] @@ -364,7 +372,7 @@ def test_continuing_food_support_counts_eleven_income_months(results): assert checked.any() # January-November payments use income months before the September 30 # exclusion. ISM = 11 * (943 / 3 + 20) = 3,677.666667 annually. - ism = _months(out, 2024, "ssi_in_kind_support_and_maintenance")[:, checked] + ism = _months(out, 2024, "ssi_in_kind_support_and_maintenance_monthly")[:, checked] np.testing.assert_allclose(ism.sum(axis=0), 11 * (943 / 3 + 20), atol=1e-3) np.testing.assert_allclose(ism[:11], 943 / 3 + 20, atol=1e-4) np.testing.assert_array_equal(ism[11], 0) @@ -402,7 +410,9 @@ def test_reference_households_share_parental_resources_and_couple_income(results rows = out["reference_rows"][state]["people"] # The couple receives $14,400 / 12 = $1,200 monthly unearned # income. After the $20 exclusion, each spouse counts $590. - np.testing.assert_allclose(out["ssi_countable_income"][rows], [590, 590]) + np.testing.assert_allclose( + out["ssi_countable_income_monthly"][rows], [590, 590] + ) @pytest.mark.parametrize( @@ -501,7 +511,7 @@ def test_couple_food_pmv_uses_payment_rate_and_splits_countable_income(month): zero = np.zeros(3) values = { "ssi_couple_computation_applies": np.array([False, True, False]), - "is_ssi_spousal_deeming_applies": np.array([False, False, True]), + "is_ssi_spousal_deeming_applies_monthly": np.array([False, False, True]), "ssi_federal_living_arrangement": SSIFederalLivingArrangement.OWN_HOUSEHOLD, "ssi_receives_food_from_others": np.ones(3, dtype=bool), "ssi_receives_outside_shelter_support": zero.astype(bool), @@ -513,7 +523,7 @@ def test_couple_food_pmv_uses_payment_rate_and_splits_countable_income(month): "ssi_marital_unearned_income": zero, "ssi_earned_income": zero, "ssi_unearned_income": zero, - "ssi_unearned_income_deemed_from_ineligible_parent": zero, + "ssi_unearned_income_deemed_from_ineligible_parent_monthly": zero, "ssi_income_deemed_from_ineligible_spouse_monthly": zero, "is_ssi_aged_blind_disabled": np.ones(3, dtype=bool), "is_child": zero.astype(bool), @@ -522,6 +532,18 @@ def test_couple_food_pmv_uses_payment_rate_and_splits_countable_income(month): def person(name, period): return values[name] + # Direct formula calls supply monthly values and no annual overrides. + # Keep the normal annual-input check with an empty input receipt store. + person.simulation = SimpleNamespace( + get_holder=lambda name: SimpleNamespace( + variable=system.variables[name], + get_known_branch_periods=lambda: (), + _record_store=lambda period, sequence_number: None, + ), + tax_benefit_system=system, + _get_visible_branch_names=lambda: ("default",), + ) + def parameters(period): instant = getattr(period, "start", period) return SimpleNamespace( @@ -535,9 +557,12 @@ def parameters(period): formulas = ( ("ssi_pmv_applies", ssi_pmv_applies), - ("ssi_pmv_amount", ssi_pmv_amount), - ("ssi_in_kind_support_and_maintenance", ssi_in_kind_support_and_maintenance), - ("ssi_countable_income", ssi_countable_income), + ("ssi_pmv_amount_monthly", ssi_pmv_amount_monthly), + ( + "ssi_in_kind_support_and_maintenance_monthly", + ssi_in_kind_support_and_maintenance_monthly, + ), + ("ssi_countable_income_monthly", ssi_countable_income_monthly), ("ssi_amount_if_eligible", ssi_amount_if_eligible), ( "uncapped_ssi_without_spousal_deeming", @@ -553,14 +578,14 @@ def parameters(period): # Spousal deeming uses half that PMV: 245.833333. January and February # retain the payment month's rate while reading the prior year's food dates. np.testing.assert_allclose( - values["ssi_pmv_amount"], + values["ssi_pmv_amount_monthly"], [943 / 3 + 20, 1_415 / 3 + 20, (1_415 / 3 + 20) / 2], ) # Through November each spouse counts (491.666667 - 20) / 2 = # 235.833333, then receives 1,415 / 2 - 235.833333 = 471.666667. # December excludes food, so each spouse receives 1,415 / 2 = 707.50. countable = 0 if month == 12 else 1_415 / 6 - assert values["ssi_countable_income"][1] == pytest.approx(countable) + assert values["ssi_countable_income_monthly"][1] == pytest.approx(countable) assert values["ssi_amount_if_eligible"][1] == pytest.approx(1_415 / 2) assert values["ssi_if_takes_up"][1] == pytest.approx(1_415 / 2 - countable) # Under deeming, 416.1163(e)(2) limits the payment to the individual rate @@ -586,10 +611,9 @@ def test_annual_countable_income_input_reaches_each_month(): "households": {"h": {"members": ["p"], "state_code": {"2025": "FL"}}}, } ) - for month in range(1, 13): - assert sim.calculate("ssi_countable_income", f"2025-{month:02d}")[ - 0 - ] == pytest.approx(500) + for name in ("ssi_countable_income", "ssi_countable_income_monthly"): + for month in range(1, 13): + assert sim.calculate(name, f"2025-{month:02d}")[0] == pytest.approx(500) @pytest.mark.parametrize("year", YEARS) @@ -598,8 +622,8 @@ def test_month_countable_income_is_that_months_ism_without_other_income(results, # is (20 CFR 416.1124, as _apply_ssi_exclusions_monthly applies it). With # no other income, each month's countable income is its ISM less $20. out, _, no_income = results - ism = _months(out, year, "ssi_in_kind_support_and_maintenance") - countable = _months(out, year, "ssi_countable_income") + ism = _months(out, year, "ssi_in_kind_support_and_maintenance_monthly") + countable = _months(out, year, "ssi_countable_income_monthly") # Countable income is computed only for an eligible individual or spouse; # these units are single people. eligible = _months(out, year, "is_ssi_eligible_individual").astype(bool) diff --git a/policyengine_us/tests/core/test_ssi_monthly_state_readers.py b/policyengine_us/tests/core/test_ssi_monthly_state_readers.py index 271c224362e..8727b4c8f5c 100644 --- a/policyengine_us/tests/core/test_ssi_monthly_state_readers.py +++ b/policyengine_us/tests/core/test_ssi_monthly_state_readers.py @@ -53,7 +53,9 @@ def _situation(profiles, annual_earned, annual_unearned): "is_ssi_qualified_noncitizen": {YEAR: False}, "ssi_earned_income": {YEAR: annual_earned}, "ssi_unearned_income": {YEAR: annual_unearned}, - "ssi_in_kind_support_and_maintenance": dict(zip(MONTHS, profile)), + "ssi_in_kind_support_and_maintenance_monthly": dict( + zip(MONTHS, profile) + ), } if state == "MD": values.update( diff --git a/policyengine_us/tests/core/test_ssi_spousal_deeming_child_allocations.py b/policyengine_us/tests/core/test_ssi_spousal_deeming_child_allocations.py new file mode 100644 index 00000000000..a80cc620ec1 --- /dev/null +++ b/policyengine_us/tests/core/test_ssi_spousal_deeming_child_allocations.py @@ -0,0 +1,547 @@ +"""Invariants of the SSI ineligible-child allocation in spousal deeming. + +Under 20 CFR 416.1163(b), SSA deducts an allocation from an ineligible +spouse's income for each ineligible child. In 416.1160(d), SSA defines one +as a child of the claimant, of the claimant's spouse, or 'of your parent or +of your parent's spouse', who lives in the same household with the claimant +and is not eligible for SSI benefits. Each Hypothesis example builds a batch +of random households (a married couple, their children, step-children, +grandchildren, each spouse's siblings, unrelated children and other adults, +some living elsewhere, filed in assorted tax units, with parent ids on +everyone, no one or some people), adds a fixed set of sibling households, +and checks: + +1. Differential: every person's ssi_spousal_deeming_child_allocations + equals an oracle written here from the regulation and the parent-link + contract in household/demographic/person/_parent_links.py, without the + model. The oracle knows each person's true parents, so with ids it is + the regulation itself. Without ids it is the documented proxy: the + co-resident members of the person's or the spouse's tax unit, and in a + household with links only for an unlinked parent. +2. Spouses see the same total for the couple's children: a child of either + spouse is a child of 'you or your spouse' for both. A spouse's own + sibling, the child 'of your parent', adds to that spouse's total alone. +3. Order: listing each household's people in reverse gives the same totals. +4. Monotonicity: raising every child's unearned income never raises a + total (416.1163(b)(2)). +5. Deemed unearned income is the spouse's unearned income less the total, + floored at zero (416.1163(b)(3)). + +A second test checks each child's own allocation against a month-by-month +oracle of 416.1163(b)(1)-(2) and 416.1161(c): the student earned income +exclusion runs month by month until its yearly limit is used up, each +month's allocation is floored at zero, and a loss counts as no income. It also checks the bounds and that +more income never raises an allocation. + +Each spouse's parent lives outside the simulation here, so YAML covers a +sibling whose parent lives in the household and a step-sibling, with the +other worked cases. This file routes to the Rest/core group. +""" + +import numpy as np +from hypothesis import given, settings +from hypothesis import strategies as st + +from policyengine_us import Simulation + +YEAR = 2026 +# 416.1163(b)(1): the couple rate ($1,491) less the individual rate ($994). +MONTHLY_ALLOCATION = 1_491 - 994 +CHILD_AGE = 18 # 416.1856(a)(1) +STUDENT_AGE = 22 # 416.1856(a)(2) +ABSENT_PARENT_ID = 999_999 +# Each spouse's own parent lives outside the simulation and has an id of +# their own, which that spouse and the parent's other children carry. +CLAIMANT_PARENT_ID = 700_000 +SPOUSE_PARENT_ID = 800_000 +HOUSEHOLDS_PER_EXAMPLE = 30 +# 416.1112(c)(3) student earned income exclusion in 2026 (POMS SI 00820.510). +STUDENT_MONTHLY_EXCLUSION = 2_410 +STUDENT_YEARLY_EXCLUSION = 9_730 + +CHILD_KINDS = ( + "claimant", + "spouse", + "both", + "grandchild", + "unrelated", + "sibling", + "in_law", +) +OTHER = st.fixed_dictionaries( + { + "kind": st.sampled_from(CHILD_KINDS + ("adult",)), + "age": st.integers(0, 23), + "student": st.booleans(), + "monthly_unearned": st.sampled_from((0, 150, 600)), + # About one in four lives in another household. + "away": st.sampled_from((False, False, False, True)), + "tax_unit": st.sampled_from(("couple", "spouse", "own", "adult")), + "has_ids": st.booleans(), + } +) +HOUSEHOLD = st.fixed_dictionaries( + { + "aged_claimant": st.booleans(), + "spouse_unearned": st.sampled_from((0, 300, 600, 1_200)), + "spouse_files_separately": st.booleans(), + "ids": st.sampled_from(("none", "all", "some")), + "claimant_has_ids": st.booleans(), + "spouse_has_ids": st.booleans(), + "report_own_children": st.booleans(), + "others": st.lists(OTHER, min_size=0, max_size=5), + } +) +BATCH = st.lists( + HOUSEHOLD, min_size=HOUSEHOLDS_PER_EXAMPLE, max_size=HOUSEHOLDS_PER_EXAMPLE +) + + +def _sibling_household(kind, ids="all", claimant_has_ids=True, spouse_has_ids=True): + """A couple and one 10-year-old with no income, in the couple's tax unit.""" + return { + "aged_claimant": False, + "spouse_unearned": 1_200, + "spouse_files_separately": False, + "ids": ids, + "claimant_has_ids": claimant_has_ids, + "spouse_has_ids": spouse_has_ids, + "report_own_children": False, + "others": [ + { + "kind": kind, + "age": 10, + "student": False, + "monthly_unearned": 0, + "away": False, + "tax_unit": "couple", + "has_ids": True, + } + ], + } + + +# Every example also holds these households, so each run checks the sibling +# scope whatever Hypothesis draws. The pairs give the claimant's total and +# the spouse's. +ONE_CHILD = 12 * MONTHLY_ALLOCATION +SIBLING_HOUSEHOLDS = ( + # The claimant's sibling counts for the claimant alone. + (_sibling_household("sibling"), (ONE_CHILD, 0)), + # The spouse's sibling counts for the spouse alone, and deeming reads + # the claimant's total. + (_sibling_household("in_law"), (0, ONE_CHILD)), + # A sibling's id finds no one when the claimant carries no parent id. + (_sibling_household("sibling", ids="some", claimant_has_ids=False), (0, 0)), + (_sibling_household("in_law", ids="some", spouse_has_ids=False), (0, 0)), + # No one has ids: the tax-unit proxy counts the child for both spouses. + (_sibling_household("sibling", ids="none"), (ONE_CHILD, ONE_CHILD)), +) + + +def _people(index, household): + """Return each person's facts, with true parents and tax unit.""" + claimant, spouse = f"h{index}_claimant", f"h{index}_spouse" + claimant_parent, spouse_parent = _absent_parents(index) + people = [ + dict( + name=claimant, + age=70 if household["aged_claimant"] else 45, + disabled=not household["aged_claimant"], + unearned=0, + student=False, + parents=(claimant_parent,), + away=False, + tax_unit="couple", + role="head", + has_ids=household["claimant_has_ids"], + ), + dict( + name=spouse, + age=50, + disabled=False, + unearned=household["spouse_unearned"], + student=False, + parents=(spouse_parent,), + away=False, + tax_unit="spouse" if household["spouse_files_separately"] else "couple", + role="head" if household["spouse_files_separately"] else "spouse", + has_ids=household["spouse_has_ids"], + ), + ] + # The first other adult can parent grandchildren and head a tax unit. + adult_position = next( + (p for p, o in enumerate(household["others"]) if o["kind"] == "adult"), + None, + ) + adult = None if adult_position is None else f"h{index}_o{adult_position}" + for position, other in enumerate(household["others"]): + name = f"h{index}_o{position}" + kind = other["kind"] + parents = { + "claimant": (claimant,), + "spouse": (spouse, None), + "both": (claimant, spouse), + "grandchild": (adult,) if adult else (None,), + "unrelated": (None,), + "sibling": (claimant_parent,), + "in_law": (spouse_parent,), + "adult": (), + }[kind] + tax_unit = other["tax_unit"] + if tax_unit == "spouse" and not household["spouse_files_separately"]: + tax_unit = "couple" + if tax_unit == "adult" and adult is None: + tax_unit = "own" + if kind == "adult": + tax_unit = "adult" if name == adult else "own" + people.append( + dict( + name=name, + age=other["age"] + (30 if kind == "adult" else 0), + disabled=False, + unearned=other["monthly_unearned"], + student=other["student"], + # None is a parent who lives outside the simulation. + parents=parents, + away=other["away"] and kind != "adult", + tax_unit=tax_unit, + role="head" if tax_unit == "own" or name == adult else "dependent", + has_ids=other["has_ids"], + ) + ) + ids_mode = household["ids"] + for person in people: + person["has_ids"] = bool(person["parents"]) and ( + ids_mode == "all" or (ids_mode == "some" and person.get("has_ids")) + ) + return people + + +def _absent_parents(index): + """Names of the claimant's and the spouse's parents, who live elsewhere.""" + return f"h{index}_claimant_parent", f"h{index}_spouse_parent" + + +def _tax_unit_key(index, person): + if person["tax_unit"] == "own": + return f"{person['name']}_tu" + return f"h{index}_{person['tax_unit']}_tu" + + +def _situation(households, reverse=False, income_rise=0): + situation = { + plural: {} + for plural in ( + "people", + "tax_units", + "households", + "marital_units", + "families", + "spm_units", + ) + } + facts = {} + person_ids = {} + for index, household in enumerate(households): + people = _people(index, household) + if reverse: + people = people[::-1] + for number, person in enumerate(people): + person_ids[person["name"]] = 1_000 * (index + 1) + number + 1 + claimant_parent, spouse_parent = _absent_parents(index) + person_ids[claimant_parent] = CLAIMANT_PARENT_ID + index + person_ids[spouse_parent] = SPOUSE_PARENT_ID + index + # Each spouse reports their co-resident children when asked. + own_children = {} + for person in people: + if not person["away"]: + for parent in person["parents"]: + own_children[parent] = own_children.get(parent, 0) + 1 + for person in people: + facts[person["name"]] = dict(person, household=index) + child = person["age"] < CHILD_AGE + parent_ids = [ + ( + person_ids.get(parent, ABSENT_PARENT_ID) + if parent + else ABSENT_PARENT_ID + ) + for parent in person["parents"] + ] + parent_ids = (parent_ids + [0, 0])[:2] if person["has_ids"] else [0, 0] + reports = household["report_own_children"] and person["name"].endswith( + ("_claimant", "_spouse") + ) + situation["people"][person["name"]] = { + "age": {YEAR: person["age"]}, + "is_ssi_disabled": {YEAR: person["disabled"]}, + "ssi_unearned_income": { + YEAR: 12 * (person["unearned"] + (income_rise if child else 0)) + }, + "is_full_time_college_student": {YEAR: person["student"]}, + "is_in_k12_school": {YEAR: False}, + "person_id": {YEAR: person_ids[person["name"]]}, + "parent_1_id": {YEAR: parent_ids[0]}, + "parent_2_id": {YEAR: parent_ids[1]}, + "own_children_in_household": { + YEAR: own_children.get(person["name"], 0) if reports else 0 + }, + "is_tax_unit_head": {YEAR: person["role"] == "head"}, + "is_tax_unit_spouse": {YEAR: person["role"] == "spouse"}, + "is_tax_unit_dependent": {YEAR: person["role"] == "dependent"}, + } + units = { + "tax_units": _tax_unit_key(index, person), + "households": ( + f"{person['name']}_away" if person["away"] else f"h{index}_home" + ), + "marital_units": ( + f"h{index}_couple" + if person["name"].endswith(("_claimant", "_spouse")) + else f"{person['name']}_mu" + ), + } + units["families"] = units["households"] + units["spm_units"] = units["households"] + for plural, key in units.items(): + group = situation[plural].setdefault(key, {"members": []}) + group["members"].append(person["name"]) + if plural == "households": + group["state_code"] = {YEAR: "TX"} + return situation, facts + + +def _allocation(person): + """416.1163(b)(1)-(2) for the oracle's people, who have no earnings.""" + child = person["age"] < CHILD_AGE or ( + person["age"] < STUDENT_AGE and person["student"] + ) + if not child or person["disabled"]: + return 0 + return max(0, 12 * (MONTHLY_ALLOCATION - person["unearned"])) + + +def _oracle(facts): + """Each person's total, and the siblings' part of it. + + Both come from true relationships and the id contract. + """ + names = list(facts) + spouse_of = {} + for name in names: + if name.endswith("_claimant"): + spouse_of[name] = name.replace("_claimant", "_spouse") + elif name.endswith("_spouse"): + spouse_of[name] = name.replace("_spouse", "_claimant") + + def home(name): + person = facts[name] + return (person["household"], person["away"] and name) + + def tax_unit(name): + return _tax_unit_key(facts[name]["household"], facts[name]) + + def co_resident_named_parents(name): + if not facts[name]["has_ids"]: + return set() + return { + parent + for parent in facts[name]["parents"] + if parent in facts and home(parent) == home(name) + } + + def named_parents(name): + # A parent with a name is one person, in the simulation or outside + # it. None stands for an unknown parent and identifies no sibling. + if not facts[name]["has_ids"]: + return set() + return {parent for parent in facts[name]["parents"] if parent} + + def linked_count(name): + return sum(name in co_resident_named_parents(other) for other in names) + + def household_linked(name): + return any( + facts[other]["has_ids"] for other in names if home(other) == home(name) + ) + + def unlinked_parent(name): + own = facts[name].get("reported_children", 0) + linked = linked_count(name) + return (own > 0 or linked > 0) and (linked == 0 or own > linked) + + totals = {} + sibling_totals = {} + for name in names: + selves = {name} | ({spouse_of[name]} if name in spouse_of else set()) + presume = not household_linked(name) or any( + unlinked_parent(member) for member in selves + ) + units = {tax_unit(member) for member in selves} + total = 0 + siblings = 0 + for other in names: + if other in selves or home(other) != home(name): + continue + # 416.1160(d): the child 'of your parent' counts for a married + # person, whose spouse's income SSA can deem. + sibling = name in spouse_of and bool( + named_parents(other) & named_parents(name) + ) + if facts[other]["has_ids"]: + counts = bool(co_resident_named_parents(other) & selves) or sibling + else: + counts = presume and tax_unit(other) in units + total += counts * _allocation(facts[other]) + siblings += sibling * _allocation(facts[other]) + totals[name] = total + sibling_totals[name] = siblings + return totals, sibling_totals + + +def _record_reported_children(situation, facts): + for name, person in facts.items(): + person["reported_children"] = situation["people"][name][ + "own_children_in_household" + ][YEAR] + + +def _calculate(situation, variables): + simulation = Simulation(situation=situation) + names = list(situation["people"]) + return { + variable: dict(zip(names, simulation.calculate(variable, YEAR))) + for variable in variables + } + + +@settings(max_examples=3, derandomize=True, deadline=None) +@given(BATCH) +def test_allocations_match_oracle_and_invariants(households): + variables = ( + "ssi_spousal_deeming_child_allocations", + "ssi_unearned_income_deemed_from_ineligible_spouse", + "is_ssi_ineligible_spouse", + ) + households = households + [household for household, _ in SIBLING_HOUSEHOLDS] + situation, facts = _situation(households) + _record_reported_children(situation, facts) + results = _calculate(situation, variables) + totals = results["ssi_spousal_deeming_child_allocations"] + oracle, sibling_totals = _oracle(facts) + + # 1. Differential against the oracle. + for name in facts: + assert totals[name] == oracle[name], name + + # The fixed sibling households, checked without the oracle. + for index, (_, expected) in enumerate(SIBLING_HOUSEHOLDS, HOUSEHOLDS_PER_EXAMPLE): + claimant, spouse = f"h{index}_claimant", f"h{index}_spouse" + assert (totals[claimant], totals[spouse]) == expected, index + + for index in range(len(households)): + claimant, spouse = f"h{index}_claimant", f"h{index}_spouse" + # 2. Both spouses see the same children of the couple. + assert ( + totals[claimant] - sibling_totals[claimant] + == totals[spouse] - sibling_totals[spouse] + ) + # 5. Deemed unearned income, 416.1163(b)(3). + assert results["is_ssi_ineligible_spouse"][spouse] + spouse_unearned = 12 * facts[spouse]["unearned"] + assert results["ssi_unearned_income_deemed_from_ineligible_spouse"][ + claimant + ] == max(0, spouse_unearned - totals[claimant]) + + # 3. Order of people. + reversed_situation, _ = _situation(households, reverse=True) + reversed_totals = _calculate( + reversed_situation, ("ssi_spousal_deeming_child_allocations",) + )["ssi_spousal_deeming_child_allocations"] + assert reversed_totals == totals + + # 4. Children's income never raises a total. + richer_situation, _ = _situation(households, income_rise=100) + richer_totals = _calculate( + richer_situation, ("ssi_spousal_deeming_child_allocations",) + )["ssi_spousal_deeming_child_allocations"] + assert all(richer_totals[name] <= totals[name] for name in totals) + + +CHILD = st.fixed_dictionaries( + { + "age": st.integers(0, 23), + "in_school": st.booleans(), + "in_college": st.booleans(), + "monthly_earned": st.sampled_from( + (-1_500, 0, 300, 497, 800, 1_000, 2_410, 2_600) + ), + "monthly_unearned": st.sampled_from((-250, 0, 100, 497, 600)), + "public_income_maintenance": st.sampled_from((False, False, False, True)), + } +) + + +def _child_situation(children, rise=0): + people = {} + for index, child in enumerate(children): + people[f"c{index}"] = { + "age": {YEAR: child["age"]}, + "is_ssi_disabled": {YEAR: False}, + "is_in_k12_school": {YEAR: child["in_school"]}, + "is_full_time_college_student": {YEAR: child["in_college"]}, + "ssi_earned_income": {YEAR: 12 * (child["monthly_earned"] + rise)}, + "ssi_unearned_income": {YEAR: 12 * (child["monthly_unearned"] + rise)}, + "ssi_receives_public_income_maintenance": { + YEAR: child["public_income_maintenance"] + }, + } + situation = {"people": people} + for plural in ( + "tax_units", + "households", + "marital_units", + "families", + "spm_units", + ): + situation[plural] = {f"u{name}": {"members": [name]} for name in people} + for household in situation["households"].values(): + household["state_code"] = {YEAR: "TX"} + return situation + + +def _monthly_allocation_oracle(child): + """Sum over months of 416.1163(b)(2) with the 416.1161(c) exclusion.""" + student = child["in_school"] or child["in_college"] + is_child = child["age"] < CHILD_AGE or (child["age"] < STUDENT_AGE and student) + if not is_child or child["public_income_maintenance"]: + return 0 + left = STUDENT_YEARLY_EXCLUSION if student and child["age"] < STUDENT_AGE else 0 + # A loss is no income: it neither raises the allocation nor offsets other + # income. + earned = max(0, child["monthly_earned"]) + unearned = max(0, child["monthly_unearned"]) + total = 0 + for _ in range(12): + exclusion = min(STUDENT_MONTHLY_EXCLUSION, earned, left) + left -= exclusion + income = earned - exclusion + unearned + total += max(0, MONTHLY_ALLOCATION - income) + return total + + +@settings(max_examples=3, derandomize=True, deadline=None) +@given(st.lists(CHILD, min_size=60, max_size=60)) +def test_child_allocation_matches_monthly_oracle(children): + allocation = Simulation(situation=_child_situation(children)).calculate( + "ssi_ineligible_child_allocation", YEAR + ) + expected = [_monthly_allocation_oracle(child) for child in children] + np.testing.assert_allclose(allocation, expected, atol=1e-6) + assert np.all(allocation >= 0) + assert np.all(allocation <= 12 * MONTHLY_ALLOCATION) + richer = Simulation(situation=_child_situation(children, rise=100)).calculate( + "ssi_ineligible_child_allocation", YEAR + ) + assert np.all(richer <= allocation + 1e-6) diff --git a/policyengine_us/tests/core/test_ssi_spousal_ism_invariants.py b/policyengine_us/tests/core/test_ssi_spousal_ism_invariants.py index a440246ff7d..3b532a1a6f8 100644 --- a/policyengine_us/tests/core/test_ssi_spousal_ism_invariants.py +++ b/policyengine_us/tests/core/test_ssi_spousal_ism_invariants.py @@ -65,7 +65,7 @@ def _situation(rows): "age": {YEAR: 70}, "employment_income": {YEAR: own_earned * 12}, "pension_income": {YEAR: own_unearned * 12}, - "ssi_in_kind_support_and_maintenance": { + "ssi_in_kind_support_and_maintenance_monthly": { f"{YEAR}-{month:02}": ism if month == 1 else 0 for month in range(1, 13) }, } @@ -159,7 +159,7 @@ def test_spousal_ism_preserves_income_and_exclusion_invariants(rows): individual_payment, ) - countable = simulation.calculate("ssi_countable_income", PERIOD)[0::2] + countable = simulation.calculate("ssi_countable_income_monthly", PERIOD)[0::2] deemed = simulation.calculate( "ssi_income_deemed_from_ineligible_spouse_monthly", PERIOD )[0::2] diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicaid/eligibility/categories/medicaid_optional_senior_or_disabled_uses_couple_standard.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicaid/eligibility/categories/medicaid_optional_senior_or_disabled_uses_couple_standard.yaml index 839e4106aa6..a6dea315b27 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicaid/eligibility/categories/medicaid_optional_senior_or_disabled_uses_couple_standard.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicaid/eligibility/categories/medicaid_optional_senior_or_disabled_uses_couple_standard.yaml @@ -270,11 +270,11 @@ output: medicaid_optional_senior_or_disabled_uses_couple_standard: [false, false] -# A year reads this month-defined status in December, when the couple is home, so -# income and limit agree: 8,000 + 22,000 - 240 = 29,760, or 14,880 each, is above -# 21,640. Tested alone for the stay (20 CFR 416.414(b)(3)), person2's 21,760 is also -# above 15,960, so person2 is not eligible in any month. -- name: Case 12, a facility stay that ends within the year tests the couple on its December status. +# The annual limit uses December's couple status; income sums monthly budgets. +# January-June: (8,000 / 12 - 20) x 6 = 3,880 and +# (22,000 / 12 - 20) x 6 = 10,880. July-December: +# (30,000 / 12 - 20) / 2 x 6 = 7,440 each. Totals: 11,320 and 18,320. +- name: Case 12, the annual couple limit uses December status while income follows each month's facility status. period: 2026 absolute_error_margin: 0.01 input: @@ -314,7 +314,10 @@ 2026-12: [true, true] medicaid_optional_senior_or_disabled_uses_couple_standard: [true, true] medicaid_optional_senior_or_disabled_income_limit: [21_640, 21_640] - medicaid_optional_senior_or_disabled_countable_income: [14_880, 14_880] + medicaid_optional_senior_or_disabled_countable_income: [11_320, 18_320] + medicaid_optional_senior_or_disabled_countable_income_monthly: + 2026-06: [646.666667, 1_813.333333] + 2026-07: [1_240, 1_240] is_optional_senior_or_disabled_income_eligible: [false, false] is_medicaid_eligible: [false, false] medicaid_category: [NONE, NONE] @@ -786,3 +789,53 @@ medicaid_optional_senior_or_disabled_income_limit: [21_640, 21_640, 15_960, 21_640] medicaid_optional_senior_or_disabled_countable_income: [21_924, 0, 15_960, 0] is_optional_senior_or_disabled_income_eligible: [false, false, true, true] + +- name: Annual Medicaid couple screens compare annual residual spouse income + period: 2026 + absolute_error_margin: 0.01 + input: + people: + claimant: + age: 50 + person_id: 1 + is_tax_unit_head: true + is_ssi_disabled: true + spouse: + age: 48 + person_id: 2 + is_tax_unit_spouse: true + ssi_unearned_income: 7_200 + student: + age: 16 + person_id: 3 + parent_1_id: 1 + parent_2_id: 2 + is_tax_unit_dependent: true + employment_income: 12_000 + is_full_time_student: true + tax_units: + family: + members: [claimant, spouse, student] + marital_units: + parents: + members: [claimant, spouse] + student_unit: + members: [student] + households: + home: + members: [claimant, spouse, student] + state_code: FL + output: + people: + student: + ssi_ineligible_child_allocation: 4_700 + claimant: + ssi_unearned_income_deemed_from_ineligible_spouse: 2_500 + is_ssi_spousal_deeming_applies_monthly: + 2026-01: false + 2026-12: true + # The public annual stock follows December. The annual screens compare + # 2,500 with (1,491 - 994) * 12 = 5,964 and keep the individual standard. + is_ssi_spousal_deeming_applies: true + medicaid_optional_senior_or_disabled_uses_couple_standard: false + medicaid_medically_needy_uses_couple_standard: false diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicaid/income/deemed/from_ineligible_parent/medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicaid/income/deemed/from_ineligible_parent/medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent.yaml index b2d35137b47..755680e8f94 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicaid/income/deemed/from_ineligible_parent/medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicaid/income/deemed/from_ineligible_parent/medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent.yaml @@ -29,6 +29,8 @@ is_ssi_disabled: true sibling: age: 14 + # Isolate pretax premiums from the student earned-income exclusion. + is_in_k12_school: false employment_income: 2_400 pre_tax_health_insurance_premiums: 1_200 parent: @@ -398,3 +400,1546 @@ ssi_unearned_income_deemed_from_ineligible_parent: [65_598, 0, 0] medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: [11_562, 0, 0] +- name: Missouri does not allocate to a co-resident adult student. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + person_id: 1 + is_tax_unit_head: true + is_parent: true + ssi_unearned_income: 24_000 + claimant: + age: 10 + person_id: 2 + parent_1_id: 1 + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + student: + age: 20 + person_id: 3 + parent_1_id: 1 + is_tax_unit_dependent: true + is_full_time_student: true + tax_units: + family: + members: [parent, claimant, student] + marital_units: + parent_unit: + members: [parent] + claimant_unit: + members: [claimant] + student_unit: + members: [student] + households: + home: + members: [parent, claimant, student] + state_code: MO + output: + # DSS 0805.020.15 step 1 restricts allocations to children under 18: + # https://dssmanuals.mo.gov/mo-healthnet-for-the-aged-blind-and-disabled/0805-000-00/0805-020-00/0805-020-15/ + # SSI still allocates for this student, but Missouri must not deduct it. + ssi_ineligible_child_allocation: [0, 0, 5_964] + # ($2,000 - $20 - $994) * 12 = $11,832, not $5,868. + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: [0, 11_832, 0] + +# Non-209(b) states retain SSI's full-time-student allocations. +# Missouri and Virginia retain their narrower age ceilings. +# Each parent receives $2,000 per month in unearned income. +# With an allocation: ($2,000 - $497 - $20 - $994) * 12 = $5,868. +# Without one: ($2,000 - $20 - $994) * 12 = $11,832. +- name: Non-209(b) Medicaid programs preserve SSI student allocations at former age ceilings. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + ca_parent: + age: 40 + person_id: 1 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + ca_claimant: + age: 10 + person_id: 2 + parent_1_id: 1 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + ca_student: + age: 21 + person_id: 3 + parent_1_id: 1 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_full_time_student: true + is_household_head: false + fl_parent: + age: 40 + person_id: 7 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + fl_claimant: + age: 10 + person_id: 8 + parent_1_id: 7 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + fl_student: + age: 21 + person_id: 9 + parent_1_id: 7 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_full_time_student: true + is_household_head: false + id_parent: + age: 40 + person_id: 10 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + id_claimant: + age: 10 + person_id: 11 + parent_1_id: 10 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + id_student: + age: 21 + person_id: 12 + parent_1_id: 10 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_full_time_student: true + is_household_head: false + la_parent: + age: 40 + person_id: 13 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + la_claimant: + age: 10 + person_id: 14 + parent_1_id: 13 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + la_student: + age: 21 + person_id: 15 + parent_1_id: 13 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_full_time_student: true + is_household_head: false + mi_parent: + age: 40 + person_id: 16 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + mi_claimant: + age: 10 + person_id: 17 + parent_1_id: 16 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + mi_student: + age: 18 + person_id: 18 + parent_1_id: 16 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_full_time_student: true + is_household_head: false + mo_parent: + age: 40 + person_id: 19 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + mo_claimant: + age: 10 + person_id: 20 + parent_1_id: 19 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + mo_student: + age: 18 + person_id: 21 + parent_1_id: 19 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_full_time_student: true + is_household_head: false + mt_parent: + age: 40 + person_id: 22 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + mt_claimant: + age: 10 + person_id: 23 + parent_1_id: 22 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + mt_student: + age: 21 + person_id: 24 + parent_1_id: 22 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_full_time_student: true + is_household_head: false + nc_parent: + age: 40 + person_id: 25 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + nc_claimant: + age: 10 + person_id: 26 + parent_1_id: 25 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + nc_student: + age: 21 + person_id: 27 + parent_1_id: 25 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_full_time_student: true + is_household_head: false + nj_parent: + age: 40 + person_id: 28 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + nj_claimant: + age: 10 + person_id: 29 + parent_1_id: 28 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + nj_student: + age: 18 + person_id: 30 + parent_1_id: 28 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_full_time_student: true + is_household_head: false + ny_parent: + age: 40 + person_id: 31 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + ny_claimant: + age: 10 + person_id: 32 + parent_1_id: 31 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + ny_student: + age: 18 + person_id: 33 + parent_1_id: 31 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_full_time_student: true + is_household_head: false + oh_parent: + age: 40 + person_id: 34 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + oh_claimant: + age: 10 + person_id: 35 + parent_1_id: 34 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + oh_student: + age: 18 + person_id: 36 + parent_1_id: 34 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_full_time_student: true + is_household_head: false + va_parent: + age: 40 + person_id: 40 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + va_claimant: + age: 10 + person_id: 41 + parent_1_id: 40 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + va_student: + age: 21 + person_id: 42 + parent_1_id: 40 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_full_time_student: true + is_household_head: false + wi_parent: + age: 40 + person_id: 43 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + wi_claimant: + age: 10 + person_id: 44 + parent_1_id: 43 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + wi_student: + age: 19 + person_id: 45 + parent_1_id: 43 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_full_time_student: true + is_household_head: false + tx_parent: + age: 40 + person_id: 46 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + tx_claimant: + age: 10 + person_id: 47 + parent_1_id: 46 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + tx_student: + age: 21 + person_id: 48 + parent_1_id: 46 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_full_time_student: true + is_household_head: false + tax_units: + ca_family: + members: [ca_parent, ca_claimant, ca_student] + fl_family: + members: [fl_parent, fl_claimant, fl_student] + id_family: + members: [id_parent, id_claimant, id_student] + la_family: + members: [la_parent, la_claimant, la_student] + mi_family: + members: [mi_parent, mi_claimant, mi_student] + mo_family: + members: [mo_parent, mo_claimant, mo_student] + mt_family: + members: [mt_parent, mt_claimant, mt_student] + nc_family: + members: [nc_parent, nc_claimant, nc_student] + nj_family: + members: [nj_parent, nj_claimant, nj_student] + ny_family: + members: [ny_parent, ny_claimant, ny_student] + oh_family: + members: [oh_parent, oh_claimant, oh_student] + va_family: + members: [va_parent, va_claimant, va_student] + wi_family: + members: [wi_parent, wi_claimant, wi_student] + tx_family: + members: [tx_parent, tx_claimant, tx_student] + marital_units: + ca_parent_unit: + members: [ca_parent] + ca_claimant_unit: + members: [ca_claimant] + ca_student_unit: + members: [ca_student] + fl_parent_unit: + members: [fl_parent] + fl_claimant_unit: + members: [fl_claimant] + fl_student_unit: + members: [fl_student] + id_parent_unit: + members: [id_parent] + id_claimant_unit: + members: [id_claimant] + id_student_unit: + members: [id_student] + la_parent_unit: + members: [la_parent] + la_claimant_unit: + members: [la_claimant] + la_student_unit: + members: [la_student] + mi_parent_unit: + members: [mi_parent] + mi_claimant_unit: + members: [mi_claimant] + mi_student_unit: + members: [mi_student] + mo_parent_unit: + members: [mo_parent] + mo_claimant_unit: + members: [mo_claimant] + mo_student_unit: + members: [mo_student] + mt_parent_unit: + members: [mt_parent] + mt_claimant_unit: + members: [mt_claimant] + mt_student_unit: + members: [mt_student] + nc_parent_unit: + members: [nc_parent] + nc_claimant_unit: + members: [nc_claimant] + nc_student_unit: + members: [nc_student] + nj_parent_unit: + members: [nj_parent] + nj_claimant_unit: + members: [nj_claimant] + nj_student_unit: + members: [nj_student] + ny_parent_unit: + members: [ny_parent] + ny_claimant_unit: + members: [ny_claimant] + ny_student_unit: + members: [ny_student] + oh_parent_unit: + members: [oh_parent] + oh_claimant_unit: + members: [oh_claimant] + oh_student_unit: + members: [oh_student] + va_parent_unit: + members: [va_parent] + va_claimant_unit: + members: [va_claimant] + va_student_unit: + members: [va_student] + wi_parent_unit: + members: [wi_parent] + wi_claimant_unit: + members: [wi_claimant] + wi_student_unit: + members: [wi_student] + tx_parent_unit: + members: [tx_parent] + tx_claimant_unit: + members: [tx_claimant] + tx_student_unit: + members: [tx_student] + households: + ca_home: + members: [ca_parent, ca_claimant, ca_student] + state_code: CA + fl_home: + members: [fl_parent, fl_claimant, fl_student] + state_code: FL + id_home: + members: [id_parent, id_claimant, id_student] + state_code: ID + la_home: + members: [la_parent, la_claimant, la_student] + state_code: LA + mi_home: + members: [mi_parent, mi_claimant, mi_student] + state_code: MI + mo_home: + members: [mo_parent, mo_claimant, mo_student] + state_code: MO + mt_home: + members: [mt_parent, mt_claimant, mt_student] + state_code: MT + nc_home: + members: [nc_parent, nc_claimant, nc_student] + state_code: NC + nj_home: + members: [nj_parent, nj_claimant, nj_student] + state_code: NJ + ny_home: + members: [ny_parent, ny_claimant, ny_student] + state_code: NY + oh_home: + members: [oh_parent, oh_claimant, oh_student] + state_code: OH + va_home: + members: [va_parent, va_claimant, va_student] + state_code: VA + wi_home: + members: [wi_parent, wi_claimant, wi_student] + state_code: WI + tx_home: + members: [tx_parent, tx_claimant, tx_student] + state_code: TX + output: + people: + ca_claimant: + # California deducts the $20 general exclusion and the student's allocation: + # 24,000 - 240 - 11,928 - 5,964 = 5,868. + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5868 + ca_student: + ssi_ineligible_child_allocation: 5964 + fl_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5868 + fl_student: + ssi_ineligible_child_allocation: 5964 + id_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5868 + id_student: + ssi_ineligible_child_allocation: 5964 + la_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5868 + la_student: + ssi_ineligible_child_allocation: 5964 + mi_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5868 + mi_student: + ssi_ineligible_child_allocation: 5964 + mo_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 11832 + mo_student: + ssi_ineligible_child_allocation: 5964 + mt_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5868 + mt_student: + ssi_ineligible_child_allocation: 5964 + nc_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5868 + nc_student: + ssi_ineligible_child_allocation: 5964 + nj_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5868 + nj_student: + ssi_ineligible_child_allocation: 5964 + ny_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5868 + ny_student: + ssi_ineligible_child_allocation: 5964 + oh_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5868 + oh_student: + ssi_ineligible_child_allocation: 5964 + va_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 11832 + va_student: + ssi_ineligible_child_allocation: 5964 + wi_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5868 + wi_student: + ssi_ineligible_child_allocation: 5964 + tx_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5868 + tx_student: + ssi_ineligible_child_allocation: 5964 + +# Students below Missouri's ceiling and students in non-209(b) states +# receive $497 monthly allocations: $11,832 - $5,964 = $5,868. +# Their parents remain the income sources when students file separately. +# The disabled siblings fail both programs' immigration tests. +# Virginia excludes these siblings from child allocations; the other states +# retain SSI's allocations under 42 USC 1396a(r)(2). +- name: Medicaid preserves SSI allocations while Virginia excludes blind or disabled siblings. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + mo_below_parent: + age: 40 + person_id: 1 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + mo_below_claimant: + age: 10 + person_id: 2 + parent_1_id: 1 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + # This variable is supplied for siblings below; supply claimants too. + is_medicaid_immigration_status_eligible: true + mo_below_student: + age: 17 + person_id: 3 + parent_1_id: 1 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_full_time_student: true + is_household_head: false + la_below_parent: + age: 40 + person_id: 4 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + la_below_claimant: + age: 10 + person_id: 5 + parent_1_id: 4 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + # This variable is supplied for siblings below; supply claimants too. + is_medicaid_immigration_status_eligible: true + la_below_student: + age: 20 + person_id: 6 + parent_1_id: 4 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_full_time_student: true + is_household_head: false + ca_below_parent: + age: 40 + person_id: 7 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + ca_below_claimant: + age: 10 + person_id: 8 + parent_1_id: 7 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + # This variable is supplied for siblings below; supply claimants too. + is_medicaid_immigration_status_eligible: true + ca_below_student: + age: 20 + person_id: 9 + parent_1_id: 7 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_full_time_student: true + is_household_head: false + wi_dependent_parent: + age: 40 + person_id: 10 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + wi_dependent_claimant: + age: 10 + person_id: 11 + parent_1_id: 10 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + # This variable is supplied for siblings below; supply claimants too. + is_medicaid_immigration_status_eligible: true + wi_dependent_student: + age: 18 + person_id: 12 + parent_1_id: 10 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_full_time_student: true + is_in_secondary_school: true + ssi_earned_income: 9000 + is_household_head: false + wi_not_dependent_parent: + age: 40 + person_id: 13 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + wi_not_dependent_claimant: + age: 10 + person_id: 14 + parent_1_id: 13 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + # This variable is supplied for siblings below; supply claimants too. + is_medicaid_immigration_status_eligible: true + wi_not_dependent_student: + age: 18 + person_id: 15 + parent_1_id: 13 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_full_time_student: true + is_in_secondary_school: true + ssi_earned_income: 9000 + is_household_head: false + tx_below_parent: + age: 40 + person_id: 16 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + ga_ssi_scope_parent: + age: 40 + person_id: 1001 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + tx_below_claimant: + age: 10 + person_id: 17 + parent_1_id: 16 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + # This variable is supplied for siblings below; supply claimants too. + is_medicaid_immigration_status_eligible: true + ga_ssi_scope_claimant: + age: 10 + person_id: 1002 + parent_1_id: 1001 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + # This variable is supplied for siblings below; supply claimants too. + is_medicaid_immigration_status_eligible: true + tx_below_student: + age: 20 + person_id: 18 + parent_1_id: 16 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_full_time_student: true + is_household_head: false + ga_ssi_scope_student: + age: 21 + person_id: 1003 + parent_1_id: 1001 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_full_time_student: true + is_household_head: false + la_disabled_parent: + age: 40 + person_id: 19 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + la_disabled_claimant: + age: 10 + person_id: 20 + parent_1_id: 19 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + # This variable is supplied for siblings below; supply claimants too. + is_medicaid_immigration_status_eligible: true + la_disabled_student: + age: 17 + person_id: 21 + parent_1_id: 19 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_full_time_student: true + is_household_head: false + is_ssi_disabled: true + immigration_status: UNDOCUMENTED + is_medicaid_immigration_status_eligible: false + ny_disabled_parent: + age: 40 + person_id: 22 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + ny_disabled_claimant: + age: 10 + person_id: 23 + parent_1_id: 22 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + # This variable is supplied for siblings below; supply claimants too. + is_medicaid_immigration_status_eligible: true + ny_disabled_student: + age: 17 + person_id: 24 + parent_1_id: 22 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_full_time_student: true + is_household_head: false + is_ssi_disabled: true + immigration_status: UNDOCUMENTED + is_medicaid_immigration_status_eligible: false + va_disabled_parent: + age: 40 + person_id: 25 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + va_disabled_claimant: + age: 10 + person_id: 26 + parent_1_id: 25 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + # This variable is supplied for siblings below; supply claimants too. + is_medicaid_immigration_status_eligible: true + va_disabled_student: + age: 17 + person_id: 27 + parent_1_id: 25 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_full_time_student: true + is_household_head: false + is_ssi_disabled: true + immigration_status: UNDOCUMENTED + is_medicaid_immigration_status_eligible: false + wi_disabled_parent: + age: 40 + person_id: 28 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + wi_disabled_claimant: + age: 10 + person_id: 29 + parent_1_id: 28 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + # This variable is supplied for siblings below; supply claimants too. + is_medicaid_immigration_status_eligible: true + wi_disabled_student: + age: 17 + person_id: 30 + parent_1_id: 28 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_full_time_student: true + is_household_head: false + is_ssi_disabled: true + immigration_status: UNDOCUMENTED + is_medicaid_immigration_status_eligible: false + fl_disabled_parent: + age: 40 + person_id: 31 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + fl_disabled_claimant: + age: 10 + person_id: 32 + parent_1_id: 31 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + # This variable is supplied for siblings below; supply claimants too. + is_medicaid_immigration_status_eligible: true + fl_disabled_student: + age: 17 + person_id: 33 + parent_1_id: 31 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_full_time_student: true + is_household_head: false + is_ssi_disabled: true + immigration_status: UNDOCUMENTED + is_medicaid_immigration_status_eligible: false + tax_units: + mo_below_family: + members: [mo_below_parent, mo_below_claimant, mo_below_student] + la_below_family: + members: [la_below_parent, la_below_claimant, la_below_student] + ca_below_family: + members: [ca_below_parent, ca_below_claimant, ca_below_student] + wi_dependent_family: + members: [wi_dependent_parent, wi_dependent_claimant, wi_dependent_student] + wi_not_dependent_family: + members: [wi_not_dependent_parent, wi_not_dependent_claimant] + wi_not_dependent_student_unit: + members: [wi_not_dependent_student] + tx_below_family: + members: [tx_below_parent, tx_below_claimant, tx_below_student] + ga_ssi_scope_family: + members: [ga_ssi_scope_parent, ga_ssi_scope_claimant, ga_ssi_scope_student] + la_disabled_family: + members: [la_disabled_parent, la_disabled_claimant, la_disabled_student] + ny_disabled_family: + members: [ny_disabled_parent, ny_disabled_claimant, ny_disabled_student] + va_disabled_family: + members: [va_disabled_parent, va_disabled_claimant, va_disabled_student] + wi_disabled_family: + members: [wi_disabled_parent, wi_disabled_claimant, wi_disabled_student] + fl_disabled_family: + members: [fl_disabled_parent, fl_disabled_claimant, fl_disabled_student] + marital_units: + mo_below_parent_unit: + members: [mo_below_parent] + mo_below_claimant_unit: + members: [mo_below_claimant] + mo_below_student_unit: + members: [mo_below_student] + la_below_parent_unit: + members: [la_below_parent] + la_below_claimant_unit: + members: [la_below_claimant] + la_below_student_unit: + members: [la_below_student] + ca_below_parent_unit: + members: [ca_below_parent] + ca_below_claimant_unit: + members: [ca_below_claimant] + ca_below_student_unit: + members: [ca_below_student] + wi_dependent_parent_unit: + members: [wi_dependent_parent] + wi_dependent_claimant_unit: + members: [wi_dependent_claimant] + wi_dependent_student_unit: + members: [wi_dependent_student] + wi_not_dependent_parent_unit: + members: [wi_not_dependent_parent] + wi_not_dependent_claimant_unit: + members: [wi_not_dependent_claimant] + wi_not_dependent_student_unit: + members: [wi_not_dependent_student] + tx_below_parent_unit: + members: [tx_below_parent] + ga_ssi_scope_parent_unit: + members: [ga_ssi_scope_parent] + tx_below_claimant_unit: + members: [tx_below_claimant] + ga_ssi_scope_claimant_unit: + members: [ga_ssi_scope_claimant] + tx_below_student_unit: + members: [tx_below_student] + ga_ssi_scope_student_unit: + members: [ga_ssi_scope_student] + la_disabled_parent_unit: + members: [la_disabled_parent] + la_disabled_claimant_unit: + members: [la_disabled_claimant] + la_disabled_student_unit: + members: [la_disabled_student] + ny_disabled_parent_unit: + members: [ny_disabled_parent] + ny_disabled_claimant_unit: + members: [ny_disabled_claimant] + ny_disabled_student_unit: + members: [ny_disabled_student] + va_disabled_parent_unit: + members: [va_disabled_parent] + va_disabled_claimant_unit: + members: [va_disabled_claimant] + va_disabled_student_unit: + members: [va_disabled_student] + wi_disabled_parent_unit: + members: [wi_disabled_parent] + wi_disabled_claimant_unit: + members: [wi_disabled_claimant] + wi_disabled_student_unit: + members: [wi_disabled_student] + fl_disabled_parent_unit: + members: [fl_disabled_parent] + fl_disabled_claimant_unit: + members: [fl_disabled_claimant] + fl_disabled_student_unit: + members: [fl_disabled_student] + households: + mo_below_home: + members: [mo_below_parent, mo_below_claimant, mo_below_student] + state_code: MO + la_below_home: + members: [la_below_parent, la_below_claimant, la_below_student] + state_code: LA + ca_below_home: + members: [ca_below_parent, ca_below_claimant, ca_below_student] + state_code: CA + wi_dependent_home: + members: [wi_dependent_parent, wi_dependent_claimant, wi_dependent_student] + state_code: WI + wi_not_dependent_home: + members: [wi_not_dependent_parent, wi_not_dependent_claimant, wi_not_dependent_student] + state_code: WI + tx_below_home: + members: [tx_below_parent, tx_below_claimant, tx_below_student] + state_code: TX + ga_ssi_scope_home: + members: [ga_ssi_scope_parent, ga_ssi_scope_claimant, ga_ssi_scope_student] + state_code: GA + la_disabled_home: + members: [la_disabled_parent, la_disabled_claimant, la_disabled_student] + state_code: LA + ny_disabled_home: + members: [ny_disabled_parent, ny_disabled_claimant, ny_disabled_student] + state_code: NY + va_disabled_home: + members: [va_disabled_parent, va_disabled_claimant, va_disabled_student] + state_code: VA + wi_disabled_home: + members: [wi_disabled_parent, wi_disabled_claimant, wi_disabled_student] + state_code: WI + fl_disabled_home: + members: [fl_disabled_parent, fl_disabled_claimant, fl_disabled_student] + state_code: FL + output: + people: + mo_below_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5868 + mo_below_student: + ssi_ineligible_child_allocation: 5964 + la_below_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5868 + la_below_student: + ssi_ineligible_child_allocation: 5964 + ca_below_claimant: + # California's $20 disregard (#10364), less the student's allocation: + # 24,000 - 20 * 12 - 11,928 - 5,964 = 5,868. + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5868 + ca_below_student: + ssi_ineligible_child_allocation: 5964 + wi_dependent_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5868 + wi_dependent_student: + ssi_ineligible_child_allocation: 5964 + wi_not_dependent_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5868 + wi_not_dependent_student: + ssi_ineligible_child_allocation: 5964 + tx_below_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5868 + ga_ssi_scope_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5868 + tx_below_student: + ssi_ineligible_child_allocation: 5964 + ga_ssi_scope_student: + ssi_ineligible_child_allocation: 5964 + la_disabled_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5868 + la_disabled_student: + ssi_ineligible_child_allocation: 5964 + ny_disabled_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5868 + ny_disabled_student: + ssi_ineligible_child_allocation: 5964 + va_disabled_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 11832 + va_disabled_student: + ssi_ineligible_child_allocation: 5964 + wi_disabled_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5868 + wi_disabled_student: + ssi_ineligible_child_allocation: 5964 + fl_disabled_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5868 + fl_disabled_student: + ssi_ineligible_child_allocation: 5964 + +# Wisconsin retains SSI's full-time-student definition for this pathway. +# Both college students receive allocations regardless of tax dependency. +# The part-time adult student receives no SSI allocation; the minor does. +- name: Wisconsin Medicaid allocates for SSI student children regardless of school level or tax role. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + college_dependent_parent: + age: 40 + person_id: 100 + is_parent: true + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + ssi_unearned_income: 24000 + college_dependent_claimant: + age: 10 + person_id: 101 + parent_1_id: 100 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + is_medicaid_immigration_status_eligible: true + college_dependent_student: + age: 18 + person_id: 102 + parent_1_id: 100 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_household_head: false + is_full_time_student: true + is_in_secondary_school: false + is_full_time_college_student: true + ssi_earned_income: 9000 + college_independent_parent: + age: 40 + person_id: 103 + is_parent: true + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + ssi_unearned_income: 24000 + college_independent_claimant: + age: 10 + person_id: 104 + parent_1_id: 103 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + is_medicaid_immigration_status_eligible: true + college_independent_student: + age: 18 + person_id: 105 + parent_1_id: 103 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_household_head: false + is_full_time_student: true + is_in_secondary_school: false + is_full_time_college_student: true + ssi_earned_income: 9000 + part_time_secondary_parent: + age: 40 + person_id: 106 + is_parent: true + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + ssi_unearned_income: 24000 + part_time_secondary_claimant: + age: 10 + person_id: 107 + parent_1_id: 106 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + is_medicaid_immigration_status_eligible: true + part_time_secondary_student: + age: 18 + person_id: 108 + parent_1_id: 106 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_household_head: false + is_full_time_student: false + is_in_secondary_school: true + is_full_time_college_student: false + ssi_earned_income: 0 + minor_nonstudent_parent: + age: 40 + person_id: 109 + is_parent: true + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + ssi_unearned_income: 24000 + minor_nonstudent_claimant: + age: 10 + person_id: 110 + parent_1_id: 109 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + is_medicaid_immigration_status_eligible: true + minor_nonstudent_student: + age: 17 + person_id: 111 + parent_1_id: 109 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_household_head: false + is_full_time_student: false + is_in_secondary_school: false + is_full_time_college_student: false + ssi_earned_income: 0 + tax_units: + college_dependent_family: + members: [college_dependent_parent, college_dependent_claimant, college_dependent_student] + college_independent_family: + members: [college_independent_parent, college_independent_claimant] + college_independent_student_unit: + members: [college_independent_student] + part_time_secondary_family: + members: [part_time_secondary_parent, part_time_secondary_claimant, part_time_secondary_student] + minor_nonstudent_family: + members: [minor_nonstudent_parent, minor_nonstudent_claimant, minor_nonstudent_student] + marital_units: + college_dependent_parent_marital_unit: + members: [college_dependent_parent] + college_dependent_claimant_marital_unit: + members: [college_dependent_claimant] + college_dependent_student_marital_unit: + members: [college_dependent_student] + college_independent_parent_marital_unit: + members: [college_independent_parent] + college_independent_claimant_marital_unit: + members: [college_independent_claimant] + college_independent_student_marital_unit: + members: [college_independent_student] + part_time_secondary_parent_marital_unit: + members: [part_time_secondary_parent] + part_time_secondary_claimant_marital_unit: + members: [part_time_secondary_claimant] + part_time_secondary_student_marital_unit: + members: [part_time_secondary_student] + minor_nonstudent_parent_marital_unit: + members: [minor_nonstudent_parent] + minor_nonstudent_claimant_marital_unit: + members: [minor_nonstudent_claimant] + minor_nonstudent_student_marital_unit: + members: [minor_nonstudent_student] + households: + college_dependent_home: + members: [college_dependent_parent, college_dependent_claimant, college_dependent_student] + state_code: WI + college_independent_home: + members: [college_independent_parent, college_independent_claimant, college_independent_student] + state_code: WI + part_time_secondary_home: + members: [part_time_secondary_parent, part_time_secondary_claimant, part_time_secondary_student] + state_code: WI + minor_nonstudent_home: + members: [minor_nonstudent_parent, minor_nonstudent_claimant, minor_nonstudent_student] + state_code: WI + output: + people: + college_dependent_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5868 + college_dependent_student: + ssi_ineligible_child_allocation: 5964 + college_independent_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5868 + college_independent_student: + ssi_ineligible_child_allocation: 5964 + part_time_secondary_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 11832 + part_time_secondary_student: + ssi_ineligible_child_allocation: 0 + minor_nonstudent_claimant: + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5868 + minor_nonstudent_student: + ssi_ineligible_child_allocation: 5964 + +# Original review r4 witnesses: K-12 evidence without is_in_secondary_school. +- name: WI legal dependent 18-year-old high-school senior, tax dependent True + period: 2026 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + person_id: 1 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + claimant: + age: 10 + person_id: 2 + parent_1_id: 1 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + student: + age: 18 + person_id: 3 + parent_1_id: 1 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_full_time_student: true + is_household_head: false + is_in_k12_school: true + is_full_time_college_student: false + ssi_earned_income: 9000 + tax_units: + family: + members: [parent, claimant, student] + marital_units: + parent_unit: + members: [parent] + claimant_unit: + members: [claimant] + student_unit: + members: [student] + households: + home: + members: [parent, claimant, student] + state_code: WI + output: + ssi_ineligible_child_allocation: [0, 0, 5964] + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: [0, 5868, 0] + ssi_unearned_income_deemed_from_ineligible_parent: [0, 5868, 0] + +- name: WI legal dependent 18-year-old high-school senior, tax dependent False + period: 2026 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + person_id: 1 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_parent: true + ssi_unearned_income: 24000 + claimant: + age: 10 + person_id: 2 + parent_1_id: 1 + is_tax_unit_head: false + is_tax_unit_spouse: false + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + student: + age: 18 + person_id: 3 + parent_1_id: 1 + is_tax_unit_head: true + is_tax_unit_spouse: false + is_tax_unit_dependent: false + is_full_time_student: true + is_household_head: false + is_in_k12_school: true + is_full_time_college_student: false + ssi_earned_income: 9000 + tax_units: + family: + members: [parent, claimant] + student_family: + members: [student] + marital_units: + parent_unit: + members: [parent] + claimant_unit: + members: [claimant] + student_unit: + members: [student] + households: + home: + members: [parent, claimant, student] + state_code: WI + output: + ssi_ineligible_child_allocation: [0, 0, 5964] + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: [0, 5868, 0] + ssi_unearned_income_deemed_from_ineligible_parent: [0, 5868, 0] + +- name: New York keeps the SSI allocation for an 18 year old student + period: 2026 + absolute_error_margin: 0.02 + input: + people: + parent: + age: 40 + person_id: 1 + is_tax_unit_head: true + ssi_unearned_income: 24_000 + claimant: + age: 10 + person_id: 2 + parent_1_id: 1 + immigration_status: CITIZEN + is_tax_unit_dependent: true + is_ssi_disabled: true + sibling: + age: 18 + person_id: 3 + parent_1_id: 1 + immigration_status: CITIZEN + is_tax_unit_dependent: true + is_full_time_student: true + tax_units: + family: + members: [parent, claimant, sibling] + households: + home: + members: [parent, claimant, sibling] + state_code: NY + output: + people: + claimant: + ssi_unearned_income_deemed_from_ineligible_parent: 5_868 + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5_868 + ssi_unearned_income_deemed_from_ineligible_parent_monthly: + 2026-01: 489 + 2026-12: 489 + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent_monthly: + 2026-01: 489 + 2026-12: 489 + sibling: + ssi_ineligible_child_allocation: 5_964 diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicaid/income/deemed/from_ineligible_spouse/medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicaid/income/deemed/from_ineligible_spouse/medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse.yaml index e245c1183a8..0dd17649840 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicaid/income/deemed/from_ineligible_spouse/medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicaid/income/deemed/from_ineligible_spouse/medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse.yaml @@ -100,6 +100,8 @@ pre_tax_health_insurance_premiums: 2_400 child: age: 14 + # Isolate pretax premiums from the student earned-income exclusion. + is_in_k12_school: false employment_income: 2_400 pre_tax_health_insurance_premiums: 1_200 tax_units: @@ -121,6 +123,138 @@ medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse: [7_992, 0, 0] medicaid_optional_senior_or_disabled_countable_income: [7_992, 0, 0] +- name: Optional Medicaid budgets monthly allocations for a student earning $1_000 per month + # 20 CFR 416.1163(d): deem only in months above the FBR differential. + # The spouse has $580 countable income in each month with no allocation. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + claimant: + age: 50 + person_id: 1 + is_tax_unit_head: true + is_ssi_disabled: true + is_medicare_eligible: true + spouse: + age: 48 + person_id: 2 + is_tax_unit_spouse: true + is_medicare_eligible: false + ssi_unearned_income: 600 * 12 + student: + age: 16 + person_id: 3 + parent_1_id: 1 + parent_2_id: 2 + is_tax_unit_dependent: true + is_full_time_student: true + employment_income: 1_000 * 12 + tax_units: + family: + members: [claimant, spouse, student] + marital_units: + parents: + members: [claimant, spouse] + student_unit: + members: [student] + households: + home: + members: [claimant, spouse, student] + state_code: TX + output: + people: + claimant: + medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse: 1_160 + medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse_monthly: + "2026-01": 0 + "2026-10": 0 + "2026-11": 580 + medicaid_optional_senior_or_disabled_countable_income: 1_160 + +- name: Optional Medicaid budgets monthly allocations for a student earning $2_600 per month + # 20 CFR 416.1163(d): deem only in months above the FBR differential. + # The spouse has $580 countable income in each month with no allocation. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + claimant: + age: 50 + person_id: 1 + is_tax_unit_head: true + is_ssi_disabled: true + is_medicare_eligible: true + spouse: + age: 48 + person_id: 2 + is_tax_unit_spouse: true + is_medicare_eligible: false + ssi_unearned_income: 600 * 12 + student: + age: 16 + person_id: 3 + parent_1_id: 1 + parent_2_id: 2 + is_tax_unit_dependent: true + is_full_time_student: true + employment_income: 2_600 * 12 + tax_units: + family: + members: [claimant, spouse, student] + marital_units: + parents: + members: [claimant, spouse] + student_unit: + members: [student] + households: + home: + members: [claimant, spouse, student] + state_code: TX + output: + people: + claimant: + medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse: 4_640 + medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse_monthly: + "2026-01": 0 + "2026-04": 0 + "2026-05": 580 + medicaid_optional_senior_or_disabled_countable_income: 4_640 + +- name: Spouse income is deemed to an aged permanent resident without 40 SSI quarters. + period: 2025 + absolute_error_margin: 0.01 + input: + people: + person1: + age: 70 + is_tax_unit_head: true + immigration_status: LEGAL_PERMANENT_RESIDENT + years_since_us_entry: 10 + ssi_qualifying_quarters_earnings: 20 + pension_income: 6_000 + person2: + age: 55 + is_tax_unit_spouse: true + employment_income: 40_000 + tax_units: + tax_unit: + members: [person1, person2] + marital_units: + marital_unit: + members: [person1, person2] + households: + household: + members: [person1, person2] + state_code: MA + output: + # SSI's noncitizen test does not stop deeming (42 CFR 435.601). + # Spouse wages 40,000 > (1,450 - 967) x 12 = 5,796. + # Couple: (500 - 20) x 12 + (40,000 - 65 x 12) / 2 = 25,370. + # Alone: (500 - 20) x 12 = 5,760. Deemed: 25,370 - 5,760 = 19,610. + medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse: [19_610, 0] + + # Omitted marital units form one default group. Only the identified spouse's # income enters Missouri's gross-income deeming; other adults do not. - name: Missouri spouse deeming excludes an unrelated third adult's income. @@ -164,6 +298,7 @@ is_ssi_ineligible_spouse: [false, true, false] medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse: [2_004, 0, 0] + - name: Missouri spouse deeming excludes another couple's ineligible spouse. period: 2026 absolute_error_margin: 0.01 @@ -210,38 +345,6 @@ # monthly. Second: floor((1,000 - 65) / 2 + 1,000 - 20) = 1,447. medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse: [2_004, 0, 17_364, 0] -- name: Spouse income is deemed to an aged permanent resident without 40 SSI quarters. - period: 2025 - absolute_error_margin: 0.01 - input: - people: - person1: - age: 70 - is_tax_unit_head: true - immigration_status: LEGAL_PERMANENT_RESIDENT - years_since_us_entry: 10 - ssi_qualifying_quarters_earnings: 20 - pension_income: 6_000 - person2: - age: 55 - is_tax_unit_spouse: true - employment_income: 40_000 - tax_units: - tax_unit: - members: [person1, person2] - marital_units: - marital_unit: - members: [person1, person2] - households: - household: - members: [person1, person2] - state_code: MA - output: - # SSI's noncitizen test does not stop deeming (42 CFR 435.601). - # Spouse wages 40,000 > (1,450 - 967) x 12 = 5,796. - # Couple: (500 - 20) x 12 + (40,000 - 65 x 12) / 2 = 25,370. - # Alone: (500 - 20) x 12 = 5,760. Deemed: 25,370 - 5,760 = 19,610. - medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse: [19_610, 0] # 42 USC 1396r-5(b)(1): "no income of the community spouse shall be deemed available to # the institutionalized spouse". The spouse's 8,000 is above SSI's 12 x 497 = 5,964 and @@ -275,6 +378,7 @@ medicaid_optional_senior_or_disabled_income_limit: [15_960, 15_960] medicaid_category: [SENIOR_OR_DISABLED, ADULT] + # AHCCCS MA611 A budgets the customer and spouse together and, in step 4, subtracts a # child allocation "for each of the customer's children and the customer's spouse's # children living in the home". The child's allocation is 12 x 497 = 5,964, so the diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicaid/income/medicaid_optional_senior_or_disabled_countable_income.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicaid/income/medicaid_optional_senior_or_disabled_countable_income.yaml index fbbda8533b3..04dffc7776a 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicaid/income/medicaid_optional_senior_or_disabled_countable_income.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicaid/income/medicaid_optional_senior_or_disabled_countable_income.yaml @@ -257,7 +257,7 @@ # applies in 2021 annual calculations. (1,000 - 20) x 12 = 11,760. medicaid_optional_senior_or_disabled_countable_income: 11_760 -- name: California subtracts the 20-dollar deduction and then the 230-dollar disregard in 2020. +- name: California subtracts the 20-dollar deduction and then the 230-dollar disregard until December 2020. period: 2020 absolute_error_margin: 0.01 input: @@ -266,11 +266,17 @@ ssi_unearned_income: 12_000 state_code: CA output: - # ACWDL 00-57 MC 176 lines 8 and 16. 2020 reads January 1, 2020: the 230 - # disregard applies, the Part B disregard does not, and the MSP pays Part - # B, so no person-paid premium is deducted. - # (1,000 - 20 - 230) x 12 = 9,000. - medicaid_optional_senior_or_disabled_countable_income: 9_000 + # ACWDL 00-57 MC 176 lines 8 and 16. The annual amount sums monthly + # budgets. January-November: the 230 disregard applies, the Part B + # disregard does not, and the MSP pays Part B, so no person-paid premium + # is deducted: (1,000 - 20 - 230) x 11 = 8,250. ACWDL 20-24 takes effect + # December 1, 2020: no 230 disregard, and the full Part B premium is + # disregarded: the 2020 base premium is 144.60, so + # 1,000 - 20 - 144.60 = 835.40. Total: 8,250 + 835.40 = 9,085.40. + medicaid_optional_senior_or_disabled_countable_income: 9_085.4 + medicaid_optional_senior_or_disabled_countable_income_monthly: + 2020-11: 750 + 2020-12: 835.4 - name: California deducts both spouses' Part B premiums and other health insurance premiums from a couple's combined income. period: 2026 @@ -312,8 +318,9 @@ output: # ACWDL 00-57 MC 176 lines 10-16: the unused 20-dollar deduction joins the # 65-dollar deduction, then half the rest counts, then the disregard. - # ((1,000 - 65 - 20) / 2 - 230) x 12 = 2,730. - medicaid_optional_senior_or_disabled_countable_income: 2_730 + # ((1,000 - 65 - 20) / 2 - 230) x 11 = 2,502.50 for January-November; + # December 2020 has no disregard (ACWDL 20-24): 457.50. Total 2,960. + medicaid_optional_senior_or_disabled_countable_income: 2_960 - name: California subtracts the 310-dollar couple disregard in 2020. period: 2020 @@ -338,8 +345,10 @@ members: [person1, person2] state_code: CA output: - # ACWDL 00-57 MC 176 lines 8 and 16: (1,950 - 20 - 310) x 12 / 2 = 9,720 each. - medicaid_optional_senior_or_disabled_countable_income: [9_720, 9_720] + # ACWDL 00-57 MC 176 lines 8 and 16: (1,950 - 20 - 310) x 11 = 17,820 for + # January-November; December 2020 has no disregard (ACWDL 20-24): + # 1,930. (17,820 + 1,930) / 2 = 9,875 each. + medicaid_optional_senior_or_disabled_countable_income: [9_875, 9_875] - name: California deducted other health insurance premiums before 12/2020. period: 2019 @@ -1102,7 +1111,7 @@ medicaid_optional_senior_or_disabled_countable_income: [25_370, 0] is_optional_senior_or_disabled_income_eligible: [false, false] -- name: A spouse's facility stay from July counts by December's status for the whole year, as an annual approximation. +- name: A spouse's facility stay from July changes each month's income before the annual total. period: 2025 absolute_error_margin: 0.01 input: @@ -1135,17 +1144,18 @@ ssi_couple_computation_applies: 2025-06: [true, true] 2025-07: [false, false] - # This annual formula applies December's status, separate, to the whole - # year, so each spouse counts their own income in all twelve months, - # including January to June, when SSI combines the couple's income. - # person1: (1,000 - 20) + (1,000 - 65) / 2 = 980 + 467.50 = 1,447.50, - # x 12 = 17,370. person2: (500 - 20) x 12 = 5,760. - # Summing the monthly ssi_marital_* variables instead would combine the - # couple's income through June. Unearned, 1,500 a month: person1 - # 15,000 - 240 + 5,610 = 20,370 and person2 12,000 - 240 = 11,760. - # Earned, 1,000 a month: person2 gets 6,000 a year, so - # 5,760 + (500 - 65) / 2 x 12 = 8,370. - medicaid_optional_senior_or_disabled_countable_income: [17_370, 5_760] + # person1 has 1,000 of earned and 1,000 of unearned income a month; + # person2 has 500 of unearned income. + # January-June, combined: (1,500 - 20) + (1,000 - 65) / 2 = 1,947.50, + # so 973.75 each, x 6 = 5,842.50. + # July-December, separate: person1 (1,000 - 20) + (1,000 - 65) / 2 = + # 1,447.50, x 6 = 8,685; person2 (500 - 20) x 6 = 2,880. + # Annual totals: 5,842.50 + 8,685 = 14,527.50 and + # 5,842.50 + 2,880 = 8,722.50. + medicaid_optional_senior_or_disabled_countable_income: [14_527.50, 8_722.50] + medicaid_optional_senior_or_disabled_countable_income_monthly: + 2025-06: [973.75, 973.75] + 2025-07: [1_447.50, 480] - name: A California couple who are tax dependents do not take the filer's other dependents' premiums. period: 2026 diff --git a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/savings_programs/income/msp_countable_income.yaml b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/savings_programs/income/msp_countable_income.yaml index eaa204069fe..286d250a2bb 100644 --- a/policyengine_us/tests/policy/baseline/gov/hhs/medicare/savings_programs/income/msp_countable_income.yaml +++ b/policyengine_us/tests/policy/baseline/gov/hhs/medicare/savings_programs/income/msp_countable_income.yaml @@ -114,6 +114,102 @@ # Apply the couple's exclusions once: (2,500 - 20 - 65) / 2 = 1,207.50. msp_countable_income: [1_207.50, 1_207.50] +- name: MSP budgets monthly allocations for a student earning $1_000 per month + # 20 CFR 416.1163(d): deem only in months above the FBR differential. + # The spouse has $580 countable income in each month with no allocation. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + claimant: + age: 50 + person_id: 1 + is_tax_unit_head: true + is_ssi_disabled: true + is_medicare_eligible: true + spouse: + age: 48 + person_id: 2 + is_tax_unit_spouse: true + is_medicare_eligible: false + ssi_unearned_income: 600 * 12 + student: + age: 16 + person_id: 3 + parent_1_id: 1 + parent_2_id: 2 + is_tax_unit_dependent: true + is_full_time_student: true + employment_income: 1_000 * 12 + tax_units: + family: + members: [claimant, spouse, student] + marital_units: + parents: + members: [claimant, spouse] + student_unit: + members: [student] + households: + home: + members: [claimant, spouse, student] + state_code: TX + output: + people: + claimant: + msp_countable_income: + "2026": 1_160 + "2026-01": 0 + "2026-10": 0 + "2026-11": 580 + +- name: MSP budgets monthly allocations for a student earning $2_600 per month + # 20 CFR 416.1163(d): deem only in months above the FBR differential. + # The spouse has $580 countable income in each month with no allocation. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + claimant: + age: 50 + person_id: 1 + is_tax_unit_head: true + is_ssi_disabled: true + is_medicare_eligible: true + spouse: + age: 48 + person_id: 2 + is_tax_unit_spouse: true + is_medicare_eligible: false + ssi_unearned_income: 600 * 12 + student: + age: 16 + person_id: 3 + parent_1_id: 1 + parent_2_id: 2 + is_tax_unit_dependent: true + is_full_time_student: true + employment_income: 2_600 * 12 + tax_units: + family: + members: [claimant, spouse, student] + marital_units: + parents: + members: [claimant, spouse] + student_unit: + members: [student] + households: + home: + members: [claimant, spouse, student] + state_code: TX + output: + people: + claimant: + msp_countable_income: + "2026": 4_640 + "2026-01": 0 + "2026-04": 0 + "2026-05": 580 + - name: Case 6, Illinois exempts the first 25 dollars of income. period: 2026-01 absolute_error_margin: 0.01 diff --git a/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_parent.yaml b/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_parent.yaml index e27a7857693..4d097a341fc 100644 --- a/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_parent.yaml +++ b/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_parent.yaml @@ -85,6 +85,8 @@ is_ssi_disabled: true sibling: age: 14 + # Isolate pretax premiums from the student earned-income exclusion. + is_in_k12_school: false employment_income: 2_400 pre_tax_health_insurance_premiums: 1_200 parent: diff --git a/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse.yaml b/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse.yaml index 64125417f99..20f1e3a5253 100644 --- a/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse.yaml +++ b/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse.yaml @@ -73,6 +73,8 @@ pre_tax_health_insurance_premiums: 2_400 child: age: 14 + # Isolate pretax premiums from the student earned-income exclusion. + is_in_k12_school: false employment_income: 2_400 pre_tax_health_insurance_premiums: 1_200 tax_units: @@ -93,3 +95,51 @@ is_ssi_spousal_deeming_applies: [true, false, false] ssi_income_deemed_from_ineligible_spouse: [7_992, 0, 0] ssi_countable_income: [7_992, 0, 0] + +- name: Monthly child allocations floor each spouse income pool before annual aggregation + # With $1,000 monthly student wages, the allocations are $497 in + # January-September, $227 in October, then zero. The spouse has $100 + # unearned and $300 earned a month: both pools are exhausted in the + # first nine months; October leaves $173 earned; November-December + # leave $100 unearned and $300 earned each. An annual floor would + # incorrectly leave only $100 earned and no unearned income. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + claimant: + age: 50 + person_id: 1 + is_tax_unit_head: true + is_ssi_disabled: true + spouse: + age: 48 + person_id: 2 + is_tax_unit_spouse: true + employment_income: 300 * 12 + ssi_unearned_income: 100 * 12 + student: + age: 16 + person_id: 3 + parent_1_id: 1 + parent_2_id: 2 + is_tax_unit_dependent: true + employment_income: 1_000 * 12 + tax_units: + family: + members: [claimant, spouse, student] + marital_units: + parents: + members: [claimant, spouse] + student_unit: + members: [student] + households: + home: + members: [claimant, spouse, student] + state_code: TX + output: + people: + claimant: + ssi_earned_income_deemed_from_ineligible_spouse: 773 + ssi_unearned_income_deemed_from_ineligible_spouse: 200 + ssi: 11_928 diff --git a/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_income_deemed_from_ineligible_spouse.yaml b/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_income_deemed_from_ineligible_spouse.yaml index c3525434547..0dd6654e5d5 100644 --- a/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_income_deemed_from_ineligible_spouse.yaml +++ b/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_income_deemed_from_ineligible_spouse.yaml @@ -225,6 +225,104 @@ output: ssi_income_deemed_from_ineligible_spouse: [0, 0] +- name: Review r2 applies monthly spousal thresholds after a student's annual exclusion expires + # 20 CFR 416.1163(d), (e)(2): budget each month's allocations and cap + # before aggregation. Ten months at $994 and two at $911 = $11,762. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + claimant: + age: 50 + person_id: 1 + is_tax_unit_head: true + is_ssi_disabled: true + spouse: + age: 48 + person_id: 2 + is_tax_unit_spouse: true + ssi_unearned_income: 600 * 12 + student: + age: 16 + person_id: 3 + parent_1_id: 1 + parent_2_id: 2 + is_tax_unit_dependent: true + employment_income: 1_000 * 12 + tax_units: + family: + members: [claimant, spouse, student] + marital_units: + parents: + members: [claimant, spouse] + student_unit: + members: [student] + households: + home: + members: [claimant, spouse, student] + state_code: TX + output: + people: + student: + ssi_ineligible_child_allocation: 4_700 + claimant: + ssi_unearned_income_deemed_from_ineligible_spouse: 2_500 + ssi_income_deemed_from_ineligible_spouse: 1_160 + ssi: + "2026": 11_762 + "2026-01": 994 + "2026-10": 994 + "2026-11": 911 + +- name: Review r2 applies monthly spousal thresholds for wages above the student monthly exclusion + # Four months at $994 and eight at $911 = $11,264. The $307 child + # allocation in each of the first four months keeps deeming below $497. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + claimant: + age: 50 + person_id: 1 + is_tax_unit_head: true + is_ssi_disabled: true + spouse: + age: 48 + person_id: 2 + is_tax_unit_spouse: true + ssi_unearned_income: 600 * 12 + student: + age: 16 + person_id: 3 + parent_1_id: 1 + parent_2_id: 2 + is_tax_unit_dependent: true + employment_income: 2_600 * 12 + tax_units: + family: + members: [claimant, spouse, student] + marital_units: + parents: + members: [claimant, spouse] + student_unit: + members: [student] + households: + home: + members: [claimant, spouse, student] + state_code: TX + output: + people: + student: + ssi_ineligible_child_allocation: 1_228 + claimant: + ssi_unearned_income_deemed_from_ineligible_spouse: 5_972 + ssi_income_deemed_from_ineligible_spouse: 4_640 + ssi: + "2026": 11_264 + "2026-01": 994 + "2026-04": 994 + "2026-05": 911 + - name: Spouse income is deemed to an aged permanent resident without 40 SSI quarters (2025) period: 2025 absolute_error_margin: 0.01 @@ -336,8 +434,8 @@ # Couple: ($258.50 - $20) + ($2,000 - $65) / 2 = $1,206. # Alone: $258.50 - $20 = $238.50; deemed: $1,206 - $238.50 = $967.50. # Payment: min($1,491 - $1,206, $994 - $994 / 3) = $285. - ssi_in_kind_support_and_maintenance: [258.50, 0] + ssi_in_kind_support_and_maintenance_monthly: [258.50, 0] ssi_income_deemed_from_ineligible_spouse_monthly: [967.50, 0] - ssi_countable_income: [1_206, 0] + ssi_countable_income_monthly: [1_206, 0] uncapped_ssi_without_spousal_deeming: [662.67, 0] ssi: [285, 0] diff --git a/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_income_deemed_from_ineligible_spouse_monthly.yaml b/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_income_deemed_from_ineligible_spouse_monthly.yaml index 2257be84a6c..f0f6f04f19b 100644 --- a/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_income_deemed_from_ineligible_spouse_monthly.yaml +++ b/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_income_deemed_from_ineligible_spouse_monthly.yaml @@ -34,7 +34,7 @@ # Couple: $1306; alone: $338.5; deemed: $1306 - $338.5 = $967.5. # SSI: min($1,491 - $1306, $562.6667) = $185. ssi_income_deemed_from_ineligible_spouse_monthly: [967.5, 0] - ssi_countable_income: [1306, 0] + ssi_countable_income_monthly: [1306, 0] ssi: [185, 0] - name: Spouse unearned income shares one exclusion with claimant shelter support. @@ -68,7 +68,7 @@ # Couple: $938.5; alone: $238.5; deemed: $938.5 - $238.5 = $700. # SSI: min($1,491 - $938.5, $662.6667) = $552.5. ssi_income_deemed_from_ineligible_spouse_monthly: [700, 0] - ssi_countable_income: [938.5, 0] + ssi_countable_income_monthly: [938.5, 0] ssi: [552.5, 0] - name: Mixed spouse income shares one exclusion with claimant shelter support. @@ -102,7 +102,7 @@ # Couple: $1306; alone: $238.5; deemed: $1306 - $238.5 = $1067.5. # SSI: min($1,491 - $1306, $662.6667) = $185. ssi_income_deemed_from_ineligible_spouse_monthly: [1067.5, 0] - ssi_countable_income: [1306, 0] + ssi_countable_income_monthly: [1306, 0] ssi: [185, 0] - name: Cash income without shelter support preserves wages-only deeming. @@ -136,7 +136,7 @@ # Couple: $957.5; alone: $0; deemed: $957.5 - $0 = $957.5. # SSI: min($1,491 - $957.5, $994.0000) = $533.5. ssi_income_deemed_from_ineligible_spouse_monthly: [957.5, 0] - ssi_countable_income: [957.5, 0] + ssi_countable_income_monthly: [957.5, 0] ssi: [533.5, 0] - name: Cash income without shelter support preserves unearned-only deeming. @@ -170,7 +170,7 @@ # Couple: $680; alone: $0; deemed: $680 - $0 = $680. # SSI: min($1,491 - $680, $994.0000) = $811. ssi_income_deemed_from_ineligible_spouse_monthly: [680, 0] - ssi_countable_income: [680, 0] + ssi_countable_income_monthly: [680, 0] ssi: [811, 0] - name: Cash income without shelter support preserves mixed-income deeming. @@ -204,7 +204,7 @@ # Couple: $1147.5; alone: $80; deemed: $1147.5 - $80 = $1067.5. # SSI: min($1,491 - $1147.5, $914.0000) = $343.5. ssi_income_deemed_from_ineligible_spouse_monthly: [1067.5, 0] - ssi_countable_income: [1147.5, 0] + ssi_countable_income_monthly: [1147.5, 0] ssi: [343.5, 0] - name: Shelter support below the general exclusion leaves one dollar for wages. @@ -239,7 +239,7 @@ # Couple: $967; alone: $0; deemed: $967 - $0 = $967. # SSI: min($1,491 - $967, $994.0000) = $524. ssi_income_deemed_from_ineligible_spouse_monthly: [967, 0] - ssi_countable_income: [967, 0] + ssi_countable_income_monthly: [967, 0] ssi: [524, 0] - name: Shelter support at the general exclusion leaves none for wages. @@ -274,7 +274,7 @@ # Couple: $967.5; alone: $0; deemed: $967.5 - $0 = $967.5. # SSI: min($1,491 - $967.5, $994.0000) = $523.5. ssi_income_deemed_from_ineligible_spouse_monthly: [967.5, 0] - ssi_countable_income: [967.5, 0] + ssi_countable_income_monthly: [967.5, 0] ssi: [523.5, 0] - name: Shelter support above the general exclusion adds countable unearned income. @@ -309,7 +309,7 @@ # Couple: $968.5; alone: $1; deemed: $968.5 - $1 = $967.5. # SSI: min($1,491 - $968.5, $993.0000) = $522.5. ssi_income_deemed_from_ineligible_spouse_monthly: [967.5, 0] - ssi_countable_income: [968.5, 0] + ssi_countable_income_monthly: [968.5, 0] ssi: [522.5, 0] - name: Claimant cash below the general exclusion shares the remainder with support. @@ -343,7 +343,7 @@ # Couple: $1225; alone: $257.5; deemed: $1225 - $257.5 = $967.5. # SSI: min($1,491 - $1225, $643.6667) = $266. ssi_income_deemed_from_ineligible_spouse_monthly: [967.5, 0] - ssi_countable_income: [1225, 0] + ssi_countable_income_monthly: [1225, 0] ssi: [266, 0] - name: Claimant cash at the general exclusion leaves none for support. @@ -377,7 +377,7 @@ # Couple: $1226; alone: $258.5; deemed: $1226 - $258.5 = $967.5. # SSI: min($1,491 - $1226, $642.6667) = $265. ssi_income_deemed_from_ineligible_spouse_monthly: [967.5, 0] - ssi_countable_income: [1226, 0] + ssi_countable_income_monthly: [1226, 0] ssi: [265, 0] - name: Claimant cash above the general exclusion leaves none for support. @@ -411,7 +411,7 @@ # Couple: $1227; alone: $259.5; deemed: $1227 - $259.5 = $967.5. # SSI: min($1,491 - $1227, $641.6667) = $264. ssi_income_deemed_from_ineligible_spouse_monthly: [967.5, 0] - ssi_countable_income: [1227, 0] + ssi_countable_income_monthly: [1227, 0] ssi: [264, 0] - name: Claimant earnings share the earned exclusion across the couple. @@ -445,7 +445,7 @@ # Couple: $1256; alone: $256; deemed: $1256 - $256 = $1000. # SSI: min($1,491 - $1256, $645.1667) = $235. ssi_income_deemed_from_ineligible_spouse_monthly: [1000, 0] - ssi_countable_income: [1256, 0] + ssi_countable_income_monthly: [1256, 0] ssi: [235, 0] - name: Shelter support in July leaves other months unchanged and annual deeming sums the months. @@ -483,7 +483,7 @@ 2026-01: [957.50, 0] 2026-07: [967.50, 0] ssi_income_deemed_from_ineligible_spouse: [11_500, 0] - ssi_countable_income: + ssi_countable_income_monthly: 2026-01: [957.50, 0] 2026-07: [1_206, 0] ssi: diff --git a/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_spousal_deeming_child_allocations.yaml b/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_spousal_deeming_child_allocations.yaml new file mode 100644 index 00000000000..ae2c7e55236 --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_spousal_deeming_child_allocations.yaml @@ -0,0 +1,925 @@ +# 20 CFR 416.1163(b): before deeming an ineligible spouse's income, SSA +# deducts an allocation for each ineligible child. In 416.1160(d), SSA +# defines one as a child of the claimant, of the claimant's spouse, or 'of +# your parent or of your parent's spouse', who lives in the same household +# with the claimant and is not eligible for SSI benefits. 416.1160(c)(2) +# applies that definition to spouse deemors, so the claimant's siblings and +# step-siblings count. The allocation is the couple rate less the individual rate +# (416.1163(b)(1)): $168 a month in 1986 ($504 - $336) and $497 a month in +# 2026 ($1,491 - $994). Allocations come out of unearned income first, then +# earned income (416.1163(b)(3)). Deeming applies when the spouse's remaining +# income is more than that difference (416.1163(d)). + +- name: 416.1163(g) Example 1, the Todds, with parent ids + period: 1986 + absolute_error_margin: 0 + input: + people: + mr_todd: + age: 70 + person_id: 1 + is_tax_unit_head: true + mrs_todd: + age: 60 + person_id: 2 + is_tax_unit_spouse: true + ssi_unearned_income: 252 * 12 + mike: + age: 10 + person_id: 3 + parent_1_id: 1 + parent_2_id: 2 + is_tax_unit_dependent: true + tax_units: + tax_unit: + members: [mr_todd, mrs_todd, mike] + marital_units: + todds: + members: [mr_todd, mrs_todd] + mike_alone: + members: [mike] + households: + household: + members: [mr_todd, mrs_todd, mike] + state_code: TX + output: + is_ssi_ineligible_child: [false, false, true] + ssi_ineligible_child_allocation: [0, 0, 2_016] # $168 * 12 + # Mike is the child of both spouses, so each sees the same allocation. + ssi_spousal_deeming_child_allocations: [2_016, 2_016, 0] + ssi_unearned_income_deemed_from_ineligible_spouse: [1_008, 0, 0] # ($252 - $168) * 12 + # '$84 remaining income is not more than $168': nothing is deemed. + is_ssi_spousal_deeming_applies: [false, false, false] + ssi_income_deemed_from_ineligible_spouse: [0, 0, 0] + +- name: 416.1163(g) Example 2, the Joneses, with parent ids + period: 1986 + absolute_error_margin: 0 + input: + people: + mr_jones: + age: 50 + is_ssi_disabled: true + person_id: 1 + is_tax_unit_head: true + mrs_jones: + age: 48 + person_id: 2 + is_tax_unit_spouse: true + ssi_earned_income: 401 * 12 + ssi_unearned_income: 252 * 12 + christine: + age: 8 + person_id: 3 + parent_1_id: 1 + parent_2_id: 2 + is_tax_unit_dependent: true + tax_units: + tax_unit: + members: [mr_jones, mrs_jones, christine] + marital_units: + joneses: + members: [mr_jones, mrs_jones] + christine_alone: + members: [christine] + households: + household: + members: [mr_jones, mrs_jones, christine] + state_code: TX + output: + ssi_spousal_deeming_child_allocations: [2_016, 2_016, 0] + ssi_unearned_income_deemed_from_ineligible_spouse: [1_008, 0, 0] # $84 * 12 + ssi_earned_income_deemed_from_ineligible_spouse: [4_812, 0, 0] # $401 * 12 + # '$84 unearned plus $401 earned is more than $168'. + is_ssi_spousal_deeming_applies: [true, false, false] + # $64 unearned after the $20 exclusion plus $168 earned after $65 and + # half: $232 a month. + ssi_income_deemed_from_ineligible_spouse: [2_784, 0, 0] + ssi: [3_264, 0, 0] # ($504 - $232) * 12 + +- name: Example 1 when Mike receives public income-maintenance payments + # 416.1163(b): 'We do not allocate for ineligible children who are + # receiving public income-maintenance payments.' All of Mrs. Todd's $252 + # remains, which is more than $168, so it is deemed. + period: 1986 + absolute_error_margin: 0 + input: + people: + mr_todd: + age: 70 + person_id: 1 + is_tax_unit_head: true + mrs_todd: + age: 60 + person_id: 2 + is_tax_unit_spouse: true + ssi_unearned_income: 252 * 12 + mike: + age: 10 + person_id: 3 + parent_1_id: 1 + parent_2_id: 2 + is_tax_unit_dependent: true + ssi_receives_public_income_maintenance: true + tax_units: + tax_unit: + members: [mr_todd, mrs_todd, mike] + marital_units: + todds: + members: [mr_todd, mrs_todd] + mike_alone: + members: [mike] + households: + household: + members: [mr_todd, mrs_todd, mike] + state_code: TX + output: + is_ssi_ineligible_child: [false, false, true] + ssi_ineligible_child_allocation: [0, 0, 0] + ssi_spousal_deeming_child_allocations: [0, 0, 0] + ssi_unearned_income_deemed_from_ineligible_spouse: [3_024, 0, 0] # $252 * 12 + is_ssi_spousal_deeming_applies: [true, false, false] + ssi_income_deemed_from_ineligible_spouse: [2_784, 0, 0] # ($252 - $20) * 12 + ssi: [3_264, 0, 0] # ($504 - $232) * 12 + +- name: A grandchild in the claimant's tax unit is not the claimant's child + # The grandchild's id names their father, the claimants' son, who files + # alone. The grandparents claim the grandchild, but the grandchild is + # neither spouse's child, so no allocation is made. + period: 2026 + absolute_error_margin: 0 + input: + people: + grandmother: + age: 70 + person_id: 1 + is_tax_unit_head: true + grandfather: + age: 62 + person_id: 2 + is_tax_unit_spouse: true + ssi_unearned_income: 600 * 12 + father: + age: 35 + person_id: 3 + parent_1_id: 1 + parent_2_id: 2 + is_tax_unit_head: true + grandchild: + age: 8 + person_id: 4 + parent_1_id: 3 + is_tax_unit_dependent: true + tax_units: + grandparents: + members: [grandmother, grandfather, grandchild] + father_alone: + members: [father] + marital_units: + grandparents: + members: [grandmother, grandfather] + father_alone: + members: [father] + grandchild_alone: + members: [grandchild] + households: + household: + members: [grandmother, grandfather, father, grandchild] + state_code: TX + output: + is_ssi_ineligible_child: [false, false, false, true] + # The father's own total holds his child's allocation; he has no spouse, + # so nothing is deemed with it. + ssi_spousal_deeming_child_allocations: [0, 0, 5_964, 0] + ssi_unearned_income_deemed_from_ineligible_spouse: [7_200, 0, 0, 0] + # $600 is more than $497. + is_ssi_spousal_deeming_applies: [true, false, false, false] + ssi_income_deemed_from_ineligible_spouse: [6_960, 0, 0, 0] # ($600 - $20) * 12 + ssi: [10_932, 0, 0, 0] # ($1,491 - $580) * 12 + +- name: Without parent ids the tax-unit proxy still allocates for a grandchild + # The same household with no parent ids. The parent-link contract keeps + # the tax-unit grouping when no member has ids, and a grandchild there + # cannot be told apart from a child. Supplying ids, as above, avoids this. + period: 2026 + absolute_error_margin: 0 + input: + people: + grandmother: + age: 70 + is_tax_unit_head: true + grandfather: + age: 62 + is_tax_unit_spouse: true + ssi_unearned_income: 600 * 12 + father: + age: 35 + is_tax_unit_head: true + grandchild: + age: 8 + is_tax_unit_dependent: true + tax_units: + grandparents: + members: [grandmother, grandfather, grandchild] + father_alone: + members: [father] + marital_units: + grandparents: + members: [grandmother, grandfather] + father_alone: + members: [father] + grandchild_alone: + members: [grandchild] + households: + household: + members: [grandmother, grandfather, father, grandchild] + state_code: TX + output: + ssi_spousal_deeming_child_allocations: [5_964, 5_964, 0, 0] + ssi_unearned_income_deemed_from_ineligible_spouse: [1_236, 0, 0, 0] # ($600 - $497) * 12 + is_ssi_spousal_deeming_applies: [false, false, false, false] + ssi: [11_928, 0, 0, 0] # $994 * 12 + +- name: The spouse's child from another relationship, claimed by their other parent + # The stepson lives with his father and his father's wife, the claimant. + # His mother lives elsewhere and claims him. He is 'the natural or adopted + # child of your spouse ... who lives in the same household with you'. + period: 2026 + absolute_error_margin: 0 + input: + people: + claimant: + age: 40 + is_ssi_disabled: true + person_id: 1 + is_tax_unit_head: true + husband: + age: 42 + person_id: 2 + is_tax_unit_spouse: true + ssi_unearned_income: 600 * 12 + stepson: + age: 12 + person_id: 3 + parent_1_id: 2 + parent_2_id: 4 + is_tax_unit_dependent: true + mother: + age: 38 + person_id: 4 + is_tax_unit_head: true + tax_units: + couple: + members: [claimant, husband] + mother: + members: [mother, stepson] + marital_units: + couple: + members: [claimant, husband] + stepson_alone: + members: [stepson] + mother_alone: + members: [mother] + households: + home: + members: [claimant, husband, stepson] + state_code: TX + elsewhere: + members: [mother] + state_code: TX + output: + is_ssi_ineligible_child: [false, false, true, false] + # The mother does not live with her son, so her total is zero. + ssi_spousal_deeming_child_allocations: [5_964, 5_964, 0, 0] + ssi_unearned_income_deemed_from_ineligible_spouse: [1_236, 0, 0, 0] # ($600 - $497) * 12 + # $103 is not more than $497. + is_ssi_spousal_deeming_applies: [false, false, false, false] + ssi_income_deemed_from_ineligible_spouse: [0, 0, 0, 0] + ssi: [11_928, 0, 0, 0] # $994 * 12 + +- name: The claimants' own child, claimed in another tax unit, still counts + # Their daughter lives with them but her grandmother claims her. Tax + # filing does not change whose child she is or where she lives. + period: 2026 + absolute_error_margin: 0 + input: + people: + claimant: + age: 45 + is_ssi_disabled: true + person_id: 1 + parent_1_id: 4 + is_tax_unit_head: true + husband: + age: 47 + person_id: 2 + is_tax_unit_spouse: true + ssi_unearned_income: 600 * 12 + daughter: + age: 15 + person_id: 3 + parent_1_id: 1 + parent_2_id: 2 + is_tax_unit_dependent: true + grandmother: + age: 64 + person_id: 4 + is_tax_unit_head: true + tax_units: + couple: + members: [claimant, husband] + grandmother: + members: [grandmother, daughter] + marital_units: + couple: + members: [claimant, husband] + daughter_alone: + members: [daughter] + grandmother_alone: + members: [grandmother] + households: + household: + members: [claimant, husband, daughter, grandmother] + state_code: TX + output: + ssi_spousal_deeming_child_allocations: [5_964, 5_964, 0, 0] + ssi_unearned_income_deemed_from_ineligible_spouse: [1_236, 0, 0, 0] + is_ssi_spousal_deeming_applies: [false, false, false, false] + ssi_income_deemed_from_ineligible_spouse: [0, 0, 0, 0] + ssi: [11_928, 0, 0, 0] + +- name: A 19-year-old student who files her own return counts, and her wages do not reduce it + # 416.1856: a student under 22 regularly attending school is a child. + # 416.1161(c) excludes a student child's earned income up to the + # 416.1112(c)(3) amounts ($2,410 a month in 2026), so her $300 a month of + # wages leaves the full allocation. + period: 2026 + absolute_error_margin: 0 + input: + people: + claimant: + age: 50 + is_ssi_disabled: true + person_id: 1 + is_tax_unit_head: true + husband: + age: 52 + person_id: 2 + is_tax_unit_spouse: true + ssi_unearned_income: 600 * 12 + daughter: + age: 19 + is_full_time_college_student: true + employment_income: 300 * 12 + person_id: 3 + parent_1_id: 1 + parent_2_id: 2 + is_tax_unit_head: true + tax_units: + couple: + members: [claimant, husband] + daughter: + members: [daughter] + marital_units: + couple: + members: [claimant, husband] + daughter_alone: + members: [daughter] + households: + household: + members: [claimant, husband, daughter] + state_code: TX + output: + is_ssi_ineligible_child: [false, false, true] + ssi_ineligible_child_allocation: [0, 0, 5_964] + ssi_spousal_deeming_child_allocations: [5_964, 5_964, 0] + ssi_unearned_income_deemed_from_ineligible_spouse: [1_236, 0, 0] + is_ssi_spousal_deeming_applies: [false, false, false] + ssi: [11_928, 0, 0] + +- name: A child in the tax unit who lives in another household does not count + # No member has parent ids, so the tax-unit proxy applies, but only to + # children who live with the claimant: 'who lives in the same household + # with you'. + period: 2026 + absolute_error_margin: 0 + input: + people: + claimant: + age: 70 + is_tax_unit_head: true + wife: + age: 60 + is_tax_unit_spouse: true + ssi_unearned_income: 600 * 12 + son: + age: 16 + is_tax_unit_dependent: true + aunt: + age: 40 + is_tax_unit_head: true + tax_units: + family: + members: [claimant, wife, son] + aunt: + members: [aunt] + marital_units: + couple: + members: [claimant, wife] + son_alone: + members: [son] + aunt_alone: + members: [aunt] + households: + home: + members: [claimant, wife] + state_code: TX + away: + members: [son, aunt] + state_code: TX + output: + is_ssi_ineligible_child: [false, false, true, false] + ssi_spousal_deeming_child_allocations: [0, 0, 0, 0] + ssi_unearned_income_deemed_from_ineligible_spouse: [7_200, 0, 0, 0] + is_ssi_spousal_deeming_applies: [true, false, false, false] + ssi_income_deemed_from_ineligible_spouse: [6_960, 0, 0, 0] # ($600 - $20) * 12 + ssi: [10_932, 0, 0, 0] # ($1,491 - $580) * 12 + +- name: With parent links, a child without ids is presumed only for an unlinked parent + # The first child's ids name both spouses. The second has none. Neither + # spouse has a child that no id names (own_children_in_household is not + # supplied), so the parent-link contract does not presume the second + # child is theirs. + period: 2026 + absolute_error_margin: 0 + input: + people: + claimant: + age: 70 + person_id: 1 + is_tax_unit_head: true + husband: + age: 62 + person_id: 2 + is_tax_unit_spouse: true + ssi_unearned_income: 600 * 12 + linked_child: + age: 10 + person_id: 3 + parent_1_id: 1 + parent_2_id: 2 + is_tax_unit_dependent: true + child_without_ids: + age: 8 + person_id: 4 + is_tax_unit_dependent: true + tax_units: + tax_unit: + members: [claimant, husband, linked_child, child_without_ids] + marital_units: + couple: + members: [claimant, husband] + linked_child_alone: + members: [linked_child] + child_without_ids_alone: + members: [child_without_ids] + households: + household: + members: [claimant, husband, linked_child, child_without_ids] + state_code: TX + output: + ssi_spousal_deeming_child_allocations: [5_964, 5_964, 0, 0] + ssi_unearned_income_deemed_from_ineligible_spouse: [1_236, 0, 0, 0] + +- name: With parent links, a child without ids counts for an unlinked parent + # The claimant reports two children in the household but ids name only + # one, so the claimant is an unlinked parent and the second child, in the + # claimant's tax unit, is presumed to be theirs. + period: 2026 + absolute_error_margin: 0 + input: + people: + claimant: + age: 70 + person_id: 1 + own_children_in_household: 2 + is_tax_unit_head: true + husband: + age: 62 + person_id: 2 + is_tax_unit_spouse: true + ssi_unearned_income: 600 * 12 + linked_child: + age: 10 + person_id: 3 + parent_1_id: 1 + parent_2_id: 2 + is_tax_unit_dependent: true + child_without_ids: + age: 8 + person_id: 4 + is_tax_unit_dependent: true + tax_units: + tax_unit: + members: [claimant, husband, linked_child, child_without_ids] + marital_units: + couple: + members: [claimant, husband] + linked_child_alone: + members: [linked_child] + child_without_ids_alone: + members: [child_without_ids] + households: + household: + members: [claimant, husband, linked_child, child_without_ids] + state_code: TX + output: + ssi_spousal_deeming_child_allocations: [11_928, 11_928, 0, 0] + # The $11,928 of allocations exceed the husband's $7,200. + ssi_unearned_income_deemed_from_ineligible_spouse: [0, 0, 0, 0] + is_ssi_spousal_deeming_applies: [false, false, false, false] + +- name: Allocations beyond unearned income come out of earned income + # 416.1163(b)(3). Two children: $994 a month of allocations against $200 + # of unearned income leaves $794 to take from $1,500 of earnings: $706. + period: 2026 + absolute_error_margin: 0 + input: + people: + claimant: + age: 40 + is_ssi_disabled: true + person_id: 1 + is_tax_unit_head: true + husband: + age: 41 + person_id: 2 + is_tax_unit_spouse: true + ssi_unearned_income: 200 * 12 + ssi_earned_income: 1_500 * 12 + first_child: + age: 9 + person_id: 3 + parent_1_id: 1 + parent_2_id: 2 + is_tax_unit_dependent: true + second_child: + age: 6 + person_id: 4 + parent_1_id: 1 + parent_2_id: 2 + is_tax_unit_dependent: true + tax_units: + tax_unit: + members: [claimant, husband, first_child, second_child] + marital_units: + couple: + members: [claimant, husband] + first_child_alone: + members: [first_child] + second_child_alone: + members: [second_child] + households: + household: + members: [claimant, husband, first_child, second_child] + state_code: TX + output: + ssi_spousal_deeming_child_allocations: [11_928, 11_928, 0, 0] + ssi_unearned_income_deemed_from_ineligible_spouse: [0, 0, 0, 0] + ssi_earned_income_deemed_from_ineligible_spouse: [8_472, 0, 0, 0] # $706 * 12 + # $706 is more than $497. + is_ssi_spousal_deeming_applies: [true, false, false, false] + # $706 less the $20 general and $65 earned exclusions, halved: $310.50. + ssi_income_deemed_from_ineligible_spouse: [3_726, 0, 0, 0] + +- name: POMS SI 01320.400 D.2, Jack, August 2024 + # $472 allocation ($1,415 - $943). The spouse's $662 of unearned income + # less $472 leaves $190; with $715 of earnings that is more than $472. + # Countable: $190 - $20 = $170 unearned, ($715 - $65) / 2 = $325 earned, + # $495 in all. The same income is used in every month of the year. + period: 2024 + absolute_error_margin: 0 + input: + people: + jack: + age: 50 + is_ssi_disabled: true + person_id: 1 + is_tax_unit_head: true + spouse: + age: 48 + person_id: 2 + is_tax_unit_spouse: true + ssi_earned_income: 715 * 12 + ssi_unearned_income: 662 * 12 + child: + age: 9 + person_id: 3 + parent_1_id: 1 + parent_2_id: 2 + is_tax_unit_dependent: true + tax_units: + tax_unit: + members: [jack, spouse, child] + marital_units: + couple: + members: [jack, spouse] + child_alone: + members: [child] + households: + household: + members: [jack, spouse, child] + state_code: TX + output: + ssi_spousal_deeming_child_allocations: [5_664, 5_664, 0] # $472 * 12 + ssi_unearned_income_deemed_from_ineligible_spouse: [2_280, 0, 0] # $190 * 12 + ssi_earned_income_deemed_from_ineligible_spouse: [8_580, 0, 0] # $715 * 12 + is_ssi_spousal_deeming_applies: [true, false, false] + ssi_income_deemed_from_ineligible_spouse: [5_940, 0, 0] # $495 * 12 + ssi: [11_040, 0, 0] # ($1,415 - $495) * 12 + +- name: The claimant's brother, whose mother lives elsewhere, gets an allocation + # 416.1160(d): the brother is the child 'of your parent', and he lives in + # the claimant's household. Both carry their mother's id, 10, which names + # no one in the simulation. + # Allocation: $1,491 - $994 = $497 a month, $5,964 a year. + # Spouse's unearned income after it: $1,000 - $497 = $503, $6,036 a year. + # $503 is more than $497, so deeming applies (416.1163(d)(2)). + # Deemed: $503 - $20 = $483 a month, $5,796 a year. + # SSI: the couple rate less $483 is $1,008, and the individual rate less + # the claimant's own countable income of $0 is $994. The lesser, $994, + # applies (416.1163(e)(2)): $11,928 a year. + # Without the allocation the spouse's $1,000 would leave $980 countable + # and SSI of $1,491 - $980 = $511 a month. + period: 2026 + absolute_error_margin: 0 + input: + people: + claimant: + age: 30 + is_ssi_disabled: true + person_id: 1 + parent_1_id: 10 + is_tax_unit_head: true + husband: + age: 32 + person_id: 2 + is_tax_unit_spouse: true + ssi_unearned_income: 1_000 * 12 + brother: + age: 15 + person_id: 3 + parent_1_id: 10 + is_tax_unit_dependent: true + tax_units: + tax_unit: + members: [claimant, husband, brother] + marital_units: + couple: + members: [claimant, husband] + brother_alone: + members: [brother] + households: + household: + members: [claimant, husband, brother] + state_code: TX + output: + is_ssi_ineligible_child: [false, false, true] + ssi_spousal_deeming_child_allocations: [5_964, 0, 0] # $497 * 12 + ssi_unearned_income_deemed_from_ineligible_spouse: [6_036, 0, 0] # ($1,000 - $497) * 12 + is_ssi_spousal_deeming_applies: [true, false, false] + ssi_income_deemed_from_ineligible_spouse: [5_796, 0, 0] # ($503 - $20) * 12 + ssi: [11_928, 0, 0] # min($1,491 - $483, $994) * 12 + +- name: The claimant's sister, who lives with their mother, gets an allocation + # The mother lives in the household and files with her younger daughter. + # Both daughters' ids name her. The sister is the child 'of your parent' + # for the claimant, so the husband's income takes her allocation, as in + # the case above: $497 a month, $503 left, $483 deemed and $994 of SSI. + # The mother's own total also holds her daughter's allocation; she has no + # spouse, so nothing is deemed with it. + period: 2026 + absolute_error_margin: 0 + input: + people: + claimant: + age: 30 + is_ssi_disabled: true + person_id: 1 + parent_1_id: 3 + is_tax_unit_head: true + husband: + age: 32 + person_id: 2 + is_tax_unit_spouse: true + ssi_unearned_income: 1_000 * 12 + mother: + age: 55 + person_id: 3 + is_tax_unit_head: true + sister: + age: 16 + person_id: 4 + parent_1_id: 3 + is_tax_unit_dependent: true + tax_units: + couple: + members: [claimant, husband] + mother: + members: [mother, sister] + marital_units: + couple: + members: [claimant, husband] + mother_alone: + members: [mother] + sister_alone: + members: [sister] + households: + household: + members: [claimant, husband, mother, sister] + state_code: TX + output: + is_ssi_ineligible_child: [false, false, false, true] + ssi_spousal_deeming_child_allocations: [5_964, 0, 5_964, 0] # $497 * 12 + ssi_unearned_income_deemed_from_ineligible_spouse: [6_036, 0, 0, 0] # ($1,000 - $497) * 12 + is_ssi_spousal_deeming_applies: [true, false, false, false] + ssi_income_deemed_from_ineligible_spouse: [5_796, 0, 0, 0] # ($503 - $20) * 12 + ssi: [11_928, 0, 0, 0] # min($1,491 - $483, $994) * 12 + +- name: The claimant's stepbrother, the son of the claimant's mother's husband, gets an allocation + # The claimant's id names her mother. The stepbrother's id names the + # mother's husband, who is not the claimant's parent. He is the child 'of + # your parent's spouse' (416.1160(d)), so the claimant's total takes his + # allocation: $497 a month, $503 left, $483 deemed and $994 of SSI. + # The mother and her husband each hold the same allocation, for his son; + # neither is aged, blind or disabled, so nothing is deemed with it. + period: 2026 + absolute_error_margin: 0 + input: + people: + claimant: + age: 30 + is_ssi_disabled: true + person_id: 1 + parent_1_id: 3 + is_tax_unit_head: true + husband: + age: 32 + person_id: 2 + is_tax_unit_spouse: true + ssi_unearned_income: 1_000 * 12 + mother: + age: 55 + person_id: 3 + is_tax_unit_head: true + stepfather: + age: 57 + person_id: 4 + is_tax_unit_spouse: true + stepbrother: + age: 14 + person_id: 5 + parent_1_id: 4 + is_tax_unit_dependent: true + tax_units: + couple: + members: [claimant, husband] + parents: + members: [mother, stepfather, stepbrother] + marital_units: + couple: + members: [claimant, husband] + parents: + members: [mother, stepfather] + stepbrother_alone: + members: [stepbrother] + households: + household: + members: [claimant, husband, mother, stepfather, stepbrother] + state_code: TX + output: + is_ssi_ineligible_child: [false, false, false, false, true] + ssi_spousal_deeming_child_allocations: [5_964, 0, 5_964, 5_964, 0] # $497 * 12 + ssi_unearned_income_deemed_from_ineligible_spouse: [6_036, 0, 0, 0, 0] # ($1,000 - $497) * 12 + is_ssi_spousal_deeming_applies: [true, false, false, false, false] + ssi_income_deemed_from_ineligible_spouse: [5_796, 0, 0, 0, 0] # ($503 - $20) * 12 + ssi: [11_928, 0, 0, 0, 0] # min($1,491 - $483, $994) * 12 + +- name: The husband's sister gets no allocation from his income + # 'You' in 416.1160(d) is the claimant (416.1101). The girl is the child + # of the husband's parent, not of the claimant's, so the claimant's total + # holds nothing for her and all $1,000 stays: $1,000 is more than $497, + # $1,000 - $20 = $980 is deemed, and SSI is $1,491 - $980 = $511 a month. + # The husband's own total counts his sister. Deeming reads the + # claimant's total, so his changes nothing. + period: 2026 + absolute_error_margin: 0 + input: + people: + claimant: + age: 30 + is_ssi_disabled: true + person_id: 1 + is_tax_unit_head: true + husband: + age: 32 + person_id: 2 + parent_1_id: 20 + is_tax_unit_spouse: true + ssi_unearned_income: 1_000 * 12 + husbands_sister: + age: 15 + person_id: 3 + parent_1_id: 20 + is_tax_unit_dependent: true + tax_units: + tax_unit: + members: [claimant, husband, husbands_sister] + marital_units: + couple: + members: [claimant, husband] + husbands_sister_alone: + members: [husbands_sister] + households: + household: + members: [claimant, husband, husbands_sister] + state_code: TX + output: + is_ssi_ineligible_child: [false, false, true] + ssi_spousal_deeming_child_allocations: [0, 5_964, 0] + ssi_unearned_income_deemed_from_ineligible_spouse: [12_000, 0, 0] # $1,000 * 12 + is_ssi_spousal_deeming_applies: [true, false, false] + ssi_income_deemed_from_ineligible_spouse: [11_760, 0, 0] # ($1,000 - $20) * 12 + ssi: [6_132, 0, 0] # ($1,491 - $980) * 12 + +- name: A half-brother and a stepbrother named through the second parent slots get allocations + # The claimant's ids name her father, 10, who lives elsewhere, and her + # mother, 3. The half-brother's first id names the same mother, so he is + # the child 'of your parent' (416.1160(d)). The stepbrother's second id + # names the mother's husband, 4, so he is the child 'of your parent's + # spouse'. Allocations: 2 x ($1,491 - $994) = $994 a month, $11,928 a year. + # Spouse's unearned income after them: $1,000 - $994 = $6, not more than + # $497, so nothing is deemed (416.1163(d)(1)) and SSI is $994 a month. + # The mother and stepfather each hold both boys' allocations; neither is + # aged, blind or disabled, so nothing is deemed with them. + period: 2026 + absolute_error_margin: 0 + input: + people: + claimant: + age: 30 + is_ssi_disabled: true + person_id: 1 + parent_1_id: 10 + parent_2_id: 3 + is_tax_unit_head: true + husband: + age: 32 + person_id: 2 + is_tax_unit_spouse: true + ssi_unearned_income: 1_000 * 12 + mother: + age: 55 + person_id: 3 + is_tax_unit_head: true + stepfather: + age: 57 + person_id: 4 + is_tax_unit_spouse: true + half_brother: + age: 15 + person_id: 5 + parent_1_id: 3 + parent_2_id: 20 + is_tax_unit_dependent: true + stepbrother: + age: 13 + person_id: 6 + parent_1_id: 30 + parent_2_id: 4 + is_tax_unit_dependent: true + tax_units: + couple: + members: [claimant, husband] + parents: + members: [mother, stepfather, half_brother, stepbrother] + marital_units: + couple: + members: [claimant, husband] + parents: + members: [mother, stepfather] + half_brother_alone: + members: [half_brother] + stepbrother_alone: + members: [stepbrother] + households: + household: + members: [claimant, husband, mother, stepfather, half_brother, stepbrother] + state_code: TX + output: + is_ssi_ineligible_child: [false, false, false, false, true, true] + ssi_spousal_deeming_child_allocations: [11_928, 0, 11_928, 11_928, 0, 0] # $994 * 12 + ssi_unearned_income_deemed_from_ineligible_spouse: [72, 0, 0, 0, 0, 0] # ($1,000 - $994) * 12 + is_ssi_spousal_deeming_applies: [false, false, false, false, false, false] + ssi_income_deemed_from_ineligible_spouse: [0, 0, 0, 0, 0, 0] + ssi: [11_928, 0, 0, 0, 0, 0] # $994 * 12 diff --git a/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/deemed/ssi_ineligible_child_allocation.yaml b/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/deemed/ssi_ineligible_child_allocation.yaml index 76164837620..a6df6a9e2dd 100644 --- a/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/deemed/ssi_ineligible_child_allocation.yaml +++ b/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/deemed/ssi_ineligible_child_allocation.yaml @@ -1,3 +1,4 @@ + - name: Child with no income, full allocation period: 2022 input: @@ -5,11 +6,97 @@ output: ssi_ineligible_child_allocation: 5_040 # (1,261 - 841) * 12 +- name: No allocation for a child receiving public income-maintenance payments + # 416.1163(b): 'We do not allocate for ineligible children who are + # receiving public income-maintenance payments (see § 416.1142(a)).' + period: 2026 + input: + age: 14 + ssi_receives_public_income_maintenance: true + output: + ssi_ineligible_child_allocation: 0 + +- name: The child's unearned income reduces the allocation + # 416.1163(b)(2). ($1,491 - $994 - $200) * 12. + period: 2026 + input: + age: 10 + ssi_unearned_income: 200 * 12 + output: + ssi_ineligible_child_allocation: 3_564 + +- name: A student child's wages up to the student exclusion do not reduce it + # 416.1161(c) excludes a student child's earned income up to the + # 416.1112(c)(3) amounts: $2,410 a month and $9,730 a year in 2026. + period: 2026 + input: + age: 16 + employment_income: 500 * 12 + output: + ssi_ineligible_child_allocation: 5_964 # $497 * 12 + +- name: Once the student exclusion's yearly limit is used up, wages reduce it + # $1,000 a month is excluded in full for nine months ($9,000), leaving + # $730 of the $9,730 yearly limit. In month 10, $270 counts: $497 - $270 = + # $227. In months 11 and 12, $1,000 counts and the allocation is zero; + # the excess does not reduce other months (416.1163(b)(2), monthly). + period: 2026 + input: + age: 16 + employment_income: 1_000 * 12 + output: + ssi_ineligible_child_allocation: 4_700 # 9 * 497 + 227 + +- name: Student wages above the monthly exclusion reduce each month separately + # $2,600 a month: $2,410 is excluded in months 1-4 ($9,640), leaving $190 + # counted and a $307 allocation each month. In month 5 only the last $90 + # of the yearly limit is excluded, so $2,510 counts and the allocation is + # zero, as in months 6-12. + period: 2026 + input: + age: 17 + employment_income: 2_600 * 12 + output: + ssi_ineligible_child_allocation: 1_228 # 4 * 307 + +- name: A child who is not a student has no wage exclusion + period: 2026 + input: + age: 17 + is_in_k12_school: false + employment_income: 300 * 12 + output: + ssi_ineligible_child_allocation: 2_364 # 5,964 - 3,600 + +- name: A child's net business loss does not raise the allocation + # 416.1163(b)(1)-(2): the allocation is the couple rate less the + # individual rate, reduced by the child's income. A loss is no income. + period: 2026 + input: + age: 17 + is_in_k12_school: false + ssi_earned_income: -20_000 + output: + ssi_ineligible_child_allocation: 5_964 # $497 * 12 + +- name: Negative unearned income neither raises the allocation nor offsets wages + # $300 a month of wages reduce it; the -$250 a month does not. + period: 2026 + input: + age: 17 + is_in_k12_school: false + ssi_earned_income: 300 * 12 + ssi_unearned_income: -3_000 + output: + ssi_ineligible_child_allocation: 2_364 # 5,964 - 3,600 + - name: Ineligible child's pretax premiums do not reduce the child allocation as wages. period: 2025 absolute_error_margin: 0.01 input: age: 14 + # Isolate the pretax-premium rule from the new student exclusion. + is_in_k12_school: false employment_income: 2_400 pre_tax_health_insurance_premiums: 1_200 output: diff --git a/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/deemed/ssi_unearned_income_deemed_from_ineligible_parent.yaml b/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/deemed/ssi_unearned_income_deemed_from_ineligible_parent.yaml new file mode 100644 index 00000000000..e6b49eba8be --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/deemed/ssi_unearned_income_deemed_from_ineligible_parent.yaml @@ -0,0 +1,156 @@ +- name: Review r2 excludes a permanently absent adult student's allocation from parental deeming + # 20 CFR 416.1165(b): allocations cover ineligible children in the household. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + person_id: 1 + is_tax_unit_head: true + ssi_unearned_income: 24_000 + claimant: + age: 10 + person_id: 2 + parent_1_id: 1 + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + student: + age: 20 + person_id: 3 + parent_1_id: 1 + is_tax_unit_dependent: true + is_full_time_college_student: true + tax_units: + family: + members: [parent, claimant, student] + marital_units: + parent_unit: + members: [parent] + claimant_unit: + members: [claimant] + student_unit: + members: [student] + households: + home: + members: [parent, claimant] + state_code: TX + away: + members: [student] + state_code: TX + output: + people: + claimant: + # 24,000 - 240 general exclusion - 11,928 parent allocation. + ssi_unearned_income_deemed_from_ineligible_parent: 11_832 + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 11_832 + # 11,928 - (11,832 - 240 own general exclusion). + ssi: 336 + student: + ssi_ineligible_child_allocation: 5_964 + +- name: Review r2 excludes an immigration-ineligible sibling from the SSI parental recipient divisor + # 20 CFR 416.1165(e)(2): divide the remainder among eligible children only. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + person_id: 1 + is_tax_unit_head: true + ssi_unearned_income: 24_000 + claimant: + age: 10 + person_id: 2 + parent_1_id: 1 + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + sibling: + age: 12 + person_id: 3 + parent_1_id: 1 + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: UNDOCUMENTED + tax_units: + family: + members: [parent, claimant, sibling] + marital_units: + parent_unit: + members: [parent] + claimant_unit: + members: [claimant] + sibling_unit: + members: [sibling] + households: + home: + members: [parent, claimant, sibling] + state_code: TX + output: + people: + claimant: + # 24,000 - 5,964 sibling allocation - 240 - 11,928 = 5,868. + ssi_unearned_income_deemed_from_ineligible_parent: 5_868 + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5_868 + ssi: 6_300 + sibling: + is_ssi_ineligible_child: true + ssi_ineligible_child_allocation: 5_964 + ssi_unearned_income_deemed_from_ineligible_parent: 0 + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 0 + +- name: Review r2 Medicaid uses California's broader immigration eligibility independently of SSI + # California covers undocumented minors. Both are Medicaid recipients, so + # neither receives an ineligible-child allocation in Medicaid's own pool. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + person_id: 1 + is_tax_unit_head: true + ssi_unearned_income: 24_000 + claimant: + age: 10 + person_id: 2 + parent_1_id: 1 + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + sibling: + age: 12 + person_id: 3 + parent_1_id: 1 + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: UNDOCUMENTED + tax_units: + family: + members: [parent, claimant, sibling] + marital_units: + parent_unit: + members: [parent] + claimant_unit: + members: [claimant] + sibling_unit: + members: [sibling] + households: + home: + members: [parent, claimant, sibling] + state_code: CA + output: + people: + claimant: + ssi_unearned_income_deemed_from_ineligible_parent: 5_868 + # California's disregard is the $20 any-income deduction since #10364 + # (its other $210 comes off countable income after the exclusions): + # (24,000 - 20 * 12 - 11,928 parent allocation) / 2 = 5,916. + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5_916 + sibling: + is_medicaid_immigration_status_eligible: true + ssi_unearned_income_deemed_from_ineligible_parent: 0 + medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent: 5_916 diff --git a/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/ism/ssi_in_kind_support_and_maintenance.yaml b/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/ism/ssi_in_kind_support_and_maintenance.yaml index e0b721f1d35..3b0c9198412 100644 --- a/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/ism/ssi_in_kind_support_and_maintenance.yaml +++ b/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/income/ism/ssi_in_kind_support_and_maintenance.yaml @@ -85,7 +85,7 @@ output: # December pays on October income, which excludes food (416.420(a)). ssi_pmv_applies: false - ssi_in_kind_support_and_maintenance: 0 + ssi_in_kind_support_and_maintenance_monthly: 0 - name: Case 7, food-only support triggers PMV before the exclusion. period: 2024-08 @@ -99,11 +99,11 @@ 2024: true ssi_receives_outside_shelter_support: false ssi_receives_shelter_from_others_in_household: false - ssi_pmv_amount: 334.33 + ssi_pmv_amount_monthly: 334.33 output: # $943 / 3 + $20 = $334.33 monthly PMV (20 CFR 416.1140(a)(1)). ssi_pmv_applies: true - ssi_in_kind_support_and_maintenance: 334.33 + ssi_in_kind_support_and_maintenance_monthly: 334.33 - name: Case 8, shelter support continues to trigger PMV after the exclusion. period: 2024-10 @@ -117,10 +117,10 @@ 2024: false ssi_receives_outside_shelter_support: true ssi_receives_shelter_from_others_in_household: false - ssi_pmv_amount: 334.33 + ssi_pmv_amount_monthly: 334.33 output: ssi_pmv_applies: true - ssi_in_kind_support_and_maintenance: 334.33 + ssi_in_kind_support_and_maintenance_monthly: 334.33 - name: Case 9, monthly PMV amount for an individual in 2024. period: 2024-10 @@ -131,4 +131,4 @@ age: 40 output: # $943 / 3 + $20, a monthly amount. - ssi_pmv_amount: 334.33 + ssi_pmv_amount_monthly: 334.33 diff --git a/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/resources/deemed/ssi_resources_deemed_from_ineligible_parent.yaml b/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/resources/deemed/ssi_resources_deemed_from_ineligible_parent.yaml index d859af08f9b..135ef34692f 100644 --- a/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/resources/deemed/ssi_resources_deemed_from_ineligible_parent.yaml +++ b/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/resources/deemed/ssi_resources_deemed_from_ineligible_parent.yaml @@ -2248,7 +2248,7 @@ home: members: [parent, food_supported_child, sibling] output: - ssi_countable_income: + ssi_countable_income_monthly: 2024-01: [0, 680, 0] 2024-11: [0, 680, 0] 2024-12: [0, 680, 0] @@ -2283,7 +2283,7 @@ meets_ssi_disability_criteria: true is_tax_unit_dependent: true is_household_head: false - ssi_countable_income: + ssi_countable_income_monthly: 2024-01: 1_014.33 2024-12: 680 ssi_countable_resources: 0 diff --git a/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/status/is_ssi_ineligible_child.yaml b/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/status/is_ssi_ineligible_child.yaml new file mode 100644 index 00000000000..32f0da2918b --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/status/is_ssi_ineligible_child.yaml @@ -0,0 +1,201 @@ +# 416.1160(d): an ineligible child is a child, 'as the term child is defined +# in § 416.1101', who 'is not eligible for SSI benefits'. 416.1856: under 18, +# or under 22 and a student regularly attending school; not married; not the +# head of a household. + +- name: An unmarried 17-year-old is a child + period: 2026 + input: + age: 17 + output: + is_ssi_ineligible_child: true + +- name: An 18-year-old who is not in school is not a child + period: 2026 + input: + age: 18 + output: + is_ssi_ineligible_child: false + +- name: A 21-year-old full-time college student is a child + period: 2026 + input: + age: 21 + is_full_time_college_student: true + output: + is_ssi_ineligible_child: true + +- name: A 22-year-old full-time college student is not a child + period: 2026 + input: + age: 22 + is_full_time_college_student: true + output: + is_ssi_ineligible_child: false + +- name: A 16-year-old head of a household is not a child + period: 2026 + input: + age: 16 + is_household_head: true + output: + is_ssi_ineligible_child: false + +- name: A married 17-year-old is not a child + # Tax roles are supplied: when they are omitted the model makes the minor + # spouse a dependent, and the SSI spouse test cannot then see the marriage. + period: 2026 + input: + people: + wife: + age: 17 + is_tax_unit_spouse: true + husband: + age: 20 + is_tax_unit_head: true + tax_units: + tax_unit: + members: [wife, husband] + marital_units: + couple: + members: [wife, husband] + households: + household: + members: [wife, husband] + output: + is_ssi_ineligible_child: [false, false] + +- name: A disabled child who is a citizen is treated as eligible for SSI + period: 2026 + input: + age: 10 + is_ssi_disabled: true + output: + is_ssi_ineligible_child: false + +- name: A disabled child without qualifying immigration status is not eligible for SSI + period: 2026 + input: + age: 10 + is_ssi_disabled: true + immigration_status: UNDOCUMENTED + output: + is_ssi_ineligible_child: true + +- name: Review r2 a married student remains married while her husband lives elsewhere + # 20 CFR 416.1856(b) and 416.1806(a)(1): legal marriage does not require + # co-residence, although spousal deeming does. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + claimant: + age: 70 + person_id: 1 + is_tax_unit_head: true + spouse: + age: 60 + person_id: 2 + is_tax_unit_spouse: true + ssi_unearned_income: 600 * 12 + daughter: + age: 20 + person_id: 3 + parent_1_id: 1 + parent_2_id: 2 + is_tax_unit_spouse: true + is_full_time_college_student: true + husband: + age: 22 + person_id: 4 + is_tax_unit_head: true + tax_units: + parents: + members: [claimant, spouse] + daughter_couple: + members: [daughter, husband] + marital_units: + parents: + members: [claimant, spouse] + daughter_unit: + members: [daughter] + husband_unit: + members: [husband] + households: + home: + members: [claimant, spouse, daughter] + state_code: TX + away: + members: [husband] + state_code: TX + output: + people: + daughter: + is_ssi_ineligible_child: false + ssi_ineligible_child_allocation: 0 + claimant: + ssi: 10_932 + +- name: Review r2 a 21-year-old student was not an ineligible child before June 2008 + # POMS SI 01310.115 A.3: before June 16, 2008 the deeming age limit was 21. + period: 1986 + absolute_error_margin: 0.01 + input: + people: + claimant: + age: 70 + person_id: 1 + is_tax_unit_head: true + spouse: + age: 60 + person_id: 2 + is_tax_unit_spouse: true + ssi_unearned_income: 252 * 12 + student: + age: 21 + person_id: 3 + parent_1_id: 1 + parent_2_id: 2 + is_tax_unit_dependent: true + is_full_time_college_student: true + tax_units: + family: + members: [claimant, spouse, student] + marital_units: + parents: + members: [claimant, spouse] + student_unit: + members: [student] + households: + home: + members: [claimant, spouse, student] + state_code: TX + output: + people: + student: + is_ssi_ineligible_child: false + ssi_ineligible_child_allocation: 0 + claimant: + ssi: 3_264 + +- name: Review r2 the deeming student age limit is under 21 in May 2008 + period: 2008-05 + input: + # Demographic inputs are annual; do not date them after January 1. + age: + 2008: 21 + is_full_time_college_student: + 2008: true + output: + is_ssi_ineligible_child: false + +- name: Review r2 the deeming student age limit is under 22 in July 2008 + period: 2008-07 + input: + # Demographic inputs are annual; do not date them after January 1. + age: + 2008: 21 + is_full_time_college_student: + 2008: true + output: + is_ssi_ineligible_child: true diff --git a/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/status/is_ssi_ineligible_parent.yaml b/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/status/is_ssi_ineligible_parent.yaml index 83bdf6c68d4..3da1569498d 100644 --- a/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/status/is_ssi_ineligible_parent.yaml +++ b/policyengine_us/tests/policy/baseline/gov/ssa/ssi/eligibility/status/is_ssi_ineligible_parent.yaml @@ -1105,3 +1105,174 @@ is_ssi_ineligible_parent: [true, true, false] ssi_unearned_income_deemed_from_ineligible_parent: [0, 0, 0] ssi: [0, 0, 11_928] + +# The couple's 19-year-old student earns 2,000 a month. The student exclusion +# (2,410 a month, 9,730 a year) covers January to April and 1,730 of May, so the +# allocation is 497 through April, 497 - 270 = 227 in May and 0 from June. The +# spouse's 520 pension leaves 23, 293 and 520: spousal deeming applies from June, +# when 520 exceeds 1,491 - 994 = 497, and the monthly budgets deem 520 x 7 = 3,640. +# Over the year the remaining spouse income, 23 x 4 + 293 + 520 x 7 = 4,025, stays +# within 497 x 12 = 5,964, so the year's test deems nothing and uses the individual +# rate: 13,440 - 240 = 13,200 exceeds 994 x 12 = 11,928 and the parent is flagged. +# December's status alone would test 13,200 against 1,491 x 12 = 17,892 and leave +# the parent unflagged. Month by month the parent has no SSI: 1,100 exceeds 994 +# through May, and 1,620 exceeds 1,491 from June. +- name: Case 30, parent whose spouse is deemed only from June is tested on the year's comparison. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + person1: + age: 45 + is_tax_unit_head: true + own_children_in_household: 2 + meets_ssi_disability_criteria: true + taxable_pension_income: 13_440 + person2: + age: 45 + is_tax_unit_spouse: true + own_children_in_household: 2 + taxable_pension_income: 6_240 + person3: + age: 19 + is_tax_unit_dependent: true + is_full_time_student: true + employment_income_before_lsr: 24_000 + person4: + age: 10 + is_tax_unit_dependent: true + meets_ssi_disability_criteria: true + tax_units: + tax_unit: + members: [person1, person2, person3, person4] + marital_units: + marital_unit1: + members: [person1, person2] + marital_unit2: + members: [person3] + marital_unit3: + members: [person4] + households: + household: + members: [person1, person2, person3, person4] + state_code: TX + output: + is_ssi_spousal_deeming_applies_monthly: + 2026-05: [false, false, false, false] + 2026-06: [true, false, false, false] + 2026-12: [true, false, false, false] + ssi_income_deemed_from_ineligible_spouse: [3_640, 0, 0, 0] + is_ssi_ineligible_parent: [true, true, false, false] + +# Vermont, where the couple's at-home supplement (105.80 a month) exceeds the +# individual's (55.68). The student earns 900 a month, so the exclusion covers +# January to October and 730 of November: the allocation is 497 through October, +# 497 - 170 = 327 in November and 0 in December. The spouse's 560 pension leaves +# 63, 233 and 560, so deeming applies in December alone, and that month's budget +# deems 560. Over the year the remaining spouse income, 63 x 10 + 233 + 560 = +# 1,423, stays within 5,964, so the year's test deems nothing and uses the +# individual rates: 12,848.16 - 240 = 12,608.16 exceeds (994 + 55.68) x 12 = +# 12,596.16 and the parent is flagged. December's status would raise the limit to +# 11,928 + 105.80 x 12 = 13,197.60 through the supplement, or to 17,892 + 668.16 = +# 18,560.16 through the federal rate. Month by month the parent has no SSI: +# 1,050.68 exceeds 1,049.68 through November, and 1,610.68 exceeds +# 1,491 + 105.80 = 1,596.80 in December. +- name: Case 31, Vermont parent whose spouse is deemed only in December is tested on the year's individual supplement. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + person1: + age: 45 + is_tax_unit_head: true + own_children_in_household: 2 + meets_ssi_disability_criteria: true + taxable_pension_income: 12_848.16 + person2: + age: 45 + is_tax_unit_spouse: true + own_children_in_household: 2 + taxable_pension_income: 6_720 + person3: + age: 19 + is_tax_unit_dependent: true + is_full_time_student: true + employment_income_before_lsr: 10_800 + person4: + age: 10 + is_tax_unit_dependent: true + meets_ssi_disability_criteria: true + tax_units: + tax_unit: + members: [person1, person2, person3, person4] + marital_units: + marital_unit1: + members: [person1, person2] + marital_unit2: + members: [person3] + marital_unit3: + members: [person4] + households: + household: + members: [person1, person2, person3, person4] + state_code: VT + output: + is_ssi_spousal_deeming_applies_monthly: + 2026-11: [false, false, false, false] + 2026-12: [true, false, false, false] + ssi_income_deemed_from_ineligible_spouse: [560, 0, 0, 0] + is_ssi_ineligible_parent: [true, true, false, false] + +# The household of Case 30, with a parent's pension of 900 a month. The spouse's +# remaining income is again 23, 293 and 520, so the monthly budgets deem 520 x 7 = +# 3,640 from June, and the year's 4,025 stays within 5,964. The year's test deems +# nothing: 10,800 - 240 = 10,560 is within 994 x 12 = 11,928, so the parent stays +# eligible. A test that deemed on December's status would add the year's +# difference, (10,800 + 4,025 - 240) - 10,560 = 4,025, reach 14,585 and flag the +# parent. Month by month the parent has SSI: 994 - 880 = 114 through May, and from +# June the lesser of 1,491 - (900 + 520 - 20) = 91 and 114. +- name: Case 32, parent whose spouse is deemed only from June has no deemed income in the year's test. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + person1: + age: 45 + is_tax_unit_head: true + own_children_in_household: 2 + meets_ssi_disability_criteria: true + taxable_pension_income: 10_800 + person2: + age: 45 + is_tax_unit_spouse: true + own_children_in_household: 2 + taxable_pension_income: 6_240 + person3: + age: 19 + is_tax_unit_dependent: true + is_full_time_student: true + employment_income_before_lsr: 24_000 + person4: + age: 10 + is_tax_unit_dependent: true + meets_ssi_disability_criteria: true + tax_units: + tax_unit: + members: [person1, person2, person3, person4] + marital_units: + marital_unit1: + members: [person1, person2] + marital_unit2: + members: [person3] + marital_unit3: + members: [person4] + households: + household: + members: [person1, person2, person3, person4] + state_code: TX + output: + is_ssi_spousal_deeming_applies_monthly: + 2026-05: [false, false, false, false] + 2026-06: [true, false, false, false] + ssi_income_deemed_from_ineligible_spouse: [3_640, 0, 0, 0] + is_ssi_ineligible_parent: [false, true, false, false] diff --git a/policyengine_us/tests/policy/baseline/gov/ssa/ssi/ssi_countable_income.yaml b/policyengine_us/tests/policy/baseline/gov/ssa/ssi/ssi_countable_income.yaml index d6bc16ed890..f0bb58a44f2 100644 --- a/policyengine_us/tests/policy/baseline/gov/ssa/ssi/ssi_countable_income.yaml +++ b/policyengine_us/tests/policy/baseline/gov/ssa/ssi/ssi_countable_income.yaml @@ -225,7 +225,7 @@ # 30 - 380, so no payment. Martha has 513 - 180 = 333. POMS shows 332 # from the 512 individual rate first set for 2000; SSA's rate table has # 513 for 2000 after Public Law 106-554. - ssi_countable_income: + ssi_countable_income_monthly: 2000-06: [290, 290] 2000-07: [380, 180] ssi: diff --git a/policyengine_us/tests/policy/baseline/gov/ssa/ssi/ssi_living_arrangement_integration.yaml b/policyengine_us/tests/policy/baseline/gov/ssa/ssi/ssi_living_arrangement_integration.yaml index 24fe4f8d0dc..e943eb4769f 100644 --- a/policyengine_us/tests/policy/baseline/gov/ssa/ssi/ssi_living_arrangement_integration.yaml +++ b/policyengine_us/tests/policy/baseline/gov/ssa/ssi/ssi_living_arrangement_integration.yaml @@ -238,9 +238,9 @@ # January 2024 uses November 2023 food_counts and the January FBR. ssi_pmv_applies: true # PMV monthly = (1/3 x 943) + 20 = 334.33 - ssi_in_kind_support_and_maintenance: 334.33 + ssi_in_kind_support_and_maintenance_monthly: 334.33 # Countable = 334.33 - 20 = 314.33 - ssi_countable_income: 314.33 + ssi_countable_income_monthly: 314.33 # uncapped = 943 - 314.33 = 628.67 uncapped_ssi: 628.67 ssi: 628.67 @@ -271,8 +271,8 @@ # $943 - $314.33 = $628.67 for a continuing recipient. ssi_federal_living_arrangement: OWN_HOUSEHOLD ssi_pmv_applies: true - ssi_in_kind_support_and_maintenance: 334.33 - ssi_countable_income: 314.33 + ssi_in_kind_support_and_maintenance_monthly: 334.33 + ssi_countable_income_monthly: 314.33 uncapped_ssi: 628.67 ssi: 628.67 @@ -302,8 +302,8 @@ # $943 - $314.33 = $628.67 for a continuing recipient. ssi_federal_living_arrangement: OWN_HOUSEHOLD ssi_pmv_applies: true - ssi_in_kind_support_and_maintenance: 334.33 - ssi_countable_income: 314.33 + ssi_in_kind_support_and_maintenance_monthly: 334.33 + ssi_countable_income_monthly: 314.33 uncapped_ssi: 628.67 ssi: 628.67 @@ -331,8 +331,8 @@ # October income excludes food, so December pays the full $943 FBR. ssi_federal_living_arrangement: OWN_HOUSEHOLD ssi_pmv_applies: false - ssi_in_kind_support_and_maintenance: 0 - ssi_countable_income: 0 + ssi_in_kind_support_and_maintenance_monthly: 0 + ssi_countable_income_monthly: 0 uncapped_ssi: 943 ssi: 943 @@ -361,8 +361,8 @@ # $943 - $314.33 = $628.67 for a continuing recipient. ssi_federal_living_arrangement: OWN_HOUSEHOLD ssi_pmv_applies: true - ssi_in_kind_support_and_maintenance: 334.33 - ssi_countable_income: 314.33 + ssi_in_kind_support_and_maintenance_monthly: 334.33 + ssi_countable_income_monthly: 314.33 uncapped_ssi: 628.67 ssi: 628.67 @@ -394,8 +394,8 @@ # $943 - $314.33 = $628.67 for a continuing recipient. ssi_federal_living_arrangement: OWN_HOUSEHOLD ssi_pmv_applies: true - ssi_in_kind_support_and_maintenance: 334.33 - ssi_countable_income: 314.33 + ssi_in_kind_support_and_maintenance_monthly: 334.33 + ssi_countable_income_monthly: 314.33 uncapped_ssi: 628.67 ssi: 628.67 @@ -425,8 +425,8 @@ # November reads the September income-month flag under 416.420(a). ssi_federal_living_arrangement: OWN_HOUSEHOLD ssi_pmv_applies: false - ssi_in_kind_support_and_maintenance: 0 - ssi_countable_income: 0 + ssi_in_kind_support_and_maintenance_monthly: 0 + ssi_countable_income_monthly: 0 uncapped_ssi: 943 ssi: 943 @@ -458,8 +458,8 @@ # $943 - $314.33 = $628.67 for a continuing recipient. ssi_federal_living_arrangement: OWN_HOUSEHOLD ssi_pmv_applies: true - ssi_in_kind_support_and_maintenance: 334.33 - ssi_countable_income: 314.33 + ssi_in_kind_support_and_maintenance_monthly: 334.33 + ssi_countable_income_monthly: 314.33 uncapped_ssi: 628.67 ssi: 628.67 @@ -489,8 +489,8 @@ # $943 - $314.33 = $628.67 for a continuing recipient. ssi_federal_living_arrangement: OWN_HOUSEHOLD ssi_pmv_applies: true - ssi_in_kind_support_and_maintenance: 334.33 - ssi_countable_income: 314.33 + ssi_in_kind_support_and_maintenance_monthly: 334.33 + ssi_countable_income_monthly: 314.33 uncapped_ssi: 628.67 ssi: 628.67 @@ -540,7 +540,7 @@ output: # October and November use August and September, before food began. # With no countable income, SSA pays the full $943 federal benefit rate. - ssi_in_kind_support_and_maintenance: + ssi_in_kind_support_and_maintenance_monthly: 2024-10: 0 2024-11: 0 ssi: @@ -588,8 +588,8 @@ output: # February reads December 2024 policy; current-year inputs need no history. ssi_pmv_applies: false - ssi_in_kind_support_and_maintenance: 0 - ssi_countable_income: 0 + ssi_in_kind_support_and_maintenance_monthly: 0 + ssi_countable_income_monthly: 0 ssi: 967 - name: Case 11, couple both eligible with PMV shelter support. diff --git a/policyengine_us/tests/policy/baseline/gov/states/ca/cdss/capi/ca_capi_countable_income.yaml b/policyengine_us/tests/policy/baseline/gov/states/ca/cdss/capi/ca_capi_countable_income.yaml new file mode 100644 index 00000000000..814bda32e66 --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/states/ca/cdss/capi/ca_capi_countable_income.yaml @@ -0,0 +1,78 @@ +- name: CAPI preserves an annual countable-income override + period: 2026-01 + absolute_error_margin: 0.01 + input: + state_code: CA + age: 10 + is_ssi_disabled: true + immigration_status: UNDOCUMENTED + ssi_countable_income: 1_200 + output: + # The supplied annual 1,200 gives 100 of monthly countable income. + ca_capi_person: 991.27 + +- name: CAPI preserves an annual parental-deeming override + period: 2026-01 + absolute_error_margin: 0.01 + input: + state_code: CA + age: 10 + is_ssi_disabled: true + immigration_status: UNDOCUMENTED + ssi_unearned_income_deemed_from_ineligible_parent: 1_200 + output: + # The supplied 100 a month consumes the 20 general income exclusion. + ca_capi_person: 1_011.27 + +- name: A CAPI child applies the general exclusion before the earned exclusion + period: 2026-01 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + person_id: 1 + is_tax_unit_head: true + ssi_unearned_income: 24_000 + child: + age: 10 + person_id: 2 + parent_1_id: 1 + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: UNDOCUMENTED + ssi_earned_income: 2_400 + is_full_time_student: false + tax_units: + family: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] + households: + home: + members: [parent, child] + state_code: CA + output: + people: + child: + # Parent: 2,000 - 20 - 994 = 986 deemed. + # Child: 986 - 20 + (200 - 65) / 2 = 1,033.50 countable. + ca_capi_person: 57.77 + +- name: Abolishing annual SSI countable income reaches monthly program budgets + period: 2026-01 + input: + gov.abolitions.ssi_countable_income: true + state_code: CA + age: 10 + is_ssi_disabled: true + immigration_status: UNDOCUMENTED + ssi_unearned_income: 12_000 + output: + ssi_countable_income: 0 + ssi_countable_income_monthly: 0 + ca_capi_countable_income: 0 + ca_capi_person: 1_091.27 diff --git a/policyengine_us/tests/policy/baseline/gov/states/ca/cdss/capi/ca_capi_person.yaml b/policyengine_us/tests/policy/baseline/gov/states/ca/cdss/capi/ca_capi_person.yaml index e5775f69504..3bb0bf3490c 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/ca/cdss/capi/ca_capi_person.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/ca/cdss/capi/ca_capi_person.yaml @@ -893,3 +893,143 @@ state_code: CA output: ca_capi_person: [0, 464.89, 0] + +- name: A CAPI child counts income deemed from an ineligible parent + period: 2026-01 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + person_id: 1 + is_tax_unit_head: true + ssi_unearned_income: 24_000 + child: + age: 10 + person_id: 2 + parent_1_id: 1 + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: UNDOCUMENTED + tax_units: + family: + members: [parent, child] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] + households: + home: + members: [parent, child] + state_code: CA + output: + people: + child: + ca_capi_eligible_person: true + # SSI excludes the child from its recipient pool. + ssi_unearned_income_deemed_from_ineligible_parent_monthly: 0 + # CAPI: 2,000 - 20 - 994 = 986 deemed; 986 - 20 = 966 countable. + # The child receives 1,091.27 - 966 = 125.27. + ca_capi_person: 125.27 + +- name: A CAPI child shares parental income with an SSI recipient + period: 2026-01 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + person_id: 1 + is_tax_unit_head: true + ssi_unearned_income: 24_000 + ssi_child: + age: 10 + person_id: 2 + parent_1_id: 1 + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + capi_child: + age: 12 + person_id: 3 + parent_1_id: 1 + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: UNDOCUMENTED + tax_units: + family: + members: [parent, ssi_child, capi_child] + marital_units: + parent_unit: + members: [parent] + ssi_child_unit: + members: [ssi_child] + capi_child_unit: + members: [capi_child] + households: + home: + members: [parent, ssi_child, capi_child] + state_code: CA + output: + people: + ssi_child: + # SSI allocates 497 for its ineligible sibling: 2,000 - 497 - 20 - 994. + ssi_unearned_income_deemed_from_ineligible_parent_monthly: 489 + ssi: 525 + capi_child: + # CAPI divides 2,000 - 20 - 994 among its two recipients. + # It pays 1,091.27 - (986 / 2 - 20) = 618.27. + ca_capi_person: 618.27 + +- name: Two CAPI children share parental income without an allocation for each other + period: 2026-01 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + person_id: 1 + is_tax_unit_head: true + ssi_unearned_income: 24_000 + first_child: + age: 10 + person_id: 2 + parent_1_id: 1 + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: UNDOCUMENTED + second_child: + age: 12 + person_id: 3 + parent_1_id: 1 + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: UNDOCUMENTED + tax_units: + family: + members: [parent, first_child, second_child] + marital_units: + parent_unit: + members: [parent] + first_child_unit: + members: [first_child] + second_child_unit: + members: [second_child] + households: + home: + members: [parent, first_child, second_child] + state_code: CA + output: + people: + first_child: + ssi_unearned_income_deemed_from_ineligible_parent_monthly: 0 + # Each child is a CAPI recipient, so neither takes an ineligible-child + # allocation from the other's budget. CAPI divides 2,000 - 20 - 994 = + # 986 between the two children: 493 each, 493 - 20 = 473 countable. + # Each receives 1,091.27 - 473 = 618.27. An allocation of 497 for the + # sibling would deem (986 - 497) / 2 = 244.50 instead. + ca_capi_person: 618.27 + second_child: + ssi_unearned_income_deemed_from_ineligible_parent_monthly: 0 + ca_capi_person: 618.27 diff --git a/policyengine_us/tests/policy/baseline/gov/states/ca/cdss/state_supplement/ca_state_supplement.yaml b/policyengine_us/tests/policy/baseline/gov/states/ca/cdss/state_supplement/ca_state_supplement.yaml index 130345be6dd..e0e34d2bc35 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/ca/cdss/state_supplement/ca_state_supplement.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/ca/cdss/state_supplement/ca_state_supplement.yaml @@ -866,7 +866,7 @@ output: ca_capi_eligible_person: [false, true] # Couple PMV = 1,415 / 3 + 20 = 491.666667 for the recipient. - ssi_in_kind_support_and_maintenance: [491.666667, 0] + ssi_in_kind_support_and_maintenance_monthly: [491.666667, 0] # SSI = 1,415 / 2 - (491.666667 - 20) / 2 = 471.666667. ssi: [471.666667, 0] # Own income = 491.666667 - 20 = 471.666667. @@ -905,7 +905,7 @@ output: ca_capi_eligible_person: [false, true] # November uses September food; the January arithmetic still applies. - ssi_in_kind_support_and_maintenance: [491.666667, 0] + ssi_in_kind_support_and_maintenance_monthly: [491.666667, 0] ssi: [471.666667, 0] ca_state_supplement_person: [239.61, 0] @@ -941,7 +941,7 @@ output: ca_capi_eligible_person: [false, true] # October food no longer counts; SSI = 1,415 / 2 = 707.50. - ssi_in_kind_support_and_maintenance: [0, 0] + ssi_in_kind_support_and_maintenance_monthly: [0, 0] ssi: [707.50, 0] # SSP = 1,182.94 - 707.50 - 0 = 475.44. ca_state_supplement_person: [475.44, 0] diff --git a/policyengine_us/tests/policy/baseline/gov/states/ca/cdss/state_supplement/ca_state_supplement_person.yaml b/policyengine_us/tests/policy/baseline/gov/states/ca/cdss/state_supplement/ca_state_supplement_person.yaml index 6fc4b3ba37b..6bb487ea7ec 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/ca/cdss/state_supplement/ca_state_supplement_person.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/ca/cdss/state_supplement/ca_state_supplement_person.yaml @@ -1003,3 +1003,102 @@ # max(480, 1,980 - (2,315.57 - 1,335.81)) = 1,000.24 a month and gets # 1,335.81 - 1,000.24 = 335.57. ca_state_supplement_person: [4_026.84, 0, 0] # 335.57 * 12 + +- name: California budgets mixed couples with each month's shelter support + period: 2026 + absolute_error_margin: 0.01 + input: + people: + recipient: + age: 65 + is_tax_unit_head: true + ssi: + 2026-01: 994 + 2026-06: 714 + ssi_countable_income_monthly: + 2026-01: 0 + 2026-06: 300 + ssi_in_kind_support_and_maintenance_monthly: + 2026-01: 0 + 2026-06: 300 + capi_spouse: + age: 65 + is_tax_unit_spouse: true + immigration_status: UNDOCUMENTED + ssi: + 2026-01: 0 + 2026-06: 0 + ssi_countable_income_monthly: + 2026-01: 0 + 2026-06: 0 + ssi_in_kind_support_and_maintenance_monthly: + 2026-01: 0 + 2026-06: 0 + marital_units: + couple: + members: [recipient, capi_spouse] + tax_units: + couple: + members: [recipient, capi_spouse] + households: + home: + members: [recipient, capi_spouse] + state_code: CA + output: + people: + recipient: + # January: 1,233.94 - 994 - 0 = 239.94. + # June: 1,233.94 - 714 - (300 - 20) = 239.94. + ca_state_supplement_person: + 2026-01: 239.94 + 2026-06: 239.94 + +- name: California budgets mixed couples with each month's countable SSI income + period: 2026 + absolute_error_margin: 0.01 + input: + people: + recipient: + age: 65 + is_tax_unit_head: true + ssi: + 2026-01: 0 + 2026-06: 994 + ssi_countable_income_monthly: + 2026-01: 1_000 + 2026-06: 0 + ssi_in_kind_support_and_maintenance_monthly: + 2026-01: 0 + 2026-06: 0 + capi_spouse: + age: 65 + is_tax_unit_spouse: true + immigration_status: UNDOCUMENTED + ssi: + 2026-01: 0 + 2026-06: 0 + ssi_countable_income_monthly: + 2026-01: 0 + 2026-06: 0 + ssi_in_kind_support_and_maintenance_monthly: + 2026-01: 0 + 2026-06: 0 + marital_units: + couple: + members: [recipient, capi_spouse] + tax_units: + couple: + members: [recipient, capi_spouse] + households: + home: + members: [recipient, capi_spouse] + state_code: CA + output: + people: + recipient: + # January countable: 1,000 - (2,098.83 - 1,233.94) = 135.11. + # January supplement: 1,233.94 - 0 - 135.11 = 1,098.83. + # June supplement: 1,233.94 - 994 - 0 = 239.94. + ca_state_supplement_person: + 2026-01: 1_098.83 + 2026-06: 239.94 diff --git a/policyengine_us/tests/policy/baseline/gov/states/ca/chhs/wdp/eligibility/ca_wdp_eligible.yaml b/policyengine_us/tests/policy/baseline/gov/states/ca/chhs/wdp/eligibility/ca_wdp_eligible.yaml index 357e7530ca7..e039fc02ef4 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/ca/chhs/wdp/eligibility/ca_wdp_eligible.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/ca/chhs/wdp/eligibility/ca_wdp_eligible.yaml @@ -159,11 +159,31 @@ - name: Case 10, SSI spousal deeming triggers the married SSI SSP standard. period: 2026 input: - state_code: CA - is_disabled: true - employment_income: 1_000 - pension_income: 20_000 - ssi_countable_resources: 10_000 - is_ssi_spousal_deeming_applies: true + people: + recipient: + age: 45 + is_disabled: true + meets_ssi_disability_criteria: true + employment_income: 1_000 + pension_income: 20_000 + ssi_countable_resources: 10_000 + is_tax_unit_head: true + spouse: + age: 45 + is_tax_unit_spouse: true + pension_income: 600 * 12 + tax_units: + couple: + members: [recipient, spouse] + marital_units: + couple: + members: [recipient, spouse] + households: + home: + members: [recipient, spouse] + state_code: CA output: - ca_wdp_ssi_ssp_income_eligible: true + people: + recipient: + is_ssi_spousal_deeming_applies: true + ca_wdp_ssi_ssp_income_eligible: true diff --git a/policyengine_us/tests/policy/baseline/gov/states/ca/chhs/wdp/eligibility/ca_wdp_income_eligible.yaml b/policyengine_us/tests/policy/baseline/gov/states/ca/chhs/wdp/eligibility/ca_wdp_income_eligible.yaml index 27f0637fa36..a9bb0980900 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/ca/chhs/wdp/eligibility/ca_wdp_income_eligible.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/ca/chhs/wdp/eligibility/ca_wdp_income_eligible.yaml @@ -123,3 +123,36 @@ is_ssi_spousal_deeming_applies: [true, false] ca_wdp_countable_income: [29_490, 24_760] ca_wdp_income_eligible: [false, true] + +# The spouse has no income, so the computed annual comparison gives no +# deeming. The supplied flag still sets a two-person unit. The worker's +# countable income is (92,020 - 240 - 780) / 2 = 45,500, below 250% of the +# 2026 two-person guideline, 54,100, but above the one-person limit, +# 2.5 x 15,960 = 39,900. +- name: Case 4, a supplied spousal-deeming flag sets the two-person unit. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + worker: + age: 35 + employment_income: 92_020 + ssi_countable_resources: 3_500 + is_blind: true + is_disabled: true + is_tax_unit_head: true + is_ssi_spousal_deeming_applies: true + spouse: + age: 40 + is_tax_unit_spouse: true + is_ssi_spousal_deeming_applies: false + tax_units: + couple: + members: [worker, spouse] + households: + household: + members: [worker, spouse] + state_code: CA + output: + ca_wdp_countable_income: [45_500, 0] + ca_wdp_income_eligible: [true, true] diff --git a/policyengine_us/tests/policy/baseline/gov/states/ca/chhs/wdp/eligibility/ca_wdp_ssi_ssp_income_eligible.yaml b/policyengine_us/tests/policy/baseline/gov/states/ca/chhs/wdp/eligibility/ca_wdp_ssi_ssp_income_eligible.yaml new file mode 100644 index 00000000000..53b7a00bbd6 --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/states/ca/chhs/wdp/eligibility/ca_wdp_ssi_ssp_income_eligible.yaml @@ -0,0 +1,83 @@ +- name: WDP annual screen preserves its annual approximation when December deeming differs + period: 2026 + absolute_error_margin: 0.01 + input: + people: + claimant: + age: 50 + person_id: 1 + is_tax_unit_head: true + is_ssi_disabled: true + ssi_unearned_income: 16_000 + spouse: + age: 48 + person_id: 2 + is_tax_unit_spouse: true + ssi_unearned_income: 600 * 12 + student: + age: 16 + person_id: 3 + parent_1_id: 1 + parent_2_id: 2 + is_tax_unit_dependent: true + is_full_time_student: true + employment_income: 1_000 * 12 + tax_units: + family: + members: [claimant, spouse, student] + marital_units: + parents: + members: [claimant, spouse] + student_unit: + members: [student] + households: + home: + members: [claimant, spouse, student] + state_code: CA + output: + people: + claimant: + # The annual stock value reflects December, when the student's + # exclusion is exhausted and SSI deeming applies. WDP's existing + # annual approximation instead compares the $2,500 annual spouse + # remainder with the annual differential, $5,964. + is_ssi_spousal_deeming_applies: true + # $16,000 - $240 = $15,760 exceeds the single SSI/SSP standard, + # $1,233.94 * 12 = $14,807.28. December's flag must not select + # the couple standard for this whole-year approximation. + ca_wdp_ssi_ssp_income_eligible: false + +- name: WDP annual screen takes a supplied spousal-deeming flag + period: 2026 + absolute_error_margin: 0.01 + input: + people: + claimant: + age: 50 + is_tax_unit_head: true + is_ssi_disabled: true + ssi_unearned_income: 16_000 + is_ssi_spousal_deeming_applies: true + spouse: + age: 48 + is_tax_unit_spouse: true + is_ssi_spousal_deeming_applies: false + tax_units: + family: + members: [claimant, spouse] + marital_units: + parents: + members: [claimant, spouse] + households: + home: + members: [claimant, spouse] + state_code: CA + output: + people: + claimant: + # The spouse has no income, so the computed annual comparison gives + # no deeming, but the supplied flag selects the couple standard: + # ($1,491 + $607.83) x 12 = $25,185.96. $16,000 - $240 = $15,760 + # is below it. The single standard, ($994 + $239.94) x 12 = + # $14,807.28, would fail the claimant. + ca_wdp_ssi_ssp_income_eligible: true diff --git a/policyengine_us/tests/policy/baseline/gov/states/co/ssa/oap/co_oap_in_kind_support_and_maintenance.yaml b/policyengine_us/tests/policy/baseline/gov/states/co/ssa/oap/co_oap_in_kind_support_and_maintenance.yaml index aa0d7b9a10b..23015f90ea5 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/co/ssa/oap/co_oap_in_kind_support_and_maintenance.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/co/ssa/oap/co_oap_in_kind_support_and_maintenance.yaml @@ -22,6 +22,26 @@ output: co_oap_in_kind_support_and_maintenance: 150 +- name: Matching SSI ISM follows each month's amount rather than the annual average. + period: 2026 + absolute_error_margin: 0.01 + input: + ssi: 0 + receives_ssi: true + ssi_in_kind_support_and_maintenance_monthly: + 2026-01: 300 + 2026-02: 120 + ssi_couple_computation_applies: true + output: + # Other months have no ISM, so the annual total is 300 + 120 = 420. + ssi_in_kind_support_and_maintenance: 420 + # The recipient's share is January's 300 / 2 = 150 and February's + # 120 / 2 = 60. Averaging the year would give 420 / 12 / 2 = 17.50. + co_oap_in_kind_support_and_maintenance: + 2026-01: 150 + 2026-02: 60 + + - name: An SSI recipient in another person's household is charged SSA's one-third reduction. # 3.520.79(B)(6), 3.520.71(E): the matching ISM is what SSA counts, one-third # of the $994 benefit rate (20 CFR 416.1131(a)), for a client who receives @@ -39,6 +59,7 @@ # 3.533(A)(2)(c): less the $20 unearned income disregard. co_oap_own_countable_income: 311.33 + - name: A spouse outside Colorado is charged the same matching ISM. # co_oap_deemed_income reads this variable for a client's spouse, who may # live elsewhere (3.534(C)). @@ -52,6 +73,7 @@ output: co_oap_in_kind_support_and_maintenance: 331.33 + - name: A client without SSI who receives shelter from others is counted Colorado's maximum. # 3.520.79(C)(3): a client paying no shelter costs is counted the maximum # ISM, $351 in 2026 (3.530(B)). diff --git a/policyengine_us/tests/policy/baseline/gov/states/md/dhs/fia/paa/md_paa_countable_income.yaml b/policyengine_us/tests/policy/baseline/gov/states/md/dhs/fia/paa/md_paa_countable_income.yaml index 9cd1f185d58..70ae0014b5c 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/md/dhs/fia/paa/md_paa_countable_income.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/md/dhs/fia/paa/md_paa_countable_income.yaml @@ -116,7 +116,7 @@ 2024: MD output: # ISM = 943 / 3 + 20; countable = ISM - 20 = 314.333333. - ssi_in_kind_support_and_maintenance: 334.333333 + ssi_in_kind_support_and_maintenance_monthly: 334.333333 md_paa_countable_income: 314.333333 # Imputed SSI = 943 - 314.333333 = 628.666667. md_paa_imputed_federal_ssi: 628.666667 @@ -142,7 +142,7 @@ 2024: MD output: # November retains food ISM from September under SSI's payment timing. - ssi_in_kind_support_and_maintenance: 334.333333 + ssi_in_kind_support_and_maintenance_monthly: 334.333333 md_paa_countable_income: 314.333333 md_paa_imputed_federal_ssi: 628.666667 # PAA = 1,173 + 102 - 943 = 332 after the July PNA increase. @@ -167,7 +167,7 @@ 2024: MD output: # October food no longer counts, so December ISM and countable income = 0. - ssi_in_kind_support_and_maintenance: 0 + ssi_in_kind_support_and_maintenance_monthly: 0 md_paa_countable_income: 0 md_paa_imputed_federal_ssi: 943 # PAA = 1,173 + 102 - 0 - 943 = 332. diff --git a/policyengine_us/tests/policy/baseline/gov/states/ms/dom/hmw/eligibility/ms_hmw_eligible.yaml b/policyengine_us/tests/policy/baseline/gov/states/ms/dom/hmw/eligibility/ms_hmw_eligible.yaml index 456a0d9040a..3ccfc553146 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/ms/dom/hmw/eligibility/ms_hmw_eligible.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/ms/dom/hmw/eligibility/ms_hmw_eligible.yaml @@ -41,6 +41,8 @@ # ($29,214), so neither spouse qualifies, as with explicit marital units. - name: Case 4, a blind couple living with an unrelated adult is tested as a couple. period: 2026 + # Allow one cent of error when summing monthly float32 income. + absolute_error_margin: 0.01 input: people: head: diff --git a/policyengine_us/tests/policy/baseline/gov/states/nh/dhhs/ssp/nh_ssp_countable_income.yaml b/policyengine_us/tests/policy/baseline/gov/states/nh/dhhs/ssp/nh_ssp_countable_income.yaml new file mode 100644 index 00000000000..ccdbf484aae --- /dev/null +++ b/policyengine_us/tests/policy/baseline/gov/states/nh/dhhs/ssp/nh_ssp_countable_income.yaml @@ -0,0 +1,188 @@ +- name: A 19-year-old college sibling keeps the SSI allocation but gets no NH allocation. + period: 2026-01 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + person_id: 1 + is_tax_unit_head: true + employment_income: 31_200 + child: + age: 9 + person_id: 2 + parent_1_id: 1 + is_tax_unit_dependent: true + is_blind: true + student: + age: 19 + person_id: 3 + parent_1_id: 1 + is_tax_unit_dependent: true + is_full_time_college_student: true + employment_income: 24_000 + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] + student_unit: + members: [student] + tax_units: + family_tax_unit: + members: [parent, child, student] + families: + family: + members: [parent, child, student] + households: + home: + members: [parent, child, student] + state_code: NH + output: + people: + child: + # Student earnings are 24,000 / 12 = 2,000 per month. The 9,730 + # annual student exclusion is exhausted in May: sibling allocations + # are 497 Jan-Apr, 497 - (2,000 - 1,730) = 227 May, and 0 Jun-Dec. + # January parental deeming: (2,600 - 497 - 85) / 2 - 994 = 15. + ssi_unearned_income_deemed_from_ineligible_parent_monthly: 15 + # May deeming is (2,600 - 227 - 85) / 2 - 994 = 150; Jun-Dec is + # (2,600 - 85) / 2 - 994 = 263.50. Annual deeming is therefore + # 4 * 15 + 150 + 7 * 263.50 = 2,054.50; its monthly average is 171.21. + ssi_unearned_income_deemed_from_ineligible_parent: + 2026: 2_054.5 + # January's 15 is below the federal 20 general exclusion: full SSI. + ssi: 994 + # He-W 652.03(h)(1) allows an older sibling only "under the age of 20 + # if a full-time student in a secondary school", so this 19-year-old + # college student gets no NH allocation. NH deeming: + # (2,600 - 85) / 2 - 994 = 263.50. + nh_ssp_unearned_income_deemed_from_ineligible_parent: 263.5 + # NH counts 263.50 + 994 SSI - 13 standard disregard = 1,244.50. + nh_ssp_countable_income: 1_244.5 + # One-person standard: 994 + 27 - 13 = 1,008, below 1,244.50: no grant. + nh_ssp: 0 + +- name: A 19-year-old full-time secondary school sibling keeps the NH allocation. + period: 2026-01 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + person_id: 1 + is_tax_unit_head: true + employment_income: 31_200 + child: + age: 9 + person_id: 2 + parent_1_id: 1 + is_tax_unit_dependent: true + is_blind: true + student: + age: 19 + person_id: 3 + parent_1_id: 1 + is_tax_unit_dependent: true + is_full_time_student: true + is_in_secondary_school: true + employment_income: 24_000 + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] + student_unit: + members: [student] + tax_units: + family_tax_unit: + members: [parent, child, student] + families: + family: + members: [parent, child, student] + households: + home: + members: [parent, child, student] + state_code: NH + output: + people: + child: + # Federal and NH allocations agree: January's 2,000 of student + # earnings are excluded (2,410 monthly limit), so the allocation is + # 497 and deeming is (2,600 - 497 - 85) / 2 - 994 = 15. + ssi_unearned_income_deemed_from_ineligible_parent_monthly: 15 + nh_ssp_unearned_income_deemed_from_ineligible_parent: 15 + ssi: 994 + # 15 + 994 - 13 = 996; grant 1,008 - 996 = 12. + nh_ssp_countable_income: 996 + nh_ssp: 12 + +- name: A 20-year-old full-time secondary school sibling gets no NH allocation. + period: 2026-01 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + person_id: 1 + is_tax_unit_head: true + employment_income: 31_200 + child: + age: 9 + person_id: 2 + parent_1_id: 1 + is_tax_unit_dependent: true + is_blind: true + student: + age: 20 + person_id: 3 + parent_1_id: 1 + is_tax_unit_dependent: true + is_full_time_student: true + is_in_secondary_school: true + employment_income: 24_000 + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] + student_unit: + members: [student] + tax_units: + family_tax_unit: + members: [parent, child, student] + families: + family: + members: [parent, child, student] + households: + home: + members: [parent, child, student] + state_code: NH + output: + people: + child: + # SSI still allocates for a student under 22: deeming is 15 and SSI + # stays 994. NH allocates only under 20, so its deeming is + # (2,600 - 85) / 2 - 994 = 263.50. + ssi_unearned_income_deemed_from_ineligible_parent_monthly: 15 + ssi: 994 + nh_ssp_unearned_income_deemed_from_ineligible_parent: 263.5 + # 263.50 + 994 - 13 = 1,244.50, above the 1,008 standard: no grant. + nh_ssp_countable_income: 1_244.5 + nh_ssp: 0 + +- name: New Hampshire applies its secondary-student allocation limit after April 2012 + period: 2012-05 + input: + state_code: + 2012: NH + age: + 2012: 19 + is_ssi_ineligible_child: + 2012-05: true + is_full_time_student: + 2012: true + is_in_secondary_school: + 2012: true + output: + nh_ssp_ineligible_child: true diff --git a/policyengine_us/tests/policy/baseline/gov/states/ny/otda/ssp/ny_ssp.yaml b/policyengine_us/tests/policy/baseline/gov/states/ny/otda/ssp/ny_ssp.yaml index b152061c663..324d2ea3b61 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/ny/otda/ssp/ny_ssp.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/ny/otda/ssp/ny_ssp.yaml @@ -740,6 +740,126 @@ ny_ssp_living_arrangement: [LIVING_ALONE, FAMILY_CARE] ny_ssp: [87, 228.48] +- name: Case 49, student exclusions change spousal deeming and SSP during the year. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + claimant: + age: 45 + meets_ssi_disability_criteria: true + spouse: + age: 43 + pension_income: 14_400 + student1: + age: 19 + is_full_time_student: true + employment_income: 24_000 + student2: + age: 20 + is_full_time_student: true + employment_income: 24_000 + marital_units: + couple: + members: [claimant, spouse] + student1: + members: [student1] + student2: + members: [student2] + tax_units: + family: + members: [claimant, spouse, student1, student2] + households: + household: + members: [claimant, spouse, student1, student2] + state_code: NY + output: + # Each student earns 2_000/month. January-April exclude all earnings: + # 1_200 spouse pension - 2 * 497 allocations = 206 <= 497, no deeming. + # In May, 9_730 - 4 * 2_000 = 1_730 of each student's exclusion remains. + # Allocation = 497 - (2_000 - 1_730) = 227 each; countable deemed income + # = 1_200 - 2 * 227 - 20 = 726. June-December allocations are zero, + # so countable income = 1_200 - 20 = 1_180 and SSI = 1_491 - 1_180 = 311. + is_ssi_spousal_deeming_applies_monthly: + 2026-01: [false, false, false, false] + 2026-05: [true, false, false, false] + 2026-06: [true, false, false, false] + ssi_countable_income_monthly: + 2026-01: [0, 0, 0, 0] + 2026-05: [726, 0, 0, 0] + 2026-06: [1_180, 0, 0, 0] + ssi: + 2026-01: [994, 0, 0, 0] + 2026-05: [765, 0, 0, 0] + 2026-06: [311, 0, 0, 0] + # Living with others rate 23. Through May countable income is below 994; + # June-December max(23 - (1_180 - 994), 0) = 0. Annual = 5 * 23 = 115. + # The annual-average countable income (726 + 7 * 1_180) / 12 = 748.83 + # would incorrectly preserve all 12 payments, totaling 276. + ny_ssp: + 2026-01: [23, 0, 0, 0] + 2026-05: [23, 0, 0, 0] + 2026-06: [0, 0, 0, 0] + 2026-12: [0, 0, 0, 0] + 2026: [115, 0, 0, 0] + +- name: Case 50, January spousal deeming uses January status rather than December. + period: 2026-01 + absolute_error_margin: 0.01 + input: + state_code: NY + age: 65 + ny_ssp_living_arrangement: LIVING_WITH_OTHERS + is_ssi_spousal_deeming_applies_monthly: + 2026-01: true + 2026-12: false + ssi_countable_income_monthly: + 2026-01: 1_180 + ssi_income_deemed_from_ineligible_spouse_monthly: + 2026-01: 1_180 + output: + # January's SSI couple budget is 1_491 - 1_180 = 311. New York compares + # countable income with the individual FBR: max(23 - (1_180 - 994), 0). + # December's false status would retain the shared helper's 23 payment. + ssi: 311 + ny_ssp: 0 + +- name: Case 51, personal needs allowance uses the facility resident's monthly income. + period: 2026 + absolute_error_margin: 0.01 + input: + state_code: NY + age: 70 + ssi_lives_in_medical_treatment_facility: true + ssi_medicaid_pays_majority_of_care: true + ssi_countable_income_monthly: + 2026-01: 0 + 2026-02: 0 + 2026-03: 0 + 2026-04: 0 + 2026-05: 0 + 2026-06: 0 + 2026-07: 10 + 2026-08: 10 + 2026-09: 10 + 2026-10: 10 + 2026-11: 10 + 2026-12: 10 + output: + # Federal facility rate 30 less countable income 0/10 gives SSI 30/20. + # New York pays 25 only in the six zero-income months: 6 * 25 = 150. + # Annual countable income is 60, so its average of 5 would wrongly + # suppress the allowance even in January. + ssi: + 2026-01: 30 + 2026-07: 20 + 2026: 300 + ny_ssp: + 2026-01: 25 + 2026-07: 0 + 2026: 150 + + # 18 NYCRR 398-4.5(a)(1)-(2): an unrelated third adult means living # with others. The official 2026 chart pays $46 per couple and $23 per # individual; $46 / 2 = $23 for each spouse. diff --git a/policyengine_us/tests/policy/baseline/gov/states/ok/dhs/ssp/integration.yaml b/policyengine_us/tests/policy/baseline/gov/states/ok/dhs/ssp/integration.yaml index 9aad62d1ba4..f7934e0b239 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/ok/dhs/ssp/integration.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/ok/dhs/ssp/integration.yaml @@ -418,6 +418,7 @@ employment_income: 41_600 person3: age: 16 + is_in_k12_school: false employment_income: 3_600 person4: age: 9 @@ -573,3 +574,313 @@ # 757.50 + 783.50 = 1_541, not below the 1_532 ineligible spouse standard. ok_ssp_countable_income: [1_541, 1_541] ok_ssp: [0, 0] + +- name: Case 20, a teen student's excluded earnings preserve the federal child allocation. + period: 2026-01 + absolute_error_margin: 0.01 + input: + people: + person1: + age: 45 + meets_ssi_disability_criteria: true + person2: + age: 43 + employment_income: 41_600 + person3: + age: 16 + is_in_k12_school: true + employment_income: 3_600 + person4: + age: 9 + marital_units: + couple: + members: [person1, person2] + teen: + members: [person3] + child: + members: [person4] + families: + family: + members: [person1, person2, person3, person4] + households: + hh: + members: [person1, person2, person3, person4] + state_code: OK + output: + # Oklahoma counts the teen's earnings: (498 - 300) + 498 = 696. + ok_ssp_spouse_child_allocation: [696, 696, 696, 696] + # Federal SSI excludes the student's 300 monthly earnings, so allocations + # are 2 * 497 = 994. Deemed earnings: 3_466.67 - 994 = 2_472.67 > 497. + # (2_472.67 - 85) / 2 = 1_193.83; 1_491 - 1_193.83 = 297.17 SSI. + ssi: [297.17, 0, 0, 0] + ok_ssp_eligible: [true, false, false, false] + # Claimant: 297.17 SSI. Spouse: (3_467 - 85) / 2 = 1_691. + # Teen: (300 - 85) / 2 = 107.5. + ok_ssp_own_countable_income: [297.17, 1_691, 107.5, 0] + # Combined: (3_467 - 696 - 85) / 2 + 297.17 = 1_640.17 > 1_532. + # The combined-income helper also subtracts the family's 696 allocation + # from the ineligible teen's 300 earnings, leaving 0 for that unit. + ok_ssp_countable_income: [1_640.17, 1_640.17, 0, 0] + ok_ssp: [0, 0, 0, 0] + +- name: Case 21, a 19-year-old college sibling gets the SSI allocation but no Oklahoma allocation. + period: 2026-01 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + person_id: 1 + employment_income: 31_200 + child: + age: 9 + person_id: 2 + parent_1_id: 1 + meets_ssi_disability_criteria: true + student: + age: 19 + person_id: 3 + parent_1_id: 1 + is_full_time_college_student: true + employment_income: 24_000 + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] + student_unit: + members: [student] + families: + family: + members: [parent, child, student] + households: + hh: + members: [parent, child, student] + state_code: OK + output: + # The student's 2_000 monthly earnings use up the 9_730 annual exclusion + # in May. Sibling allocations are 497 Jan-Apr, 227 May, and 0 Jun-Dec. + # January parental deeming: (2_600 - 497 - 85) / 2 - 994 = 15. + # May is 150; Jun-Dec is 263.5. Annual average deeming would be + # (4 * 15 + 150 + 7 * 263.5) / 12 = 171.21, which does not apply here. + ssi_unearned_income_deemed_from_ineligible_parent_monthly: [0, 15, 0] + # January's 15 is below the child's 20 general exclusion, so full SSI. + ssi: [0, 994, 0] + # Oklahoma allocates only for "a child younger than 18 years of age who + # is not blind or disabled" (OAC 340:15-1-2), so the 19-year-old college + # sibling gets no state allocation: (2_600 - 85) / 2 - 994 = 263.5. + ok_ssp_unearned_income_deemed_from_ineligible_parent: [0, 263.5, 0] + # Parent: (2_600 - 85) / 2 = 1_257.5. Child: 263.5 - 20 + 994 = 1_237.5. + # Student: (2_000 - 85) / 2 = 957.5. + ok_ssp_own_countable_income: [1_257.5, 1_237.5, 957.5] + # 1_237.5 exceeds the 1_034 standard, so the initial application pays 0. + ok_ssp: [0, 0, 0] + +- name: Case 22, June in-kind support follows that month's spousal deeming. + # Annual inputs cover calendar 2026; outputs below select June. + period: 2026 + absolute_error_margin: 0.01 + input: + people: + claimant: + age: 45 + person_id: 1 + is_tax_unit_head: true + meets_ssi_disability_criteria: true + ssi_receives_outside_shelter_support: true + spouse: + age: 43 + person_id: 2 + is_tax_unit_spouse: true + pension_income: 14_400 + student1: + age: 19 + person_id: 3 + is_tax_unit_dependent: true + parent_1_id: 1 + parent_2_id: 2 + is_full_time_college_student: true + employment_income: 24_000 + student2: + age: 20 + person_id: 4 + is_tax_unit_dependent: true + parent_1_id: 1 + parent_2_id: 2 + is_full_time_college_student: true + employment_income: 24_000 + marital_units: + couple: + members: [claimant, spouse] + student1_unit: + members: [student1] + student2_unit: + members: [student2] + tax_units: + family_tax_unit: + members: [claimant, spouse, student1, student2] + families: + family: + members: [claimant, spouse, student1, student2] + households: + hh: + members: [claimant, spouse, student1, student2] + state_code: OK + output: + # Student exclusions run out in May, so no federal child allocation + # remains in June. Spouse's 1_200 pension is above the 497 threshold. + is_ssi_spousal_deeming_applies_monthly: + 2026-01: [false, false, false, false] + 2026-06: [true, false, false, false] + # ISM Jan-Apr is 994 / 3 + 20 = 351.33; May-Dec is + # 1_491 / 6 + 10 = 258.5. The annual average, 289.44, is not June's ISM. + ssi_in_kind_support_and_maintenance_monthly: + 2026-06: [258.5, 0, 0, 0] + # Federal SSI: SSA adds the claimant's support to the spouse's 1_200 and + # applies one $20 exclusion (POMS SI 01320.150 B.1.a, SI 01320.400 B.1.e): + # 1_491 - (258.5 + 1_200 - 20) = 52.5, below the individual-only limit of + # 994 - (351.33 - 20) = 662.67 (20 CFR 416.1163(e)(2)). + ssi: + 2026-06: [52.5, 0, 0, 0] + # Oklahoma's allocation is 0 because each student's gross 2_000 > 498. + ok_ssp_spouse_child_allocation: + 2026-06: [0, 0, 0, 0] + # Claimant: 258.5 - 20 + 52.5 = 291. Spouse: 1_200 - 20 = 1_180. + # Each student: (2_000 - 85) / 2 = 957.5. + ok_ssp_own_countable_income: + 2026-06: [291, 1_180, 957.5, 957.5] + # Combined: 258.5 + 1_200 - 20 + 52.5 = 1_491; min(1_532 - 1_491, 40) = 40. + # Using annual-average ISM would give 1_521.94 and pay 10.06. + ok_ssp_countable_income: + 2026-06: [1_491, 1_491, 957.5, 957.5] + ok_ssp: + 2026-06: [40, 0, 0, 0] + +- name: Case 23, a 17-year-old student sibling keeps the Oklahoma allocation. + period: 2026-01 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + person_id: 1 + employment_income: 31_200 + child: + age: 9 + person_id: 2 + parent_1_id: 1 + meets_ssi_disability_criteria: true + student: + age: 17 + person_id: 3 + parent_1_id: 1 + is_in_k12_school: true + employment_income: 24_000 + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] + student_unit: + members: [student] + families: + family: + members: [parent, child, student] + households: + hh: + members: [parent, child, student] + state_code: OK + output: + # Under 18, the sibling is an Oklahoma ineligible child. Federal and state + # allocations agree: January's 2_000 of student earnings are excluded, so + # the allocation is 497 and deeming is (2_600 - 497 - 85) / 2 - 994 = 15. + ssi_unearned_income_deemed_from_ineligible_parent_monthly: [0, 15, 0] + ok_ssp_unearned_income_deemed_from_ineligible_parent: [0, 15, 0] + ssi: [0, 994, 0] + # Child: max(15 - 20, 0) + 994 = 994; min(1_034 - 994, 40) = 40. + ok_ssp: [0, 40, 0] + +- name: Case 24, an 18-year-old student sibling gets no Oklahoma allocation. + period: 2026-01 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + person_id: 1 + employment_income: 31_200 + child: + age: 9 + person_id: 2 + parent_1_id: 1 + meets_ssi_disability_criteria: true + student: + age: 18 + person_id: 3 + parent_1_id: 1 + is_in_k12_school: true + employment_income: 24_000 + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] + student_unit: + members: [student] + families: + family: + members: [parent, child, student] + households: + hh: + members: [parent, child, student] + state_code: OK + output: + # SSI still allocates for a student under 22: deeming is 15, SSI 994. + # Oklahoma allocates only under 18: (2_600 - 85) / 2 - 994 = 263.5. + ssi_unearned_income_deemed_from_ineligible_parent_monthly: [0, 15, 0] + ssi: [0, 994, 0] + ok_ssp_unearned_income_deemed_from_ineligible_parent: [0, 263.5, 0] + # Child: 263.5 - 20 + 994 = 1_237.5, above the 1_034 standard. + ok_ssp: [0, 0, 0] + +- name: Case 25, a 19-year-old college sibling gets no Oklahoma spousal allocation. + period: 2026-01 + absolute_error_margin: 0.01 + input: + people: + person1: + age: 45 + meets_ssi_disability_criteria: true + person2: + age: 43 + employment_income: 41_600 + person3: + age: 19 + is_full_time_college_student: true + person4: + age: 9 + marital_units: + couple: + members: [person1, person2] + student: + members: [person3] + child: + members: [person4] + families: + family: + members: [person1, person2, person3, person4] + households: + hh: + members: [person1, person2, person3, person4] + state_code: OK + output: + # OAC 340:15-1-2 counts only children younger than 18: 498 for the + # 9-year-old, none for the student. + ok_ssp_spouse_child_allocation: [498, 498, 498, 498] + # Federal SSI allocates for the student under 22: 2 x 497 = 994; + # 3_466.67 - 994 = 2_472.67; (2_472.67 - 85) / 2 = 1_193.83; + # 1_491 - 1_193.83 = 297.17. + ssi: [297.17, 0, 0, 0] + # Combined: (3_467 - 498 - 85) / 2 = 1_442 + 297.17 = 1_739.17 > 1_532. + # Allocating for the student too gave 1_193 + 297.17 = 1_490.17 and $40. + ok_ssp: [0, 0, 0, 0] diff --git a/policyengine_us/tests/policy/baseline/gov/states/ok/dhs/ssp/ok_ssp.yaml b/policyengine_us/tests/policy/baseline/gov/states/ok/dhs/ssp/ok_ssp.yaml index e5446183983..6c9e1f6230d 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/ok/dhs/ssp/ok_ssp.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/ok/dhs/ssp/ok_ssp.yaml @@ -287,3 +287,96 @@ # Third adult: (100 - 20) + SSI (994 - 80) = 994; 1,034 - 994 = 40. ok_ssp_countable_income: [1_491, 1_491, 994] ok_ssp: [40, 40, 40] + +- name: Oklahoma excludes a disabled noncitizen sibling from parental allocations + period: 2026-01 + absolute_error_margin: 0.01 + input: + people: + parent: + age: 40 + person_id: 1 + is_tax_unit_head: true + ssi_unearned_income: 24_000 + child: + age: 10 + person_id: 2 + parent_1_id: 1 + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: CITIZEN + sibling: + age: 12 + person_id: 3 + parent_1_id: 1 + is_tax_unit_dependent: true + is_ssi_disabled: true + immigration_status: UNDOCUMENTED + tax_units: + family: + members: [parent, child, sibling] + marital_units: + parent_unit: + members: [parent] + child_unit: + members: [child] + sibling_unit: + members: [sibling] + families: + family: + members: [parent, child, sibling] + households: + home: + members: [parent, child, sibling] + state_code: OK + output: + people: + sibling: + is_ssi_ineligible_child: true + ok_ssp_ineligible_child: false + child: + ssi_unearned_income_deemed_from_ineligible_parent_monthly: 489 + ssi: 525 + # Oklahoma: 2,000 - 20 - 994 = 986 deemed. + ok_ssp_unearned_income_deemed_from_ineligible_parent: 986 + # 986 - 20 + 525 = 1,491 exceeds 1,034. + ok_ssp_countable_income: 1_491 + ok_ssp: 0 + +- name: Oklahoma excludes a disabled noncitizen child from spousal allocations + period: 2026-01 + absolute_error_margin: 0.01 + input: + people: + claimant: + age: 45 + is_ssi_disabled: true + spouse: + age: 43 + ssi_unearned_income: 24_000 + child: + age: 12 + is_ssi_disabled: true + immigration_status: UNDOCUMENTED + marital_units: + couple: + members: [claimant, spouse] + child_unit: + members: [child] + families: + family: + members: [claimant, spouse, child] + households: + home: + members: [claimant, spouse, child] + state_code: OK + output: + people: + child: + is_ssi_ineligible_child: true + ok_ssp_ineligible_child: false + claimant: + # Oklahoma gives no allocation for this child; SSI retains its 497. + ok_ssp_spouse_child_allocation: 0 + spouse: + ok_ssp_spouse_child_allocation: 0 diff --git a/policyengine_us/tests/policy/baseline/gov/states/va/dars/ag/va_ag.yaml b/policyengine_us/tests/policy/baseline/gov/states/va/dars/ag/va_ag.yaml index 8d059bd9e4c..33d713e165d 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/va/dars/ag/va_ag.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/va/dars/ag/va_ag.yaml @@ -405,6 +405,34 @@ 2026-01: 558 2026-02: 1_223 +- name: Case 31, SSI recipients use each month's verified countable income. + period: 2026 + absolute_error_margin: 0.01 + input: + state_code: VA + age: 65 + va_ag_certified: true + ssi_countable_income_monthly: + 2026-01: 100 + 2026-02: 300 + output: + # January SSI: 994 - 100 = 894; February SSI: 994 - 300 = 694. + ssi: + 2026-01: 894 + 2026-02: 694 + # Other months have no income, so the annual total is 100 + 300 = 400. + ssi_countable_income: 400 + # AG counts January's 100 + 894 and February's 300 + 694, both 994. + # The annual average, 400 / 12 = 33.33, would give 927.33 and 727.33. + va_ag_countable_income: + 2026-01: 994 + 2026-02: 994 + # Each full-month grant is 2,130 + 87 - 994 = 1,223. + va_ag: + 2026-01: 1_223 + 2026-02: 1_223 + + # AG Manual Chapter B section 6 (PDF pp. 34-35) tests marriage/co-residence # at the first moment of the application month; entering separate facilities # later in that month retains the joint budget recorded by the input. @@ -473,6 +501,7 @@ va_ag_countable_income: - 1190 - 1190 + - name: Review VA joint initial-month resources exceed couple limit across facility households period: 2026-01 @@ -533,6 +562,7 @@ - false - false + - name: Virginia initial-month couple excludes the third adult's income and resources. period: 2026-01 absolute_error_margin: 0.01 diff --git a/policyengine_us/variables/gov/hhs/medicaid/eligibility/categories/medicaid_optional_senior_or_disabled_uses_couple_standard.py b/policyengine_us/variables/gov/hhs/medicaid/eligibility/categories/medicaid_optional_senior_or_disabled_uses_couple_standard.py index 5d84c69ce41..84bcbef49c4 100644 --- a/policyengine_us/variables/gov/hhs/medicaid/eligibility/categories/medicaid_optional_senior_or_disabled_uses_couple_standard.py +++ b/policyengine_us/variables/gov/hhs/medicaid/eligibility/categories/medicaid_optional_senior_or_disabled_uses_couple_standard.py @@ -34,6 +34,7 @@ def formula(person, period, parameters): return uses_couple_standard( person, period, + parameters, p.budgets_couple_together[state].astype(bool), p.couple_limit_without_deeming[state].astype(bool), ) diff --git a/policyengine_us/variables/gov/hhs/medicaid/eligibility/categories/medically_needy/medicaid_medically_needy_uses_couple_standard.py b/policyengine_us/variables/gov/hhs/medicaid/eligibility/categories/medically_needy/medicaid_medically_needy_uses_couple_standard.py index 1801d805939..2b648f9a633 100644 --- a/policyengine_us/variables/gov/hhs/medicaid/eligibility/categories/medically_needy/medicaid_medically_needy_uses_couple_standard.py +++ b/policyengine_us/variables/gov/hhs/medicaid/eligibility/categories/medically_needy/medicaid_medically_needy_uses_couple_standard.py @@ -34,6 +34,7 @@ def formula(person, period, parameters): return uses_couple_standard( person, period, + parameters, p.budgets_couple_together[state].astype(bool), p.couple_limit_without_deeming[state].astype(bool), ) diff --git a/policyengine_us/variables/gov/hhs/medicaid/income/_couple_standard.py b/policyengine_us/variables/gov/hhs/medicaid/income/_couple_standard.py index f0d2b4c1edb..21e62963b7b 100644 --- a/policyengine_us/variables/gov/hhs/medicaid/income/_couple_standard.py +++ b/policyengine_us/variables/gov/hhs/medicaid/income/_couple_standard.py @@ -1,4 +1,7 @@ from policyengine_us.model_api import * +from policyengine_us.variables.gov.ssa.ssi.eligibility.income.deemed.from_ineligible_spouse._ssi_annual_spousal_deeming import ( + ssi_budget_spousal_deeming_applies, +) from policyengine_us.variables.gov.ssa.ssi.eligibility.resources.deemed._ssi_spouses import ( _ssi_couple_budget_total, _ssi_couple_total, @@ -64,6 +67,7 @@ def spouses_split_by_facility(person: Population, period: Period) -> ArrayLike: def uses_couple_standard( person: Population, period: Period, + parameters, budgets_together: ArrayLike, couple_limit_without_deeming: ArrayLike, ) -> ArrayLike: @@ -80,7 +84,7 @@ def uses_couple_standard( & is_married & (spouses_sum(person, period, aged_blind_disabled) == 1) ) - nothing_deemed = ~person("is_ssi_spousal_deeming_applies", period) + nothing_deemed = ~ssi_budget_spousal_deeming_applies(person, period, parameters) tested_alone = has_ineligible_spouse & nothing_deemed return ( is_married diff --git a/policyengine_us/variables/gov/hhs/medicaid/income/deemed/from_ineligible_parent/medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent.py b/policyengine_us/variables/gov/hhs/medicaid/income/deemed/from_ineligible_parent/medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent.py index 3f2d282fe7b..48c26994ab4 100644 --- a/policyengine_us/variables/gov/hhs/medicaid/income/deemed/from_ineligible_parent/medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent.py +++ b/policyengine_us/variables/gov/hhs/medicaid/income/deemed/from_ineligible_parent/medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent.py @@ -1,17 +1,4 @@ from policyengine_us.model_api import * -from policyengine_us.variables.gov.hhs.medicaid.income._apply_medicaid_optional_senior_or_disabled_exclusions import ( - _apply_medicaid_optional_senior_or_disabled_exclusions, -) -from policyengine_us.variables.gov.ssa.ssi.eligibility.income._apply_ssi_exclusions import ( - _apply_ssi_exclusions, -) -from policyengine_us.variables.gov.ssa.ssi.eligibility.income.deemed.from_ineligible_parent._parent_pool import ( - _spouse_filing_elsewhere, - _with_spouse_unit, -) -from policyengine_us.variables.household.demographic.person._parent_links import ( - is_parent_of_any, -) class medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent( @@ -24,113 +11,13 @@ class medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligibl definition_period = YEAR reference = ( "https://www.law.cornell.edu/cfr/text/20/416.1165", + "https://www.law.cornell.edu/uscode/text/42/1396b#v", "https://dssmanuals.mo.gov/mo-healthnet-for-the-aged-blind-and-disabled/0805-000-00/0805-020-00/0805-020-15/", ) def formula(person, period, parameters): - eligible_child = person("is_ssi_aged_blind_disabled", period) & person( - "is_child", period + # Aggregate monthly budgets while retaining the annual input contract. + return person( + "medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent_monthly", + period, ) - state = person.household("state_code_str", period) - missouri = state == "MO" - # Missouri deems a natural or adoptive parent's income: "Do not deem the - # income of any other persons in the home, including a stepparent" (DSS - # Manual § 0805.020.15). A stepparent's own child does not make them a - # parent of the disabled child. - ineligible_parent = person("is_ssi_ineligible_parent", period) & ( - ~missouri | is_parent_of_any(person, period, eligible_child) - ) - tax_unit = person.tax_unit - # A deeming spouse who files in another tax unit joins the pool, as in - # ssi_unearned_income_deemed_from_ineligible_parent. - spouse, spouse_files_elsewhere = _spouse_filing_elsewhere( - person, period, ineligible_parent - ) - earned = person("ssi_earned_income", period) - unearned = person("ssi_unearned_income", period) - - prereduction_parental_earned_income = eligible_child * tax_unit.sum( - earned * ineligible_parent - + where(spouse_files_elsewhere, earned[spouse], 0) - ) - blind_disabled_working_student_income = person( - "ssi_blind_or_disabled_working_student_exclusion", period - ) - parental_earned_income = max_( - prereduction_parental_earned_income - blind_disabled_working_student_income, - 0, - ) - - parental_unearned_income = eligible_child * tax_unit.sum( - unearned * ineligible_parent - + where(spouse_files_elsewhere, unearned[spouse], 0) - ) - - child_allocations = eligible_child * _with_spouse_unit( - person, - spouse, - spouse_files_elsewhere, - add(tax_unit, period, ["ssi_ineligible_child_allocation"]), - ) - # Missouri's allowance is "the SSI maximum for the number of parents in - # the home whose income was used in deeming" (DSS Manual § 0805.020.15 - # step 8), so a stepparent or a parent on SSI does not raise it. - ssi = parameters(period).gov.ssa.ssi.amount - # Count as integers: adding two boolean arrays would be a logical OR. - deeming_parents = tax_unit.sum( - ineligible_parent.astype(int) + spouse_files_elsewhere.astype(int) - ) - missouri_allowance = ( - where(deeming_parents == 2, ssi.couple, deeming_parents * ssi.individual) - * MONTHS_IN_YEAR - ) - parental_allocations = eligible_child * where( - missouri, - missouri_allowance, - add(tax_unit, period, ["ssi_ineligible_parent_allocation"]), - ) - - parental_unearned_income -= child_allocations - remaining_child_allocations = max_(0, -parental_unearned_income) - parental_unearned_income = max_(0, parental_unearned_income) - parental_earned_income = max_( - 0, parental_earned_income - remaining_child_allocations - ) - - general_disregard = parameters( - period - ).gov.hhs.medicaid.eligibility.categories.senior_or_disabled.income.disregard.individual[ - state - ] - # Missouri deems parental income in the SSI order: the $20 - # exclusion comes off before the $65 and the half (DSS Manual - # § 0805.020.15 steps 4-6), unlike its applicant budget. - net_parental_deemed_income = where( - state == "MO", - _apply_ssi_exclusions( - parental_earned_income, - parental_unearned_income, - parameters, - period, - general_exclusion=general_disregard, - ), - _apply_medicaid_optional_senior_or_disabled_exclusions( - parental_earned_income, - parental_unearned_income, - state, - general_disregard, - parameters, - period, - ), - ) - net_parental_deemed_income = max_( - 0, net_parental_deemed_income - parental_allocations - ) - - count_eligible_children = _with_spouse_unit( - person, spouse, spouse_files_elsewhere, tax_unit.sum(eligible_child) - ) - income = np.zeros_like(count_eligible_children, dtype=float) - mask = count_eligible_children > 0 - income[mask] = net_parental_deemed_income[mask] / count_eligible_children[mask] - return income diff --git a/policyengine_us/variables/gov/hhs/medicaid/income/deemed/from_ineligible_parent/medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent_monthly.py b/policyengine_us/variables/gov/hhs/medicaid/income/deemed/from_ineligible_parent/medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent_monthly.py new file mode 100644 index 00000000000..da5abb03a57 --- /dev/null +++ b/policyengine_us/variables/gov/hhs/medicaid/income/deemed/from_ineligible_parent/medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent_monthly.py @@ -0,0 +1,171 @@ +from policyengine_us.variables.gov.ssa.ssi.eligibility.income._annual_input import ( + annual_input, +) +from policyengine_us.model_api import * +from policyengine_us.variables.gov.hhs.medicaid.income._apply_medicaid_optional_senior_or_disabled_exclusions import ( + _apply_medicaid_optional_senior_or_disabled_exclusions, +) +from policyengine_us.variables.gov.ssa.ssi.eligibility.income._apply_ssi_exclusions import ( + _apply_ssi_exclusions, +) +from policyengine_us.variables.gov.ssa.ssi.eligibility.income.deemed.from_ineligible_parent._parent_pool import ( + _spouse_filing_elsewhere, + _with_spouse_unit, +) +from policyengine_us.variables.gov.ssa.ssi.eligibility.income.deemed.from_ineligible_parent._ssi_parental_child_allocation_scope import ( + ssi_parental_child_allocation_total, +) +from policyengine_us.variables.household.demographic.person._parent_links import ( + is_parent_of_any, +) + + +class medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent_monthly( + Variable +): + value_type = float + entity = Person + label = "Medicaid optional senior or disabled unearned income deemed from ineligible parent" + unit = USD + definition_period = MONTH + reference = ( + "https://www.law.cornell.edu/cfr/text/20/416.1165", + "https://www.law.cornell.edu/uscode/text/42/1396b#v", + "https://dssmanuals.mo.gov/mo-healthnet-for-the-aged-blind-and-disabled/0805-000-00/0805-020-00/0805-020-15/", + "https://www.govinfo.gov/content/pkg/USCODE-2024-title42/html/USCODE-2024-title42-chap7-subchapXIX-sec1396a.htm", + "https://www.ecfr.gov/current/title-42/section-435.601#p-435.601(d)(2)", + "https://www.dmas.virginia.gov/media/mghpujpo/m05-1-1-26.pdf#page=57", + ) + + def formula(person, period, parameters): + supplied = annual_input( + person, + period, + "medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent", + ) + if supplied is not None: + return supplied / MONTHS_IN_YEAR + + # Medicaid's own immigration rules include eligible groups who do + # not qualify for SSI, including state-covered noncitizen children. + eligible_child = ( + person("is_ssi_aged_blind_disabled", period) + & person("is_child", period) + & person("is_medicaid_immigration_status_eligible", period) + ) + state = person.household("state_code_str", period) + missouri = state == "MO" + # Missouri deems a natural or adoptive parent's income: "Do not deem the + # income of any other persons in the home, including a stepparent" (DSS + # Manual § 0805.020.15). A stepparent's own child does not make them a + # parent of the disabled child. + ineligible_parent = person("is_ssi_ineligible_parent", period) & ( + ~missouri | is_parent_of_any(person, period, eligible_child) + ) + tax_unit = person.tax_unit + # A deeming spouse who files in another tax unit joins the pool, as in + # SSI's parental deeming. + spouse, spouse_files_elsewhere = _spouse_filing_elsewhere( + person, period, ineligible_parent + ) + earned = person("ssi_earned_income", period) + unearned = person("ssi_unearned_income", period) + + prereduction_parental_earned_income = eligible_child * tax_unit.sum( + earned * ineligible_parent + + where(spouse_files_elsewhere, earned[spouse], 0) + ) + blind_disabled_working_student_income = person( + "ssi_blind_or_disabled_working_student_exclusion", period + ) + parental_earned_income = max_( + prereduction_parental_earned_income - blind_disabled_working_student_income, + 0, + ) + + parental_unearned_income = eligible_child * tax_unit.sum( + unearned * ineligible_parent + + where(spouse_files_elsewhere, unearned[spouse], 0) + ) + + # Non-209(b) states retain SSI's allocation scope under + # 42 USC 1396a(r)(2) and 42 CFR 435.601(d)(2)-(3). + age = person("age", period.this_year) + p = parameters( + period + ).gov.hhs.medicaid.eligibility.categories.senior_or_disabled.income.deeming + allocation_child = (age < p.ineligible_child_age_limit[state]) & ( + ~p.ineligible_child_requires_nonblind_nondisabled[state].astype(bool) + | ~person("is_ssi_aged_blind_disabled", period) + ) + allocations = ( + person("ssi_ineligible_child_allocation_monthly", period) * allocation_child + ) + # The allocation total already reaches the children of a parent's + # spouse who files in another tax unit. + child_allocations = eligible_child * ssi_parental_child_allocation_total( + person, period, eligible_child, allocations + ) + # Missouri's allowance is "the SSI maximum for the number of parents in + # the home whose income was used in deeming" (DSS Manual § 0805.020.15 + # step 8), so a stepparent or a parent on SSI does not raise it. + ssi = parameters(period).gov.ssa.ssi.amount + # Count as integers: adding two boolean arrays would be a logical OR. + deeming_parents = tax_unit.sum( + ineligible_parent.astype(int) + spouse_files_elsewhere.astype(int) + ) + missouri_allowance = where( + deeming_parents == 2, ssi.couple, deeming_parents * ssi.individual + ) + parental_allocations = eligible_child * where( + missouri, + missouri_allowance, + add(tax_unit, period, ["ssi_ineligible_parent_allocation"]), + ) + + parental_unearned_income -= child_allocations + remaining_child_allocations = max_(0, -parental_unearned_income) + parental_unearned_income = max_(0, parental_unearned_income) + parental_earned_income = max_( + 0, parental_earned_income - remaining_child_allocations + ) + + general_disregard = parameters( + period + ).gov.hhs.medicaid.eligibility.categories.senior_or_disabled.income.disregard.individual[ + state + ] + # Missouri deems parental income in the SSI order: the $20 + # exclusion comes off before the $65 and the half (DSS Manual + # § 0805.020.15 steps 4-6), unlike its applicant budget. + net_parental_deemed_income = where( + missouri, + _apply_ssi_exclusions( + parental_earned_income, + parental_unearned_income, + parameters, + period, + general_exclusion=general_disregard, + monthly=True, + ), + _apply_medicaid_optional_senior_or_disabled_exclusions( + parental_earned_income * MONTHS_IN_YEAR, + parental_unearned_income * MONTHS_IN_YEAR, + state, + general_disregard, + parameters, + period, + ) + / MONTHS_IN_YEAR, + ) + net_parental_deemed_income = max_( + 0, net_parental_deemed_income - parental_allocations + ) + + count_eligible_children = _with_spouse_unit( + person, spouse, spouse_files_elsewhere, tax_unit.sum(eligible_child) + ) + income = np.zeros_like(count_eligible_children, dtype=float) + mask = count_eligible_children > 0 + income[mask] = net_parental_deemed_income[mask] / count_eligible_children[mask] + return where(eligible_child, income, 0) diff --git a/policyengine_us/variables/gov/hhs/medicaid/income/deemed/from_ineligible_spouse/medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse.py b/policyengine_us/variables/gov/hhs/medicaid/income/deemed/from_ineligible_spouse/medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse.py index 1c528b114ad..7080ea4d3c9 100644 --- a/policyengine_us/variables/gov/hhs/medicaid/income/deemed/from_ineligible_spouse/medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse.py +++ b/policyengine_us/variables/gov/hhs/medicaid/income/deemed/from_ineligible_spouse/medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse.py @@ -1,13 +1,4 @@ from policyengine_us.model_api import * -from policyengine_us.variables.gov.hhs.medicaid.income._apply_medicaid_optional_senior_or_disabled_exclusions import ( - _apply_medicaid_optional_senior_or_disabled_exclusions, -) -from policyengine_us.variables.gov.hhs.medicaid.income._couple_standard import ( - spouses_split_by_facility, -) -from policyengine_us.variables.gov.ssa.ssi.eligibility.resources.deemed._ssi_spouses import ( - _ssi_couple_total, -) class medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse( @@ -20,77 +11,13 @@ class medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse( reference = ( "https://www.law.cornell.edu/cfr/text/20/416.1163", "https://dssmanuals.mo.gov/mo-healthnet-for-the-aged-blind-and-disabled/0805-000-00/0805-015-00/0805-015-05/", - "https://epm.azahcccs.gov/epmplus/Policy/Chapter_600_Income_Eligibility/611_How_to_Calculate_Income_Eligibility_for_SSIMAO/611A.htm", - "https://www.law.cornell.edu/uscode/text/42/1396r-5", ) defined_for = "is_ssi_aged_blind_disabled" unit = USD def formula(person, period, parameters): - deeming_applies = person("is_ssi_spousal_deeming_applies", period) - spouse_earned = person( - "ssi_earned_income_deemed_from_ineligible_spouse", period - ) - spouse_unearned = person( - "ssi_unearned_income_deemed_from_ineligible_spouse", period - ) - individual_earned = person("ssi_earned_income", period) - individual_unearned = person("ssi_unearned_income", period) - - p = parameters( - period - ).gov.hhs.medicaid.eligibility.categories.senior_or_disabled.income.disregard - state = person.household("state_code_str", period) - - # Some states budget a married couple living together: the spouse's - # income counts without SSI's FBR-differential threshold. The spouse's - # income is still what remains after the allocations for ineligible - # children in 20 CFR 416.1163(b), which Arizona's MA611 A also - # subtracts. Missouri MHABD alone considers the couple's gross income - # and does "not consider the income and expenses of minor children" - # (DSS Manual § 0805.015.05), so no allocation comes off there. - budgets_together = ( - parameters(period) - .gov.hhs.medicaid.eligibility.categories.senior_or_disabled.income.budgets_couple_together[ - state - ] - .astype(bool) - ) - ineligible_spouse = person("is_ssi_ineligible_spouse", period) - spouse_gross_earned = ( - _ssi_couple_total(person, period, ineligible_spouse * individual_earned) - - ineligible_spouse * individual_earned - ) - spouse_gross_unearned = ( - _ssi_couple_total(person, period, ineligible_spouse * individual_unearned) - - ineligible_spouse * individual_unearned - ) - is_mo = state == "MO" - spouse_earned = where(is_mo, spouse_gross_earned, spouse_earned) - spouse_unearned = where(is_mo, spouse_gross_unearned, spouse_unearned) - has_ineligible_spouse = _ssi_couple_total(person, period, ineligible_spouse) > 0 - # A couple split by a facility counts no spouse income under either method - # (42 USC 1396r-5(b)(1)). - deeming_applies = ( - deeming_applies | (budgets_together & has_ineligible_spouse) - ) & ~spouses_split_by_facility(person, period) - - alone_countable = _apply_medicaid_optional_senior_or_disabled_exclusions( - individual_earned, - individual_unearned, - state, - p.individual[state], - parameters, + # Aggregate monthly budgets while retaining the annual input contract. + return person( + "medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse_monthly", period, ) - couple_countable = _apply_medicaid_optional_senior_or_disabled_exclusions( - individual_earned + spouse_earned, - individual_unearned + spouse_unearned, - state, - p.couple[state], - parameters, - period, - ) - - deemed_amount = max_(0, couple_countable - alone_countable) - return deeming_applies * deemed_amount diff --git a/policyengine_us/variables/gov/hhs/medicaid/income/deemed/from_ineligible_spouse/medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse_monthly.py b/policyengine_us/variables/gov/hhs/medicaid/income/deemed/from_ineligible_spouse/medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse_monthly.py new file mode 100644 index 00000000000..a8d8f288c85 --- /dev/null +++ b/policyengine_us/variables/gov/hhs/medicaid/income/deemed/from_ineligible_spouse/medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse_monthly.py @@ -0,0 +1,117 @@ +from policyengine_us.variables.gov.ssa.ssi.eligibility.income._annual_input import ( + annual_input, +) +from policyengine_us.model_api import * +from policyengine_us.variables.gov.hhs.medicaid.income._couple_standard import ( + spouses_split_by_facility, +) +from policyengine_us.variables.gov.ssa.ssi.eligibility.resources.deemed._ssi_spouses import ( + _ssi_couple_total, +) + +from policyengine_us.variables.gov.hhs.medicaid.income._apply_medicaid_optional_senior_or_disabled_exclusions import ( + _apply_medicaid_optional_senior_or_disabled_exclusions, +) + + +class medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse_monthly( + Variable +): + value_type = float + entity = Person + label = "Medicaid optional senior or disabled income deemed from ineligible spouse" + definition_period = MONTH + reference = ( + "https://www.law.cornell.edu/cfr/text/20/416.1163", + "https://www.law.cornell.edu/uscode/text/42/1396r-5", + "https://epm.azahcccs.gov/epmplus/Policy/Chapter_600_Income_Eligibility/611_How_to_Calculate_Income_Eligibility_for_SSIMAO/611A.htm", + "https://dssmanuals.mo.gov/mo-healthnet-for-the-aged-blind-and-disabled/0805-000-00/0805-015-00/0805-015-05/", + ) + unit = USD + + def formula(person, period, parameters): + supplied = annual_input( + person, + period, + "medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse", + ) + if supplied is not None: + return supplied / MONTHS_IN_YEAR + + deeming_applies = person("is_ssi_spousal_deeming_applies_monthly", period) + spouse_earned = person( + "ssi_earned_income_deemed_from_ineligible_spouse_monthly", period + ) + spouse_unearned = person( + "ssi_unearned_income_deemed_from_ineligible_spouse_monthly", period + ) + individual_earned = person("ssi_earned_income", period) + individual_unearned = person("ssi_unearned_income", period) + + p = parameters( + period + ).gov.hhs.medicaid.eligibility.categories.senior_or_disabled.income.disregard + state = person.household("state_code_str", period) + + # Some states budget a married couple living together: the spouse's + # income counts without SSI's FBR-differential threshold. The spouse's + # income is still what remains after the allocations for ineligible + # children in 20 CFR 416.1163(b), which Arizona's MA611 A also + # subtracts. Missouri MHABD alone considers the couple's gross income + # and does "not consider the income and expenses of minor children" + # (DSS Manual § 0805.015.05), so no allocation comes off there. + budgets_together = ( + parameters(period) + .gov.hhs.medicaid.eligibility.categories.senior_or_disabled.income.budgets_couple_together[ + state + ] + .astype(bool) + ) + ineligible_spouse = person("is_ssi_ineligible_spouse", period) + spouse_gross_earned = ( + _ssi_couple_total(person, period, ineligible_spouse * individual_earned) + - ineligible_spouse * individual_earned + ) + spouse_gross_unearned = ( + _ssi_couple_total(person, period, ineligible_spouse * individual_unearned) + - ineligible_spouse * individual_unearned + ) + is_mo = state == "MO" + spouse_earned = where(is_mo, spouse_gross_earned, spouse_earned) + spouse_unearned = where(is_mo, spouse_gross_unearned, spouse_unearned) + has_ineligible_spouse = _ssi_couple_total(person, period, ineligible_spouse) > 0 + # A couple split by a facility counts no spouse income under either method + # (42 USC 1396r-5(b)(1)). + deeming_applies = ( + deeming_applies | (budgets_together & has_ineligible_spouse) + ) & ~spouses_split_by_facility(person, period) + + alone_countable = ( + _apply_medicaid_optional_senior_or_disabled_exclusions( + individual_earned * MONTHS_IN_YEAR, + individual_unearned * MONTHS_IN_YEAR, + state, + p.individual[state], + parameters, + period, + ) + / MONTHS_IN_YEAR + ) + couple_countable = ( + _apply_medicaid_optional_senior_or_disabled_exclusions( + (individual_earned + spouse_earned) * MONTHS_IN_YEAR, + (individual_unearned + spouse_unearned) * MONTHS_IN_YEAR, + state, + p.couple[state], + parameters, + period, + ) + / MONTHS_IN_YEAR + ) + + deemed_amount = max_(0, couple_countable - alone_countable) + return where( + person("is_ssi_aged_blind_disabled", period), + deeming_applies * deemed_amount, + 0, + ) diff --git a/policyengine_us/variables/gov/hhs/medicaid/income/medicaid_optional_senior_or_disabled_countable_income.py b/policyengine_us/variables/gov/hhs/medicaid/income/medicaid_optional_senior_or_disabled_countable_income.py index e32c30c6e9b..22f5b28f8ab 100644 --- a/policyengine_us/variables/gov/hhs/medicaid/income/medicaid_optional_senior_or_disabled_countable_income.py +++ b/policyengine_us/variables/gov/hhs/medicaid/income/medicaid_optional_senior_or_disabled_countable_income.py @@ -1,12 +1,4 @@ from policyengine_us.model_api import * -from policyengine_us.variables.gov.hhs.medicaid.income._apply_medicaid_optional_senior_or_disabled_exclusions import ( - _apply_medicaid_optional_senior_or_disabled_exclusions, -) -from policyengine_us.variables.gov.ssa.ssi.eligibility.resources.deemed._ssi_spouses import ( - _ssi_couple_income, - _ssi_couple_total, - _ssi_spouse_index, -) class medicaid_optional_senior_or_disabled_countable_income(Variable): @@ -34,136 +26,7 @@ class medicaid_optional_senior_or_disabled_countable_income(Variable): ) def formula(person, period, parameters): - # NOTE: this annual formula applies one couple status to the whole - # year (couple_computation below), so it combines the spouses' annual - # income by that same status. ssi_marital_earned_income and - # ssi_marital_unearned_income are monthly and follow each month's - # status; their annual totals would not match it in a year with a - # part-year facility stay. - pre_reduction_earned_income = _ssi_couple_income( - person, period, "ssi_earned_income" + # Aggregate monthly budgets while retaining the annual input contract. + return person( + "medicaid_optional_senior_or_disabled_countable_income_monthly", period ) - blind_disabled_working_student_income = person( - "ssi_blind_or_disabled_working_student_exclusion", period - ) - earned_income = max_( - pre_reduction_earned_income - blind_disabled_working_student_income, - 0, - ) - - total_unearned_income = ( - _ssi_couple_income(person, period, "ssi_unearned_income") - + person( - "medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent", - period, - ) - + person("ssi_in_kind_support_and_maintenance", period) - ) - - couple_computation = person("ssi_couple_computation_applies", period) - state = person.household("state_code_str", period) - p = parameters( - period - ).gov.hhs.medicaid.eligibility.categories.senior_or_disabled.income - income_disregard = where( - couple_computation, - p.disregard.couple[state], - p.disregard.individual[state], - ) - personal_countable = _apply_medicaid_optional_senior_or_disabled_exclusions( - earned_income, - total_unearned_income, - state, - income_disregard, - parameters, - period, - ) - - # 22 CCR 50555.2 deducts person-paid premiums, Part B only when the - # person pays it. From 12/2020 (ACWDL 20-18, 20-24) CA disregards Part B - # "regardless of how the premium is paid": swap the person-paid Part B - # in the shared aggregate for the individual's full Part B premium, the - # base premium plus any IRMAA (42 USC 1395r(i)), whoever pays it. - # Only a Part B enrollee (medicare_part_b_enrolled) has a Part B - # premium to disregard. - # NOTE: ACWDL 20-24 Example 5 also deducts a non-applicant spouse's - # premiums. Spousal income here follows SSI deeming (20 CFR 416.1163), - # so that premium is not modeled, nor is MC 176's maintenance need - # deduction for the spouse (lines 19 and 21; issue 10543). - # Premiums are counted before the Medicaid Part B buy-in, which starts - # only once Medicaid finds the person eligible (42 USC 1395v(d)(2)(C)). - part_b_enrolled = person("medicare_part_b_enrolled", period) - paid_premiums = person("medicaid_eligibility_health_insurance_premiums", period) - paid_part_b = ( - person("medicare_part_b_premium_before_buy_in", period) * part_b_enrolled - ) - full_part_b = person("gross_medicare_part_b_premium", period) * part_b_enrolled - disregards_part_b = p.disregards_medicare_part_b_premium[state].astype(bool) - own_premiums = where( - disregards_part_b, - max_(paid_premiums - paid_part_b, 0) + full_part_b, - paid_premiums, - ) - # 22 CCR 50555.2(a) deducts premiums paid by and purchased for any - # person in the family. A couple's budget takes both spouses' - # premiums and, when the couple head their tax unit, those of its - # unmarried tax dependents, whatever marital unit those dependents - # are in: a child never shares a couple's marital unit. Spouses who - # file separately each take the dependents of both tax units, so the - # two halves of the budget agree. Another couple's dependent and an - # unrelated adult in another tax unit stay out, as do the other - # dependents of a tax unit the couple belong to as dependents. - spouse = _ssi_spouse_index(person, period) - safe_spouse = np.maximum(spouse, 0) - unmarried_dependent = person("is_tax_unit_dependent", period) & (spouse < 0) - dependents_premiums = where( - person("is_tax_unit_head_or_spouse", period), - person.tax_unit.sum(where(unmarried_dependent, own_premiums, 0)), - 0, - ) - tax_unit_id = person.tax_unit.reference_entity.members_entity_id - spouse_in_another_tax_unit = (spouse >= 0) & ( - tax_unit_id[safe_spouse] != tax_unit_id - ) - family_dependents_premiums = dependents_premiums + where( - spouse_in_another_tax_unit, dependents_premiums[safe_spouse], 0 - ) - premiums = where( - couple_computation, - _ssi_couple_total(person, period, own_premiums) - + family_dependents_premiums, - own_premiums, - ) - deducts_premiums = p.deducts_health_insurance_premiums[state].astype(bool) - # MC 176 (ACWDL 00-57) lines 16-17 subtract the additional disregard - # and the premiums from income after the SSI exclusions. - additional_disregard = ( - where( - couple_computation, - p.additional_disregard.couple[state], - p.additional_disregard.individual[state], - ) - * MONTHS_IN_YEAR - ) - deductions = where(deducts_premiums, premiums, 0) + additional_disregard - - spousal_deemed = person( - "medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse", - period, - ) - # SSI methodology (42 CFR 435.601) counts the applicant's own income - # whether or not they meet SSI's noncitizen rules. People who are not - # aged, blind, or disabled have no countable income here; a spouse's - # income is deemed to the applicant instead. - is_aged_blind_disabled = person("is_ssi_aged_blind_disabled", period) - - # ACWDL 20-24 Examples 2 and 5 combine the non-applicant spouse's - # income with the applicant's income before the deductions, as - # 20 CFR 416.1163(d)(2) does, so subtract the deductions from the - # combined income and floor the result. - countable = where( - couple_computation, - max_(personal_countable - deductions, 0) / 2, - max_(personal_countable + spousal_deemed - deductions, 0), - ) - return where(is_aged_blind_disabled, countable, 0) diff --git a/policyengine_us/variables/gov/hhs/medicaid/income/medicaid_optional_senior_or_disabled_countable_income_monthly.py b/policyengine_us/variables/gov/hhs/medicaid/income/medicaid_optional_senior_or_disabled_countable_income_monthly.py new file mode 100644 index 00000000000..37dff19589e --- /dev/null +++ b/policyengine_us/variables/gov/hhs/medicaid/income/medicaid_optional_senior_or_disabled_countable_income_monthly.py @@ -0,0 +1,173 @@ +from policyengine_us.variables.gov.ssa.ssi.eligibility.income._annual_input import ( + annual_input, +) +from policyengine_us.model_api import * +from policyengine_us.variables.gov.ssa.ssi.eligibility.resources.deemed._ssi_spouses import ( + _ssi_couple_total, + _ssi_spouse_index, +) +from policyengine_us.variables.gov.hhs.medicaid.income._apply_medicaid_optional_senior_or_disabled_exclusions import ( + _apply_medicaid_optional_senior_or_disabled_exclusions, +) + + +class medicaid_optional_senior_or_disabled_countable_income_monthly(Variable): + value_type = float + entity = Person + label = "Countable income for Medicaid's optional senior or disabled pathway" + unit = USD + definition_period = MONTH + reference = ( + "https://www.law.cornell.edu/uscode/text/42/1396a#m", + "https://www.law.cornell.edu/cfr/text/42/435.601", + "https://www.kff.org/medicaid/medicaid-financial-eligibility-for-seniors-and-people-with-disabilities-findings-from-a-50-state-survey/", + # Missouri MHABD budgeting order and rounding + "https://dssmanuals.mo.gov/mo-healthnet-for-the-aged-blind-and-disabled/0805-000-00/0805-015-00/", + "https://dssmanuals.mo.gov/mo-healthnet-for-the-aged-blind-and-disabled/0805-000-00/0805-015-00/0805-015-25/", + "https://dssmanuals.mo.gov/mo-healthnet-for-the-aged-blind-and-disabled/0805-000-00/0805-015-00/0805-015-40/", + # California ABD FPL disregard and Part B and health insurance premium + # deductions + "https://www.dhcs.ca.gov/services/medi-cal/eligibility/letters/Documents/c00-57.pdf#page=3", + "https://www.dhcs.ca.gov/services/medi-cal/eligibility/letters/Documents/20-24.pdf#page=3", + "https://www.dhcs.ca.gov/services/medi-cal/eligibility/letters/Documents/20-18.pdf#page=2", + "https://www.law.cornell.edu/regulations/california/22-CCR-50555.2", + "https://www.law.cornell.edu/uscode/text/42/1395r#i", + "https://www.law.cornell.edu/cfr/text/20/416.1163", + ) + + def formula(person, period, parameters): + supplied = annual_input( + person, period, "medicaid_optional_senior_or_disabled_countable_income" + ) + if supplied is not None: + return supplied / MONTHS_IN_YEAR + + pre_reduction_earned_income = person("ssi_marital_earned_income", period) + blind_disabled_working_student_income = person( + "ssi_blind_or_disabled_working_student_exclusion", period + ) + earned_income = max_( + pre_reduction_earned_income - blind_disabled_working_student_income, + 0, + ) + + total_unearned_income = add( + person, + period, + [ + "ssi_marital_unearned_income", + "medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent_monthly", + "ssi_in_kind_support_and_maintenance_monthly", + ], + ) + + couple_computation = person("ssi_couple_computation_applies", period) + state = person.household("state_code_str", period) + p = parameters( + period + ).gov.hhs.medicaid.eligibility.categories.senior_or_disabled.income + income_disregard = where( + couple_computation, + p.disregard.couple[state], + p.disregard.individual[state], + ) + personal_countable = ( + _apply_medicaid_optional_senior_or_disabled_exclusions( + earned_income * MONTHS_IN_YEAR, + total_unearned_income * MONTHS_IN_YEAR, + state, + income_disregard, + parameters, + period, + ) + / MONTHS_IN_YEAR + ) + + # 22 CCR 50555.2 deducts person-paid premiums, Part B only when the + # person pays it. From 12/2020 (ACWDL 20-18, 20-24) CA disregards Part B + # "regardless of how the premium is paid": swap the person-paid Part B + # in the shared aggregate for the individual's full Part B premium, the + # base premium plus any IRMAA (42 USC 1395r(i)), whoever pays it. + # Only a Part B enrollee (medicare_part_b_enrolled) has a Part B + # premium to disregard. + # NOTE: ACWDL 20-24 Example 5 also deducts a non-applicant spouse's + # premiums. Spousal income here follows SSI deeming (20 CFR 416.1163), + # so that premium is not modeled, nor is MC 176's maintenance need + # deduction for the spouse (lines 19 and 21; issue 10543). + # Premiums are counted before the Medicaid Part B buy-in, which starts + # only once Medicaid finds the person eligible (42 USC 1395v(d)(2)(C)). + part_b_enrolled = person("medicare_part_b_enrolled", period) + paid_premiums = ( + person("medicaid_eligibility_health_insurance_premiums", period.this_year) + / MONTHS_IN_YEAR + ) + paid_part_b = ( + person("medicare_part_b_premium_before_buy_in", period.this_year) + / MONTHS_IN_YEAR + ) * part_b_enrolled + full_part_b = ( + person("gross_medicare_part_b_premium", period.this_year) / MONTHS_IN_YEAR + ) * part_b_enrolled + disregards_part_b = p.disregards_medicare_part_b_premium[state].astype(bool) + own_premiums = where( + disregards_part_b, + max_(paid_premiums - paid_part_b, 0) + full_part_b, + paid_premiums, + ) + # Under 22 CCR 50555.2(a), deduct premiums paid by and purchased + # for any family member. Include both spouses' premiums and, when + # they head their tax unit, their unmarried dependents' premiums. + # Spouses filing separately share both tax units' dependent premiums. + # Exclude another couple's dependents and dependents of a tax unit + # where the couple are dependents. + spouse = _ssi_spouse_index(person, period) + safe_spouse = np.maximum(spouse, 0) + unmarried_dependent = person("is_tax_unit_dependent", period) & (spouse < 0) + dependents_premiums = where( + person("is_tax_unit_head_or_spouse", period), + person.tax_unit.sum(where(unmarried_dependent, own_premiums, 0)), + 0, + ) + tax_unit_id = person.tax_unit.reference_entity.members_entity_id + spouse_in_another_tax_unit = (spouse >= 0) & ( + tax_unit_id[safe_spouse] != tax_unit_id + ) + family_dependents_premiums = dependents_premiums + where( + spouse_in_another_tax_unit, dependents_premiums[safe_spouse], 0 + ) + premiums = where( + couple_computation, + _ssi_couple_total(person, period, own_premiums) + + family_dependents_premiums, + own_premiums, + ) + deducts_premiums = p.deducts_health_insurance_premiums[state].astype(bool) + # MC 176 (ACWDL 00-57) lines 16-17 subtract the additional disregard + # and the premiums from income after the SSI exclusions. + additional_disregard = where( + couple_computation, + p.additional_disregard.couple[state], + p.additional_disregard.individual[state], + ) + deductions = where(deducts_premiums, premiums, 0) + additional_disregard + + spousal_deemed = person( + "medicaid_optional_senior_or_disabled_income_deemed_from_ineligible_spouse_monthly", + period, + ) + # SSI methodology (42 CFR 435.601) counts the applicant's own income + # whether or not they meet SSI's noncitizen rules. People who are not + # aged, blind, or disabled have no countable income here; a spouse's + # income is deemed to the applicant instead. + is_aged_blind_disabled = person("is_ssi_aged_blind_disabled", period) + + # ACWDL 20-24 Examples 2 and 5 combine the non-applicant spouse's + # income with the applicant's income before the deductions, as + # 20 CFR 416.1163(d)(2) does, so subtract the deductions from the + # combined income and floor the result. + countable = where( + couple_computation, + max_(personal_countable - deductions, 0) / 2, + max_(personal_countable + spousal_deemed - deductions, 0), + ) + return where(is_aged_blind_disabled, countable, 0) diff --git a/policyengine_us/variables/gov/hhs/medicare/savings_programs/income/_msp_spouse_income.py b/policyengine_us/variables/gov/hhs/medicare/savings_programs/income/_msp_spouse_income.py index 6a4198e6325..9c09ee57efa 100644 --- a/policyengine_us/variables/gov/hhs/medicare/savings_programs/income/_msp_spouse_income.py +++ b/policyengine_us/variables/gov/hhs/medicare/savings_programs/income/_msp_spouse_income.py @@ -47,7 +47,9 @@ def msp_spouse_income(person: Population, period: Period, spouse: ArrayLike) -> 0, msp_spouse_value(person("ssi_unearned_income", year), spouse), ) - allocations = add(person.tax_unit, year, ["ssi_ineligible_child_allocation"]) + allocations = ( + person("ssi_spousal_deeming_child_allocations", period) * MONTHS_IN_YEAR + ) earned_left = max_(spouse_earned - max_(allocations - spouse_unearned, 0), 0) unearned_left = max_(spouse_unearned - allocations, 0) return earned_left, unearned_left diff --git a/policyengine_us/variables/gov/ssa/ssi/_ssi_state_supplement.py b/policyengine_us/variables/gov/ssa/ssi/_ssi_state_supplement.py index 3c1d3cf0a43..2d9553dd8f4 100644 --- a/policyengine_us/variables/gov/ssa/ssi/_ssi_state_supplement.py +++ b/policyengine_us/variables/gov/ssa/ssi/_ssi_state_supplement.py @@ -43,12 +43,12 @@ def ssi_state_supplement( joint = person("ssi_couple_computation_applies", period) couple_total = _ssi_couple_total(person, period.this_year, couple_rate / 2) standard = where(joint, couple_total / 2, individual_rate) - countable = person("ssi_countable_income", period) + countable = person("ssi_countable_income_monthly", period) federal_amount = person("ssi_amount_if_eligible", period) excess = max_(countable - federal_amount, 0) payment = max_(standard - excess, 0) - deeming = person("is_ssi_spousal_deeming_applies", period.this_year) + deeming = person("is_ssi_spousal_deeming_applies_monthly", period) deemed = person("ssi_income_deemed_from_ineligible_spouse_monthly", period) own_income = max_(countable - deemed, 0) ssi = parameters(period).gov.ssa.ssi diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/_apply_ssi_exclusions.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/_apply_ssi_exclusions.py index c60a0f8965f..59641be86cc 100644 --- a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/_apply_ssi_exclusions.py +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/_apply_ssi_exclusions.py @@ -42,6 +42,7 @@ def _apply_ssi_exclusions( parameters: ParameterNode, period: Period, general_exclusion: ArrayLike = None, + monthly: bool = False, ) -> ArrayLike: """ Applies the standard SSI income exclusions to annual earned and unearned @@ -49,11 +50,15 @@ def _apply_ssi_exclusions( annual countable income. The exclusions are monthly amounts, so this converts annual -> monthly, applies them, then goes back to annual. """ - monthly = _apply_ssi_exclusions_monthly( + if monthly: + return _apply_ssi_exclusions_monthly( + earned_income, unearned_income, parameters, period, general_exclusion + ) + monthly_countable = _apply_ssi_exclusions_monthly( earned_income / MONTHS_IN_YEAR, unearned_income / MONTHS_IN_YEAR, parameters, period, general_exclusion, ) - return monthly * MONTHS_IN_YEAR + return monthly_countable * MONTHS_IN_YEAR diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/_ssi_countable_income.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/_ssi_countable_income.py new file mode 100644 index 00000000000..84aa91e3ef2 --- /dev/null +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/_ssi_countable_income.py @@ -0,0 +1,58 @@ +"""Monthly countable income under SSI methodology.""" + +from policyengine_us.model_api import * +from policyengine_us.variables.gov.ssa.ssi.eligibility.income._apply_ssi_exclusions import ( + _apply_ssi_exclusions, +) + + +def ssi_countable_income(person, period, parameters, parent_deemed=None): + """Apply SSI exclusions with an optional parental-deeming override.""" + # Apply the student exclusion to the individual's earned income. + pre_reduction_earned_income = person("ssi_marital_earned_income", period) + blind_disabled_working_student_income = person( + "ssi_blind_or_disabled_working_student_exclusion", period + ) + earned_income = max_( + pre_reduction_earned_income - blind_disabled_working_student_income, + 0, + ) + + # SSI's marital income variables already combine eligible spouses' income. + unearned_income = person("ssi_marital_unearned_income", period) + if parent_deemed is None: + parent_deemed = person( + "ssi_unearned_income_deemed_from_ineligible_parent_monthly", period + ) + + # Count ISM before exclusions under 20 CFR 416.1140. + ism = person("ssi_in_kind_support_and_maintenance_monthly", period) + + total_unearned = unearned_income + parent_deemed + ism + + personal_countable = _apply_ssi_exclusions( + earned_income, + total_unearned, + parameters, + period, + monthly=True, + ) + + # Each eligible spouse takes half the couple's countable income. + both_eligible = person("ssi_couple_computation_applies", period) + + # Add deemed spouse income after excluding the individual's own income. + spousal_deemed = person("ssi_income_deemed_from_ineligible_spouse_monthly", period) + + # State programs can apply SSI income rules with different immigration tests. + is_aged_blind_disabled = person("is_ssi_aged_blind_disabled", period) + + return where( + ~is_aged_blind_disabled, + 0, + where( + both_eligible, + personal_countable / 2, + personal_countable + spousal_deemed, + ), + ) diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_parent/_ssi_parental_child_allocation_scope.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_parent/_ssi_parental_child_allocation_scope.py new file mode 100644 index 00000000000..52a368fcb88 --- /dev/null +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_parent/_ssi_parental_child_allocation_scope.py @@ -0,0 +1,102 @@ +"""Relationship scope for allocations deducted before parental income deeming.""" + +import numpy as np + +from policyengine_us.variables.gov.ssa.ssi.eligibility.resources.deemed._ssi_spouses import ( + _ssi_established_spouse_indices, +) +from policyengine_us.variables.household.demographic.person._parent_links import ( + co_resident_parent_indices, + group_member_indices, + has_parent_ids, + household_has_parent_ids, + household_member_indices, + unlinked_parent, +) + + +def _allocation_parent_rows(person, period, first, second): + """Resolve the co-resident parents and their spouses for allocation scope. + + Parent ids take precedence. Without ids, only unlinked parents enter + the tax-unit proxy, together with their co-resident spouses, as in the + existing SSI resource-deeming relationship contract. + """ + linked = has_parent_ids(person, period) + spouse = _ssi_established_spouse_indices(person, period, first, second) + first_spouse = np.where(first >= 0, spouse[np.maximum(first, 0)], -1) + second_spouse = np.where(second >= 0, spouse[np.maximum(second, 0)], -1) + named = np.column_stack((first, second, first_spouse, second_spouse)) + rows = [np.where(linked[:, None], named, -1)] + + unlinked = unlinked_parent(person, period) + parent_or_spouse = unlinked | ((spouse >= 0) & unlinked[np.maximum(spouse, 0)]) + households = person.household.reference_entity.members_entity_id + tax_units = person.tax_unit.reference_entity.members_entity_id + for member in group_member_indices(person.tax_unit): + safe = np.maximum(member, 0) + selected = ( + ~linked + & (member >= 0) + & (households[safe] == households) + & parent_or_spouse[safe] + ) + rows.append(np.where(selected, member, -1)[:, None]) + # A parent's spouse can file in a different tax unit. + partner = np.where(selected, spouse[safe], -1) + outside = (partner >= 0) & (tax_units[np.maximum(partner, 0)] != tax_units) + rows.append(np.where(outside, partner, -1)[:, None]) + return np.column_stack(rows) + + +def ssi_parental_child_allocation_total(person, period, recipients, allocations=None): + """Allocations for relevant children who live with this recipient. + + 20 CFR 416.1165(b) limits allocations to ineligible children in the + household. Parent ids identify a child of this person or their parents + and parents' spouses; the unlinked-parent tax-unit proxy applies only + where the parent-link contract permits it. A recipient never receives + an allocation from the same pool of income they share. + + Medicaid callers can supply allocations after applying their state's + child definition, while retaining the same relationship scope. + """ + first, second = co_resident_parent_indices(person, period) + parents = _allocation_parent_rows(person, period, first, second) + own_index = np.arange(person.count) + relatives = np.column_stack((own_index, parents)) + present = relatives >= 0 + safe_relatives = np.maximum(relatives, 0) + tax_unit = person.tax_unit.reference_entity.members_entity_id + relative_tax_units = np.where(present, tax_unit[safe_relatives], -1) + unlinked = unlinked_parent(person, period) + may_presume = ~household_has_parent_ids(person, period) | np.any( + present & unlinked[safe_relatives], axis=1 + ) + linked = has_parent_ids(person, period) + if allocations is None: + allocations = person("ssi_ineligible_child_allocation_monthly", period) + total = np.zeros(person.count) + for child in household_member_indices(person): + safe = np.maximum(child, 0) + named = np.any( + present + & ( + (relatives == first[safe][:, None]) + | (relatives == second[safe][:, None]) + ), + axis=1, + ) + presumed = may_presume & np.any( + present & (relative_tax_units == tax_unit[safe][:, None]), axis=1 + ) + is_parent = np.any(parents == child[:, None], axis=1) + counts = ( + (child >= 0) + & (child != own_index) + & ~is_parent + & ~recipients[safe] + & np.where(linked[safe], named, presumed) + ) + total += np.where(counts, allocations[safe], 0) + return total diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_parent/_ssi_parental_deemed_income.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_parent/_ssi_parental_deemed_income.py new file mode 100644 index 00000000000..be2f4491f96 --- /dev/null +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_parent/_ssi_parental_deemed_income.py @@ -0,0 +1,108 @@ +"""Monthly parental deeming, shared by SSI and state supplements.""" + +from policyengine_us.model_api import * +from policyengine_us.variables.gov.ssa.ssi.eligibility.income._apply_ssi_exclusions import ( + _apply_ssi_exclusions, +) +from policyengine_us.variables.gov.ssa.ssi.eligibility.income.deemed.from_ineligible_parent._parent_pool import ( + _spouse_filing_elsewhere, + _with_spouse_unit, +) +from policyengine_us.variables.gov.ssa.ssi.eligibility.income.deemed.from_ineligible_parent._ssi_parental_child_allocation_scope import ( + ssi_parental_child_allocation_total, +) + + +def ssi_parental_deemed_income( + person, period, parameters, allocations=None, recipients=None +): + """Income deemed to each eligible child from ineligible parents in a month. + + 20 CFR 416.1165. `allocations` gives each person's ineligible-child + allocation; it defaults to SSI's. A state supplement whose own rules + define an ineligible child more narrowly passes its own allocations, so + its parental budget follows its rules while SSI's stays unchanged. + `recipients` can replace the SSI recipient set for a state program. + """ + if recipients is None: + immigration_status = person("immigration_status", period) + is_citizen = immigration_status == immigration_status.possible_values.CITIZEN + # 416.1165(e)(2) divides only among SSI-eligible children. Income + # and resource eligibility depend on this calculation, so use the + # status conditions shared with the ineligible-child classification. + recipients = ( + person("is_ssi_aged_blind_disabled", period) + & person("is_child", period) + & (is_citizen | person("is_ssi_qualified_noncitizen", period)) + ) + eligible_child = recipients + ineligible_parent = person("is_ssi_ineligible_parent", period) + tax_unit = person.tax_unit + # 416.1160(d): a parent's spouse who lives with the child is an ineligible + # parent too, so a deeming spouse who files in another tax unit joins the + # pool. + spouse, spouse_files_elsewhere = _spouse_filing_elsewhere( + person, period, ineligible_parent + ) + earned = person("ssi_earned_income", period) + unearned = person("ssi_unearned_income", period) + + prereduction_parental_earned_income = eligible_child * tax_unit.sum( + earned * ineligible_parent + where(spouse_files_elsewhere, earned[spouse], 0) + ) + blind_disabled_working_student_income = person( + "ssi_blind_or_disabled_working_student_exclusion", period + ) + parental_earned_income = max_( + prereduction_parental_earned_income - blind_disabled_working_student_income, + 0, + ) + + parental_unearned_income = eligible_child * tax_unit.sum( + unearned * ineligible_parent + + where(spouse_files_elsewhere, unearned[spouse], 0) + ) + + # The allocation total already reaches the children of a parent's spouse + # who files in another tax unit, so it takes no spouse-unit addition. + child_allocations = eligible_child * ssi_parental_child_allocation_total( + person, period, eligible_child, allocations + ) + parental_allocations = eligible_child * add( + tax_unit, period, ["ssi_ineligible_parent_allocation"] + ) + + # To understand this ordering of operations, see Example 4 of + # https://www.law.cornell.edu/cfr/text/20/416.1165#h. + + parental_unearned_income -= child_allocations + remaining_child_allocations = max_(0, -parental_unearned_income) + parental_unearned_income = max_(0, parental_unearned_income) + parental_earned_income = max_( + 0, parental_earned_income - remaining_child_allocations + ) + + net_parental_deemed_income = _apply_ssi_exclusions( + parental_earned_income, + parental_unearned_income, + parameters, + period, + monthly=True, + ) + + net_parental_deemed_income = max_( + 0, net_parental_deemed_income - parental_allocations + ) + + # 416.1165(e)(2) divides the pooled income among both units' eligible + # children. + count_eligible_children = _with_spouse_unit( + person, spouse, spouse_files_elsewhere, tax_unit.sum(eligible_child) + ) + # avoid array divide-by-zero warnings by not using where() function + # see the following GitHub issue for more details: + # https://github.com/PolicyEngine/policyengine-us/issues/2494 + income = np.zeros_like(count_eligible_children, dtype=float) + mask = count_eligible_children > 0 + income[mask] = net_parental_deemed_income[mask] / count_eligible_children[mask] + return where(eligible_child, income, 0) diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_parent/ssi_unearned_income_deemed_from_ineligible_parent.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_parent/ssi_unearned_income_deemed_from_ineligible_parent.py index 0b6f3e3d48a..add18cfbebc 100644 --- a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_parent/ssi_unearned_income_deemed_from_ineligible_parent.py +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_parent/ssi_unearned_income_deemed_from_ineligible_parent.py @@ -1,11 +1,4 @@ from policyengine_us.model_api import * -from policyengine_us.variables.gov.ssa.ssi.eligibility.income._apply_ssi_exclusions import ( - _apply_ssi_exclusions, -) -from policyengine_us.variables.gov.ssa.ssi.eligibility.income.deemed.from_ineligible_parent._parent_pool import ( - _spouse_filing_elsewhere, - _with_spouse_unit, -) class ssi_unearned_income_deemed_from_ineligible_parent(Variable): @@ -17,72 +10,7 @@ class ssi_unearned_income_deemed_from_ineligible_parent(Variable): reference = "https://www.law.cornell.edu/cfr/text/20/416.1165" def formula(person, period, parameters): - eligible_child = person("is_ssi_aged_blind_disabled", period) & person( - "is_child", period + # Sum completed monthly budgets; supplied amounts retain their annual basis. + return person( + "ssi_unearned_income_deemed_from_ineligible_parent_monthly", period ) - ineligible_parent = person("is_ssi_ineligible_parent", period) - tax_unit = person.tax_unit - spouse, spouse_files_elsewhere = _spouse_filing_elsewhere( - person, period, ineligible_parent - ) - earned = person("ssi_earned_income", period) - unearned = person("ssi_unearned_income", period) - - prereduction_parental_earned_income = eligible_child * tax_unit.sum( - earned * ineligible_parent - + where(spouse_files_elsewhere, earned[spouse], 0) - ) - blind_disabled_working_student_income = person( - "ssi_blind_or_disabled_working_student_exclusion", period - ) - parental_earned_income = max_( - prereduction_parental_earned_income - blind_disabled_working_student_income, - 0, - ) - - parental_unearned_income = eligible_child * tax_unit.sum( - unearned * ineligible_parent - + where(spouse_files_elsewhere, unearned[spouse], 0) - ) - - child_allocations = eligible_child * _with_spouse_unit( - person, - spouse, - spouse_files_elsewhere, - add(tax_unit, period, ["ssi_ineligible_child_allocation"]), - ) - parental_allocations = eligible_child * add( - tax_unit, period, ["ssi_ineligible_parent_allocation"] - ) - - # To understand this ordering of operations, see Example 4 of - # https://www.law.cornell.edu/cfr/text/20/416.1165#h. - - parental_unearned_income -= child_allocations - remaining_child_allocations = max_(0, -parental_unearned_income) - parental_unearned_income = max_(0, parental_unearned_income) - parental_earned_income = max_( - 0, parental_earned_income - remaining_child_allocations - ) - - net_parental_deemed_income = _apply_ssi_exclusions( - parental_earned_income, - parental_unearned_income, - parameters, - period, - ) - - net_parental_deemed_income = max_( - 0, net_parental_deemed_income - parental_allocations - ) - - count_eligible_children = _with_spouse_unit( - person, spouse, spouse_files_elsewhere, tax_unit.sum(eligible_child) - ) - # avoid array divide-by-zero warnings by not using where() function - # see the following GitHub issue for more details: - # https://github.com/PolicyEngine/policyengine-us/issues/2494 - income = np.zeros_like(count_eligible_children, dtype=float) - mask = count_eligible_children > 0 - income[mask] = net_parental_deemed_income[mask] / count_eligible_children[mask] - return income diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_parent/ssi_unearned_income_deemed_from_ineligible_parent_monthly.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_parent/ssi_unearned_income_deemed_from_ineligible_parent_monthly.py new file mode 100644 index 00000000000..e3b55b291f7 --- /dev/null +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_parent/ssi_unearned_income_deemed_from_ineligible_parent_monthly.py @@ -0,0 +1,24 @@ +from policyengine_us.variables.gov.ssa.ssi.eligibility.income._annual_input import ( + annual_input, +) +from policyengine_us.model_api import * +from policyengine_us.variables.gov.ssa.ssi.eligibility.income.deemed.from_ineligible_parent._ssi_parental_deemed_income import ( + ssi_parental_deemed_income, +) + + +class ssi_unearned_income_deemed_from_ineligible_parent_monthly(Variable): + value_type = float + entity = Person + label = "SSI unearned income (deemed from ineligible parent)" + unit = USD + definition_period = MONTH + reference = "https://www.law.cornell.edu/cfr/text/20/416.1165" + + def formula(person, period, parameters): + supplied = annual_input( + person, period, "ssi_unearned_income_deemed_from_ineligible_parent" + ) + if supplied is not None: + return supplied / MONTHS_IN_YEAR + return ssi_parental_deemed_income(person, period, parameters) diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/README.md b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/README.md index 50df6338ffd..ee73a5e4cbb 100644 --- a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/README.md +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/README.md @@ -19,11 +19,18 @@ The implementation follows these steps according to the regulations: - Deduct allocations for ineligible children from the ineligible spouse's income - Deductions are made from unearned income first, then earned income + - An ineligible child is the child of the claimant, the spouse, the claimant's parent or that parent's spouse, who lives in the claimant's household and is not eligible for SSI (§416.1160(d)), and who is a child under §416.1856: under 18, or a student under the deeming age limit (under 21 before June 16, 2008, under 22 afterward); unmarried even when a legal spouse lives elsewhere; not the head of a household + - `ssi_spousal_deeming_child_allocations` sums the allocations. Parent ids (`parent_1_id`, `parent_2_id`) decide whose child someone is. A claimant's sibling or half-sibling carries one of the claimant's own parent ids, wherever that parent lives; a step-sibling's id names the co-resident spouse of the claimant's co-resident parent. The spouse's siblings get no allocation, because §416.1160(d) counts the children of the claimant's parent, and [POMS SI 01310.140 A](https://secure.ssa.gov/poms.nsf/lnx/0501310140), which lists only the couple's children, yields to the regulation. Without ids, the co-resident members of the claimant's or the spouse's tax unit stand in, as the parent-link contract in `household/demographic/person/_parent_links.py` allows; that proxy cannot tell a grandchild from a child or find a sibling who files elsewhere + - No allocation is made for a child receiving public income-maintenance payments (`ssi_receives_public_income_maintenance`) + - Student earnings use the monthly student exclusion until its annual cap is exhausted. Each month retains its allocation through spouse-income deductions, the deeming threshold, income exclusions, floors and benefit caps; annual outputs sum the completed monthly calculations. Annual income inputs are spread evenly over the year + - Existing income and allocation variables retain their annual input and output basis, including when supplied in a monthly situation. Their `*_monthly` counterparts carry each month's budget through the calculation chain and honor supplied annual inputs. Annual eligibility screens read the annual variables directly, avoiding rounding from dividing supplied annual income and summing it again + - `is_ssi_spousal_deeming_applies` also retains its annual input basis; its calculated annual output remains the December status. Benefit calculations use `is_ssi_spousal_deeming_applies_monthly` for the current month's threshold + - Parent deeming and its Medicaid counterpart also restrict allocations to relevant co-resident children. SSI recipient division uses SSI immigration status; Medicaid uses its own immigration eligibility and excludes its recipients from the allocation pool 3. **Compare remaining income to FBR differential** (§416.1163(d)) - Compare the remaining income to the difference between couple and individual FBR - - If less than the differential, no income is deemed + - If no more than the differential, no income is deemed - If more than the differential, continue with deeming calculations 4. **Calculate combined countable income** (§416.1163(d)(2)) @@ -35,7 +42,7 @@ The implementation follows these steps according to the regulations: 5. **Calculate deemed income amount** - The deemed amount is the difference between the combined countable income and the individual's countable income - `ssi_income_deemed_from_ineligible_spouse_monthly` computes it each month, with the individual's ISM in both budgets, and `ssi_income_deemed_from_ineligible_spouse` sums the months - - `is_ssi_ineligible_parent` tests a parent's own income without ISM, so it reads a deemed amount without ISM (`_deemed_income_without_ism.py`) + - `is_ssi_ineligible_parent` tests a parent's own income without ISM, so it reads a deemed amount without ISM (`_deemed_income_without_ism.py`). That amount applies the annual formula to the year's remaining spouse income and takes the year's deeming comparison or a supplied flag 6. **Limit the benefit to the amount without deeming** (§416.1163(e)(2)) - We compare the couple computation with the individual Federal benefit rate less the individual's own countable income (`uncapped_ssi_without_spousal_deeming`) and apply the lesser amount in `uncapped_ssi` before the zero floor. @@ -71,7 +78,7 @@ These tests can be found in `ssi_income_deemed_from_ineligible_spouse.yaml` and ### Integration Tests -Integration tests verify the full SSI benefit calculation pipeline and can be found in the `integration.yaml` file. These tests check: +Integration tests verify the full SSI benefit calculation pipeline and can be found in the `integration_tests.yaml` file. These tests check: - The entire SSI benefit calculation for households with ineligible spouses - Interactions between spousal deeming and other components of the SSI program @@ -79,3 +86,5 @@ Integration tests verify the full SSI benefit calculation pipeline and can be fo - Households with various income combinations Integration tests are particularly important for SSI spousal deeming as they validate the correct application of the regulation's multi-step process in a full benefit calculation context. + +Monthly policy assertions and consumers must use the `*_monthly` variables. The existing annual public variables aggregate those monthly budgets; Core divides an annual variable by 12 when it is requested for a month, so that request is an annual average rather than the month’s budget. diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/_deemed_income_without_ism.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/_deemed_income_without_ism.py index b304a8ec387..3cbc5feb324 100644 --- a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/_deemed_income_without_ism.py +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/_deemed_income_without_ism.py @@ -7,6 +7,9 @@ from policyengine_us.variables.gov.ssa.ssi.eligibility.income._apply_ssi_exclusions import ( _apply_ssi_exclusions, ) +from policyengine_us.variables.gov.ssa.ssi.eligibility.income.deemed.from_ineligible_spouse._ssi_annual_spousal_deeming import ( + ssi_budget_spousal_deeming_applies, +) def ssi_income_deemed_from_ineligible_spouse_without_ism(person, period, parameters): @@ -25,7 +28,10 @@ def ssi_income_deemed_from_ineligible_spouse_without_ism(person, period, paramet if supplied is not None: return supplied - deeming_applies = person("is_ssi_spousal_deeming_applies", period) + # A year's is_ssi_spousal_deeming_applies holds December's status. This + # amount covers the year, so it takes the year's comparison or a supplied + # flag, as the benefit rate in is_ssi_ineligible_parent does. + deeming_applies = ssi_budget_spousal_deeming_applies(person, period, parameters) own_earned = person("ssi_earned_income", period) own_unearned = person("ssi_unearned_income", period) spouse_earned = person("ssi_earned_income_deemed_from_ineligible_spouse", period) diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/_ssi_annual_spousal_deeming.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/_ssi_annual_spousal_deeming.py new file mode 100644 index 00000000000..f4876b876fc --- /dev/null +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/_ssi_annual_spousal_deeming.py @@ -0,0 +1,42 @@ +"""Spousal-deeming comparisons for annual program budgets.""" + +from policyengine_us.model_api import * +from policyengine_us.variables.gov.ssa.ssi.eligibility.income._annual_input import ( + annual_input, +) + + +def ssi_annual_spousal_deeming_applies(person, period, parameters): + """Compare annual residual spouse income with the annual FBR difference.""" + spouse_income = add( + person, + period, + [ + "ssi_earned_income_deemed_from_ineligible_spouse", + "ssi_unearned_income_deemed_from_ineligible_spouse", + ], + ) + p = parameters(period).gov.ssa.ssi.amount + return person("is_ssi_aged_blind_disabled", period) & ( + spouse_income > (p.couple - p.individual) * MONTHS_IN_YEAR + ) + + +def supplied_annual_spousal_deeming_flag(person, period): + """Return a supplied annual flag as a boolean array, or None without one.""" + supplied = annual_input(person, period, "is_ssi_spousal_deeming_applies") + if supplied is None: + return None + # An abolished flag arrives as a scalar zero, and readers negate and + # index the flag, so give each of them an array. + return np.zeros(person.count, dtype=bool) | np.asarray(supplied, dtype=bool) + + +def ssi_budget_spousal_deeming_applies(person, period, parameters): + """Follow a program budget's period and preserve supplied annual flags.""" + if period.unit == MONTH: + return person("is_ssi_spousal_deeming_applies_monthly", period) + supplied = supplied_annual_spousal_deeming_flag(person, period) + if supplied is not None: + return supplied + return ssi_annual_spousal_deeming_applies(person, period, parameters) diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/is_ssi_spousal_deeming_applies.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/is_ssi_spousal_deeming_applies.py index f776fb1f332..62bf9c8368a 100644 --- a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/is_ssi_spousal_deeming_applies.py +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/is_ssi_spousal_deeming_applies.py @@ -24,21 +24,5 @@ class is_ssi_spousal_deeming_applies(Variable): """ def formula(person, period, parameters): - # NOTE: We do not model 416.1163(f)(5) (issue 10455). - # Get spouse's deemed income (after child allocations) - spouse_deemed_income = add( - person, - period, - [ - "ssi_earned_income_deemed_from_ineligible_spouse", - "ssi_unearned_income_deemed_from_ineligible_spouse", - ], - ) - - # Compare to FBR differential (couple rate - individual rate) - p = parameters(period).gov.ssa.ssi.amount - diff = (p.couple - p.individual) * MONTHS_IN_YEAR - - # Deeming applies when spouse's deemed income exceeds the differential - # Note: regulation says "not more than" means ≤, so we use > for deeming - return spouse_deemed_income > diff + # Preserve the annual status input and the monthly flag's year-end output. + return person("is_ssi_spousal_deeming_applies_monthly", period) diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/is_ssi_spousal_deeming_applies_monthly.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/is_ssi_spousal_deeming_applies_monthly.py new file mode 100644 index 00000000000..bc471003196 --- /dev/null +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/is_ssi_spousal_deeming_applies_monthly.py @@ -0,0 +1,52 @@ +from policyengine_us.variables.gov.ssa.ssi.eligibility.income._annual_input import ( + annual_input, +) +from policyengine_us.model_api import * + + +class is_ssi_spousal_deeming_applies_monthly(Variable): + value_type = bool + entity = Person + label = "SSI spousal deeming applies" + definition_period = MONTH + reference = "https://www.law.cornell.edu/cfr/text/20/416.1163" + documentation = """ + Returns True when spousal deeming applies according to 20 CFR §416.1163. + + Spousal deeming applies when: + 1. Person is aged, blind, or disabled (not part of an eligible couple). + SSI's noncitizen test is applied in is_ssi_eligible, so programs that + use SSI methodology also deem spouse income to noncitizens. + 2. Spouse is ineligible (not aged/blind/disabled) + 3. Spouse's leftover income (after child allocations) exceeds the difference + between couple FBR and individual FBR + + When deeming applies, the benefit calculation uses the couple FBR instead + of the individual FBR, recognizing that two people have higher expenses. + """ + + def formula(person, period, parameters): + supplied = annual_input(person, period, "is_ssi_spousal_deeming_applies") + if supplied is not None: + return supplied + + # NOTE: We do not model 416.1163(f)(5) (issue 10455). + # Get spouse's deemed income (after child allocations) + spouse_deemed_income = add( + person, + period, + [ + "ssi_earned_income_deemed_from_ineligible_spouse_monthly", + "ssi_unearned_income_deemed_from_ineligible_spouse_monthly", + ], + ) + + # Compare to FBR differential (couple rate - individual rate) + p = parameters(period).gov.ssa.ssi.amount + diff = p.couple - p.individual + + # Deeming applies when spouse's deemed income exceeds the differential + # Note: regulation says "not more than" means ≤, so we use > for deeming + return person("is_ssi_aged_blind_disabled", period) & ( + spouse_deemed_income > diff + ) diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_earned_income_deemed_from_ineligible_spouse.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_earned_income_deemed_from_ineligible_spouse.py index 3dc7de68f08..7375d4eabcd 100644 --- a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_earned_income_deemed_from_ineligible_spouse.py +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_earned_income_deemed_from_ineligible_spouse.py @@ -1,7 +1,4 @@ from policyengine_us.model_api import * -from policyengine_us.variables.gov.ssa.ssi.eligibility.resources.deemed._ssi_spouses import ( - _ssi_spouse_index, -) class ssi_earned_income_deemed_from_ineligible_spouse(Variable): @@ -13,30 +10,5 @@ class ssi_earned_income_deemed_from_ineligible_spouse(Variable): reference = "https://www.law.cornell.edu/cfr/text/20/416.1163" def formula(person, period, parameters): - # First, determine unearned income from the ineligible spouse. - # This is (a) in the law. The spouse is the co-resident husband or - # wife (416.1160(d)), whatever their tax-unit role. - spouse = _ssi_spouse_index(person, period) - safe_spouse = np.maximum(spouse, 0) - has_ineligible_spouse = (spouse >= 0) & person( - "is_ssi_ineligible_spouse", period - )[safe_spouse] - unearned_income = person("ssi_unearned_income", period) - ineligible_spousal_unearned_income = where( - has_ineligible_spouse, unearned_income[safe_spouse], 0 - ) - earned_income = person("ssi_earned_income", period) - ineligible_spousal_earned_income = where( - has_ineligible_spouse, earned_income[safe_spouse], 0 - ) - - # Next, (b) determine and subtract allocations for ineligible children. - child_allocations = add( - person.tax_unit, period, ["ssi_ineligible_child_allocation"] - ) * person("is_ssi_aged_blind_disabled", period) - # Child allocations are deducted from unearned income first - ensure we only deduct - # the remaining allocations from earned income. - remaining_child_allocations = max_( - 0, child_allocations - ineligible_spousal_unearned_income - ) - return max_(0, ineligible_spousal_earned_income - remaining_child_allocations) + # Sum completed monthly budgets; supplied amounts retain their annual basis. + return person("ssi_earned_income_deemed_from_ineligible_spouse_monthly", period) diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_earned_income_deemed_from_ineligible_spouse_monthly.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_earned_income_deemed_from_ineligible_spouse_monthly.py new file mode 100644 index 00000000000..ba5b3d1a16e --- /dev/null +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_earned_income_deemed_from_ineligible_spouse_monthly.py @@ -0,0 +1,48 @@ +from policyengine_us.variables.gov.ssa.ssi.eligibility.income._annual_input import ( + annual_input, +) +from policyengine_us.model_api import * +from policyengine_us.variables.gov.ssa.ssi.eligibility.resources.deemed._ssi_spouses import ( + _ssi_spouse_index, +) + + +class ssi_earned_income_deemed_from_ineligible_spouse_monthly(Variable): + value_type = float + entity = Person + label = "SSI earned income (deemed from ineligible spouse)" + unit = USD + definition_period = MONTH + reference = "https://www.law.cornell.edu/cfr/text/20/416.1163" + + def formula(person, period, parameters): + supplied = annual_input( + person, period, "ssi_earned_income_deemed_from_ineligible_spouse" + ) + if supplied is not None: + return supplied / MONTHS_IN_YEAR + + # First, determine unearned income from the ineligible spouse. + # This is (a) in the law. + spouse = _ssi_spouse_index(person, period) + safe_spouse = np.maximum(spouse, 0) + has_ineligible_spouse = (spouse >= 0) & person( + "is_ssi_ineligible_spouse", period + )[safe_spouse] + unearned_income = person("ssi_unearned_income", period) + ineligible_spousal_unearned_income = where( + has_ineligible_spouse, unearned_income[safe_spouse], 0 + ) + earned_income = person("ssi_earned_income", period) + ineligible_spousal_earned_income = where( + has_ineligible_spouse, earned_income[safe_spouse], 0 + ) + + # Next, (b) determine and subtract allocations for ineligible children. + child_allocations = person("ssi_spousal_deeming_child_allocations", period) + # Child allocations are deducted from unearned income first - ensure we only deduct + # the remaining allocations from earned income. + remaining_child_allocations = max_( + 0, child_allocations - ineligible_spousal_unearned_income + ) + return max_(0, ineligible_spousal_earned_income - remaining_child_allocations) diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_income_deemed_from_ineligible_spouse_monthly.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_income_deemed_from_ineligible_spouse_monthly.py index 60cf5f0b7dd..f5cb729e112 100644 --- a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_income_deemed_from_ineligible_spouse_monthly.py +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_income_deemed_from_ineligible_spouse_monthly.py @@ -32,19 +32,21 @@ def formula(person, period, parameters): if supplied is not None: return supplied / MONTHS_IN_YEAR - deeming_applies = person("is_ssi_spousal_deeming_applies", period.this_year) + # Each month takes its own deeming status and the spouse's income + # that remains after that month's allocations for ineligible children. + deeming_applies = person("is_ssi_spousal_deeming_applies_monthly", period) spouse_earned = person( - "ssi_earned_income_deemed_from_ineligible_spouse", period + "ssi_earned_income_deemed_from_ineligible_spouse_monthly", period ) spouse_unearned = person( - "ssi_unearned_income_deemed_from_ineligible_spouse", period + "ssi_unearned_income_deemed_from_ineligible_spouse_monthly", period ) individual_earned = person("ssi_earned_income", period) # SSA counts claimant ISM in combined unearned income under # SI 01320.150 B.1.a. Include it in both budgets so their difference # adds no second general exclusion when ssi_countable_income counts ISM. individual_unearned = person("ssi_unearned_income", period) + person( - "ssi_in_kind_support_and_maintenance", period + "ssi_in_kind_support_and_maintenance_monthly", period ) alone_countable = _apply_ssi_exclusions_monthly( individual_earned, individual_unearned, parameters, period diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_spousal_deeming_child_allocations.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_spousal_deeming_child_allocations.py new file mode 100644 index 00000000000..c6967df93df --- /dev/null +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_spousal_deeming_child_allocations.py @@ -0,0 +1,120 @@ +from policyengine_us.model_api import * +from policyengine_us.variables.gov.ssa.ssi.eligibility.resources.deemed._ssi_spouses import ( + _ssi_established_spouse_indices, +) +from policyengine_us.variables.household.demographic.person._parent_links import ( + co_resident_parent_indices, + has_parent_ids, + household_has_parent_ids, + household_member_indices, + unlinked_parent, +) + + +class ssi_spousal_deeming_child_allocations(Variable): + value_type = float + entity = Person + label = "SSI ineligible child allocations from an ineligible spouse's income" + documentation = ( + "The sum of the ineligible child allocations deducted from the " + "income of this person's ineligible spouse before it is deemed: one " + "for each ineligible child who lives in their household and is the " + "child of this person, of their spouse, of this person's parent or " + "of that parent's spouse (416.1160(d)). A child whose parent ids are " + "set counts when an id names this person or their co-resident " + "spouse. For a person with a co-resident spouse, such a child also " + "counts when one of the child's ids equals one of this person's own " + "parent ids (a sibling or half-sibling, wherever that parent lives), " + "or names the co-resident spouse of this person's co-resident parent " + "(a step-sibling). An id for a parent outside the simulation must " + "name that parent alone, and each of that parent's children must " + "carry it. A child without ids counts when they belong to the tax " + "unit of this person or of their spouse; in a household with parent " + "links, only when this person or their spouse is a parent some of " + "whose children no id names. Without ids, a grandchild or other " + "relative in that tax unit cannot be told apart from a child, and a " + "sibling in another tax unit cannot be found, so supply parent ids. " + "Enter a child who is only temporarily absent, such as a child away " + "at school who is still under parental control, in the household " + "they remain a member of (416.1167, POMS SI 01310.165)." + ) + unit = USD + definition_period = MONTH + reference = ( + "https://www.ecfr.gov/current/title-20/section-416.1163#p-416.1163(b)", + "https://www.ecfr.gov/current/title-20/section-416.1160#p-416.1160(d)", + "https://www.ecfr.gov/current/title-20/section-416.1160#p-416.1160(c)(2)", + "https://www.ecfr.gov/current/title-20/section-416.1101", + "https://www.ecfr.gov/current/title-20/section-416.1132#p-416.1132(a)", + "https://secure.ssa.gov/poms.nsf/lnx/0501310115", + "https://secure.ssa.gov/poms.nsf/lnx/0501310140", + ) + + def formula(person, period, parameters): + allocation = person("ssi_ineligible_child_allocation_monthly", period) + # In 416.1160(d), SSA defines an ineligible child as a co-resident + # child, not eligible for SSI, of you, of your spouse, or 'of your + # parent or of your parent's spouse'. SSA applies that one definition + # to spouse deemors (416.1160(c)(2), 416.1163(b)); 'you' is the + # claimant (416.1101) and a household is a place of residence + # (416.1132(a)). So the claimant's co-resident siblings, half-siblings + # and step-siblings count, and the spouse's siblings do not. POMS + # SI 01310.140 A lists only the couple's children; this formula + # follows the regulation. Parent ids resolve among household members, + # so a child who lives elsewhere names no co-resident parent. + first, second = co_resident_parent_indices(person, period) + spouse = _ssi_established_spouse_indices(person, period, first, second) + has_spouse = spouse >= 0 + safe_spouse = np.maximum(spouse, 0) + own_index = np.arange(person.count) + # A sibling carries one of this person's own parent ids, wherever + # that parent lives. A step-sibling's id names the co-resident spouse + # of this person's co-resident parent. + parent_1 = person("parent_1_id", period) + parent_2 = person("parent_2_id", period) + parent_spouses = [ + np.where(slot >= 0, spouse[np.maximum(slot, 0)], -1) + for slot in (first, second) + ] + # Without ids, keep the tax-unit grouping, extended to a spouse who + # files separately. In a household with links, the parent-link + # contract lets this proxy assign a child only to unlinked parents. + tax_unit = person.tax_unit.reference_entity.members_entity_id + spouse_tax_unit = np.where(has_spouse, tax_unit[safe_spouse], -1) + unlinked = unlinked_parent(person, period) + may_presume = ~household_has_parent_ids(person, period) | ( + unlinked | (has_spouse & unlinked[safe_spouse]) + ) + linked_child = has_parent_ids(person, period) + total = np.zeros(person.count) + for child in household_member_indices(person): + safe = np.maximum(child, 0) + named = (first[safe] == own_index) | (second[safe] == own_index) + named_spouse = has_spouse & ( + (first[safe] == spouse) | (second[safe] == spouse) + ) + shares_parent = np.zeros(person.count, dtype=bool) + for child_id in (parent_1[safe], parent_2[safe]): + shares_parent |= (child_id != 0) & ( + (child_id == parent_1) | (child_id == parent_2) + ) + names_parent_spouse = np.zeros(person.count, dtype=bool) + for child_parent in (first[safe], second[safe]): + for parent_spouse in parent_spouses: + names_parent_spouse |= (child_parent >= 0) & ( + child_parent == parent_spouse + ) + # Only a person with a co-resident spouse has income deemed, so + # only that person's total takes their siblings. + sibling = has_spouse & (shares_parent | names_parent_spouse) + presumed = may_presume & ( + (tax_unit[safe] == tax_unit) | (tax_unit[safe] == spouse_tax_unit) + ) + counts = ( + (child >= 0) + & (child != own_index) + & (child != spouse) + & where(linked_child[safe], named | named_spouse | sibling, presumed) + ) + total += where(counts, allocation[safe], 0) + return total diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_unearned_income_deemed_from_ineligible_spouse.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_unearned_income_deemed_from_ineligible_spouse.py index 536866b9aaf..8134c2ed6cc 100644 --- a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_unearned_income_deemed_from_ineligible_spouse.py +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_unearned_income_deemed_from_ineligible_spouse.py @@ -1,7 +1,4 @@ from policyengine_us.model_api import * -from policyengine_us.variables.gov.ssa.ssi.eligibility.resources.deemed._ssi_spouses import ( - _ssi_spouse_index, -) class ssi_unearned_income_deemed_from_ineligible_spouse(Variable): @@ -16,21 +13,7 @@ class ssi_unearned_income_deemed_from_ineligible_spouse(Variable): reference = "https://www.law.cornell.edu/cfr/text/20/416.1163" def formula(person, period, parameters): - # First, determine unearned income from the ineligible spouse. - # This is (a) in the law. The spouse is the co-resident husband or - # wife (416.1160(d)), whatever their tax-unit role. - spouse = _ssi_spouse_index(person, period) - safe_spouse = np.maximum(spouse, 0) - has_ineligible_spouse = (spouse >= 0) & person( - "is_ssi_ineligible_spouse", period - )[safe_spouse] - unearned_income = person("ssi_unearned_income", period) - ineligible_spousal_unearned_income = where( - has_ineligible_spouse, unearned_income[safe_spouse], 0 + # Sum completed monthly budgets; supplied amounts retain their annual basis. + return person( + "ssi_unearned_income_deemed_from_ineligible_spouse_monthly", period ) - - # Next, (b) determine and subtract allocations for ineligible children. - child_allocations = add( - person.tax_unit, period, ["ssi_ineligible_child_allocation"] - ) - return max_(0, ineligible_spousal_unearned_income - child_allocations) diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_unearned_income_deemed_from_ineligible_spouse_monthly.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_unearned_income_deemed_from_ineligible_spouse_monthly.py new file mode 100644 index 00000000000..5c0511c8c09 --- /dev/null +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_unearned_income_deemed_from_ineligible_spouse_monthly.py @@ -0,0 +1,42 @@ +from policyengine_us.variables.gov.ssa.ssi.eligibility.income._annual_input import ( + annual_input, +) +from policyengine_us.model_api import * +from policyengine_us.variables.gov.ssa.ssi.eligibility.resources.deemed._ssi_spouses import ( + _ssi_spouse_index, +) + + +class ssi_unearned_income_deemed_from_ineligible_spouse_monthly(Variable): + value_type = float + entity = Person + label = "SSI unearned income (deemed from ineligible spouse)" + documentation = ( + "This is ignored if total income is under the SSI individual allowance." + ) + unit = USD + definition_period = MONTH + reference = "https://www.law.cornell.edu/cfr/text/20/416.1163" + + def formula(person, period, parameters): + supplied = annual_input( + person, period, "ssi_unearned_income_deemed_from_ineligible_spouse" + ) + if supplied is not None: + return supplied / MONTHS_IN_YEAR + + # First, determine unearned income from the ineligible spouse. + # This is (a) in the law. + spouse = _ssi_spouse_index(person, period) + safe_spouse = np.maximum(spouse, 0) + has_ineligible_spouse = (spouse >= 0) & person( + "is_ssi_ineligible_spouse", period + )[safe_spouse] + unearned_income = person("ssi_unearned_income", period) + ineligible_spousal_unearned_income = where( + has_ineligible_spouse, unearned_income[safe_spouse], 0 + ) + + # Next, (b) determine and subtract allocations for ineligible children. + child_allocations = person("ssi_spousal_deeming_child_allocations", period) + return max_(0, ineligible_spousal_unearned_income - child_allocations) diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/ssi_ineligible_child_allocation.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/ssi_ineligible_child_allocation.py index 36aeedef7e9..7e3b6104210 100644 --- a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/ssi_ineligible_child_allocation.py +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/ssi_ineligible_child_allocation.py @@ -6,16 +6,19 @@ class ssi_ineligible_child_allocation(Variable): entity = Person label = "SSI ineligible child allocation" unit = USD - documentation = "The amount of income that SSI deems ought to be spent on this child, and therefore is not deemed to SSI claimants." + documentation = ( + "The allocation SSI deducts for this child from an ineligible " + "spouse's or parent's income before deeming it. Which claimants it " + "applies to is decided where the allocations are summed." + ) definition_period = YEAR - reference = "https://www.law.cornell.edu/cfr/text/20/416.1163" + reference = ( + "https://www.ecfr.gov/current/title-20/section-416.1163#p-416.1163(b)", + "https://www.ecfr.gov/current/title-20/section-416.1161#p-416.1161(c)", + "https://www.ecfr.gov/current/title-20/section-416.1165#p-416.1165(b)", + "https://secure.ssa.gov/poms.nsf/lnx/0501320185", + ) def formula(person, period, parameters): - income = add(person, period, ["ssi_earned_income", "ssi_unearned_income"]) - ssi = parameters(period).gov.ssa.ssi.amount - allocation = ( - person("is_ssi_ineligible_child", period) - * (ssi.couple - ssi.individual) - * MONTHS_IN_YEAR - ) - return max_(0, allocation - income) + # Sum completed monthly budgets; supplied amounts retain their annual basis. + return person("ssi_ineligible_child_allocation_monthly", period) diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/ssi_ineligible_child_allocation_monthly.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/ssi_ineligible_child_allocation_monthly.py new file mode 100644 index 00000000000..79b218e219d --- /dev/null +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/ssi_ineligible_child_allocation_monthly.py @@ -0,0 +1,59 @@ +from policyengine_us.variables.gov.ssa.ssi.eligibility.income._annual_input import ( + annual_input, +) +from policyengine_us.model_api import * + + +class ssi_ineligible_child_allocation_monthly(Variable): + value_type = float + entity = Person + label = "SSI ineligible child allocation" + unit = USD + documentation = ( + "The allocation SSI deducts for this child from an ineligible " + "spouse's or parent's income before deeming it. Which claimants it " + "applies to is decided where the allocations are summed." + ) + definition_period = MONTH + reference = ( + "https://www.ecfr.gov/current/title-20/section-416.1163#p-416.1163(b)", + "https://www.ecfr.gov/current/title-20/section-416.1161#p-416.1161(c)", + "https://www.ecfr.gov/current/title-20/section-416.1165#p-416.1165(b)", + "https://secure.ssa.gov/poms.nsf/lnx/0501320185", + ) + + def formula(person, period, parameters): + supplied = annual_input(person, period, "ssi_ineligible_child_allocation") + if supplied is not None: + return supplied / MONTHS_IN_YEAR + + p = parameters(period).gov.ssa.ssi + # 416.1163(b): 'We do not allocate for ineligible children who are + # receiving public income-maintenance payments.' + allocated = person("is_ssi_ineligible_child", period) & ~person( + "ssi_receives_public_income_maintenance", period + ) + # 416.1163(b)(1): the couple rate less the individual rate, a month. + monthly_allocation = p.amount.couple - p.amount.individual + # 416.1163(b)(2) reduces it by the child's income as described in + # 416.1161(c), which excludes a student's earned income up to the + # amounts in 416.1112(c)(3), whether or not the child is blind or + # disabled (POMS SI 01320.185). No $20 or $65 exclusion applies. + student = p.income.exclusions.blind_or_disabled_working_student + is_student = person("is_full_time_student", period) & ( + person("age", period.this_year) < student.age_limit + ) + # Annual income is spread evenly over the year. Keep each month's + # allocation through downstream deductions, exclusions and benefit + # caps; annual reads sum the completed monthly budgets. + earned = max_(0, person("ssi_earned_income", period)) + unearned = max_(0, person("ssi_unearned_income", period)) + # The student exclusion is used consecutively from January until + # its annual cap is exhausted (POMS SI 00820.510). Annual income + # inputs imply the same monthly earnings in the preceding months. + monthly_exclusion = min_(student.amount, earned) + used = monthly_exclusion * (period.start.month - 1) + exclusion_left = max_(0, student.cap - used) + exclusion = where(is_student, min_(monthly_exclusion, exclusion_left), 0) + income = earned - exclusion + unearned + return allocated * max_(0, monthly_allocation - income) diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/ism/ssi_in_kind_support_and_maintenance.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/ism/ssi_in_kind_support_and_maintenance.py index 1db6a7b28aa..6d7e1efd0d5 100644 --- a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/ism/ssi_in_kind_support_and_maintenance.py +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/ism/ssi_in_kind_support_and_maintenance.py @@ -6,24 +6,12 @@ class ssi_in_kind_support_and_maintenance(Variable): entity = Person label = "SSI in-kind support and maintenance" unit = USD - definition_period = MONTH + definition_period = YEAR reference = ( "https://www.law.cornell.edu/cfr/text/20/416.1130", "https://www.law.cornell.edu/cfr/text/20/416.1140", ) def formula(person, period, parameters): - # Own-household recipients count shelter support as unearned income. - # Under 416.420(a), ssi_pmv_applies dates food to the income month. - # The PMV rule caps ISM at the presumed maximum value. - # If the recipient provides an actual shelter value (rebuttal), - # ISM is the lesser of the actual value and the PMV. - # Another person's household: VTR FBR adjustment, not here. - # Child in parental household: deeming replaces ISM. - # Medical treatment facility: ISM not countable ($30 rate). - pmv_applies = person("ssi_pmv_applies", period) - pmv_amount = person("ssi_pmv_amount", period) - actual_value = person("ssi_shelter_support_value", period) - has_actual = actual_value > 0 - ism_value = where(has_actual, min_(pmv_amount, actual_value), pmv_amount) - return pmv_applies * ism_value + # Sum completed monthly budgets; supplied amounts retain their annual basis. + return person("ssi_in_kind_support_and_maintenance_monthly", period) diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/ism/ssi_in_kind_support_and_maintenance_monthly.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/ism/ssi_in_kind_support_and_maintenance_monthly.py new file mode 100644 index 00000000000..24ceab5a91f --- /dev/null +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/ism/ssi_in_kind_support_and_maintenance_monthly.py @@ -0,0 +1,36 @@ +from policyengine_us.variables.gov.ssa.ssi.eligibility.income._annual_input import ( + annual_input, +) +from policyengine_us.model_api import * + + +class ssi_in_kind_support_and_maintenance_monthly(Variable): + value_type = float + entity = Person + label = "SSI in-kind support and maintenance" + unit = USD + definition_period = MONTH + reference = ( + "https://www.law.cornell.edu/cfr/text/20/416.1130", + "https://www.law.cornell.edu/cfr/text/20/416.1140", + ) + + def formula(person, period, parameters): + supplied = annual_input(person, period, "ssi_in_kind_support_and_maintenance") + if supplied is not None: + return supplied / MONTHS_IN_YEAR + + # Own-household recipients count shelter support as unearned income. + # Under 416.420(a), ssi_pmv_applies dates food to the income month. + # The PMV rule caps ISM at the presumed maximum value. + # If the recipient provides an actual shelter value (rebuttal), + # ISM is the lesser of the actual value and the PMV. + # Another person's household: VTR FBR adjustment, not here. + # Child in parental household: deeming replaces ISM. + # Medical treatment facility: ISM not countable ($30 rate). + pmv_applies = person("ssi_pmv_applies", period) + pmv_amount = person("ssi_pmv_amount_monthly", period) + actual_value = person("ssi_shelter_support_value", period) + has_actual = actual_value > 0 + ism_value = where(has_actual, min_(pmv_amount, actual_value), pmv_amount) + return pmv_applies * ism_value diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/ism/ssi_pmv_amount.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/ism/ssi_pmv_amount.py index 101b7aa6b11..1064779b8e4 100644 --- a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/ism/ssi_pmv_amount.py +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/ism/ssi_pmv_amount.py @@ -6,7 +6,7 @@ class ssi_pmv_amount(Variable): entity = Person label = "SSI presumed maximum value amount" unit = USD - definition_period = MONTH + definition_period = YEAR reference = ( "https://www.law.cornell.edu/cfr/text/20/416.1140", "https://secure.ssa.gov/poms.nsf/lnx/0500835300", @@ -14,24 +14,5 @@ class ssi_pmv_amount(Variable): ) def formula(person, period, parameters): - p = parameters(period).gov.ssa.ssi - couple_computation = person("ssi_couple_computation_applies", period) - deeming_applies = person("is_ssi_spousal_deeming_applies", period) - - # Per POMS SI 00835.300 and SI 00835.901: - # Individual / joint couple: PMV = 1/3 × FBR + $20 - # Joint couple PMV is unit-level; the /2 in ssi_countable_income - # splits it per-person. - # - # Per POMS SI 01320.150: when spousal deeming applies, the PMV - # is halved to 1/6 × couple FBR + $10, because the deeming path - # in ssi_countable_income does NOT do a /2 split. - applicable_fbr = where( - couple_computation | deeming_applies, - p.amount.couple, - p.amount.individual, - ) - pmv_monthly = ( - applicable_fbr * p.income.ism.pmv_fbr_fraction + p.income.exclusions.general - ) - return where(deeming_applies, pmv_monthly / 2, pmv_monthly) + # Sum completed monthly budgets; supplied amounts retain their annual basis. + return person("ssi_pmv_amount_monthly", period) diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/ism/ssi_pmv_amount_monthly.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/ism/ssi_pmv_amount_monthly.py new file mode 100644 index 00000000000..252e128f236 --- /dev/null +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/ism/ssi_pmv_amount_monthly.py @@ -0,0 +1,44 @@ +from policyengine_us.variables.gov.ssa.ssi.eligibility.income._annual_input import ( + annual_input, +) +from policyengine_us.model_api import * + + +class ssi_pmv_amount_monthly(Variable): + value_type = float + entity = Person + label = "SSI presumed maximum value amount" + unit = USD + definition_period = MONTH + reference = ( + "https://www.law.cornell.edu/cfr/text/20/416.1140", + "https://secure.ssa.gov/poms.nsf/lnx/0500835300", + "https://secure.ssa.gov/poms.nsf/lnx/0501320150", + ) + + def formula(person, period, parameters): + supplied = annual_input(person, period, "ssi_pmv_amount") + if supplied is not None: + return supplied / MONTHS_IN_YEAR + + p = parameters(period).gov.ssa.ssi + couple_computation = person("ssi_couple_computation_applies", period) + deeming_applies = person("is_ssi_spousal_deeming_applies_monthly", period) + + # Per POMS SI 00835.300 and SI 00835.901: + # Individual / joint couple: PMV = 1/3 × FBR + $20 + # Joint couple PMV is unit-level; the /2 in ssi_countable_income + # splits it per-person. + # + # Per POMS SI 01320.150: when spousal deeming applies, the PMV + # is halved to 1/6 × couple FBR + $10, because the deeming path + # in ssi_countable_income does NOT do a /2 split. + applicable_fbr = where( + couple_computation | deeming_applies, + p.amount.couple, + p.amount.individual, + ) + pmv_monthly = ( + applicable_fbr * p.income.ism.pmv_fbr_fraction + p.income.exclusions.general + ) + return where(deeming_applies, pmv_monthly / 2, pmv_monthly) diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/ssi_countable_income.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/ssi_countable_income.py index b97ef9062c7..c1910b94df8 100644 --- a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/ssi_countable_income.py +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/ssi_countable_income.py @@ -1,7 +1,4 @@ from policyengine_us.model_api import * -from policyengine_us.variables.gov.ssa.ssi.eligibility.income._apply_ssi_exclusions import ( - _apply_ssi_exclusions_monthly, -) class ssi_countable_income(Variable): @@ -9,7 +6,7 @@ class ssi_countable_income(Variable): entity = Person label = "SSI countable income" unit = USD - definition_period = MONTH + definition_period = YEAR reference = "https://www.law.cornell.edu/uscode/text/42/1382a#b" documentation = """ Calculates total countable income for SSI: @@ -23,75 +20,8 @@ class ssi_countable_income(Variable): ISM is added to unearned income BEFORE exclusions per 20 CFR § 416.1140. The PMV formula includes $20 so that after the general exclusion applies, the net countable ISM equals 1/3 FBR (matching POMS SI 00835.901 values). - - Countable income is computed for each month, so a change in ISM within a - year (such as food ceasing to count on September 30, 2024) reaches the - months it applies to. Annual queries sum the months. """ def formula(person, period, parameters): - # YEAR-defined income amounts read for a month are one-twelfth of the - # annual amount; ISM is MONTH-defined and read for the month itself. - # The individual's earned income, after the blind/disabled student exclusion - pre_reduction_earned_income = person("ssi_marital_earned_income", period) - blind_disabled_working_student_income = person( - "ssi_blind_or_disabled_working_student_exclusion", period - ) - earned_income = max_( - pre_reduction_earned_income - blind_disabled_working_student_income, - 0, - ) - - # The individual's unearned + any unearned deemed from a parent - # When both spouses are SSI eligible, ssi_marital_unearned_income and ssi_marital_earned_income - # will already have attributed the combined earned/unearned income to each person in the - # marital unit, so we don't need additional head/spouse checks here. - # This occurs via the both_eligible check in those variables. - unearned_income = person("ssi_marital_unearned_income", period) - parent_deemed = person( - "ssi_unearned_income_deemed_from_ineligible_parent", period - ) - - # ISM (PMV for own-household recipients receiving shelter support) is - # counted as unearned income per 20 CFR § 416.1140. It enters - # the unearned pool BEFORE exclusions so the $20 general exclusion - # naturally applies. POMS SI 00835.901 confirms that the net - # countable ISM is 1/3 FBR (PMV minus $20 general exclusion). - ism = person("ssi_in_kind_support_and_maintenance", period) - - total_unearned = unearned_income + parent_deemed + ism - - # Apply standard SSI exclusions to the individual's own income - personal_countable = _apply_ssi_exclusions_monthly( - earned_income, - total_unearned, - parameters, - period, - ) - - # Check if couple computation applies (both eligible AND not - # separated by a medical facility per 20 CFR 416.414(b)(3)) - both_eligible = person("ssi_couple_computation_applies", period) - - # Add spousal deemed income (only relevant when one spouse is ineligible) - spousal_deemed = person( - "ssi_income_deemed_from_ineligible_spouse_monthly", period - ) - - # People who are not aged, blind, or disabled have no countable income - # of their own; a spouse's income is deemed to the other spouse - # instead. SSI's noncitizen test is applied in is_ssi_eligible, so it - # does not zero the income that Medicaid and state programs count - # with SSI methodology. - is_aged_blind_disabled = person("is_ssi_aged_blind_disabled", period) - - # Calculate final countable income - return where( - ~is_aged_blind_disabled, - 0, - where( - both_eligible, - personal_countable / 2, - personal_countable + spousal_deemed, - ), - ) + # Sum completed monthly budgets; supplied amounts retain their annual basis. + return person("ssi_countable_income_monthly", period) diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/income/ssi_countable_income_monthly.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/ssi_countable_income_monthly.py new file mode 100644 index 00000000000..5095f4bd87c --- /dev/null +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/income/ssi_countable_income_monthly.py @@ -0,0 +1,36 @@ +from policyengine_us.variables.gov.ssa.ssi.eligibility.income._annual_input import ( + annual_input, +) +from policyengine_us.model_api import * +from policyengine_us.variables.gov.ssa.ssi.eligibility.income._ssi_countable_income import ( + ssi_countable_income, +) + + +class ssi_countable_income_monthly(Variable): + value_type = float + entity = Person + label = "SSI countable income" + unit = USD + definition_period = MONTH + reference = "https://www.law.cornell.edu/uscode/text/42/1382a#b" + documentation = """ + Calculates total countable income for SSI: + - Earned (after ignoring blind/disabled student exclusion) + - Unearned + - Parental deemed if child + - Spousal deemed if married to an ineligible spouse + - In-kind support and maintenance (ISM) via the PMV rule for Status A + - Applies standard SSI exclusions ($20 general, $65 earned, 50% earned). + + ISM is added to unearned income BEFORE exclusions per 20 CFR § 416.1140. + The PMV formula includes $20 so that after the general exclusion applies, + the net countable ISM equals 1/3 FBR (matching POMS SI 00835.901 values). + """ + + def formula(person, period, parameters): + supplied = annual_input(person, period, "ssi_countable_income") + if supplied is not None: + return supplied / MONTHS_IN_YEAR + + return ssi_countable_income(person, period, parameters) diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/resources/deemed/_ssi_spouses.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/resources/deemed/_ssi_spouses.py index 2ebc57e3be2..8fa93d15cb5 100644 --- a/policyengine_us/variables/gov/ssa/ssi/eligibility/resources/deemed/_ssi_spouses.py +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/resources/deemed/_ssi_spouses.py @@ -1,6 +1,9 @@ from policyengine_us.model_api import * from policyengine_us.variables.household.demographic.person._parent_links import ( + _parent_indices, co_resident_parent_indices, + group_member_indices, + tax_unit_parent_indices, ) @@ -8,8 +11,9 @@ def _ssi_established_spouse_indices(person, period, first, second): """Rows of each person's co-resident spouse, or -1. SSI resource deeming uses this one test for a claimant's spouse - (416.1202(a)), a parent's spouse (416.1202(b)) and whether a child is - married (416.1856). A marital unit holds an unmarried person or a married, + (416.1202(a)) and a parent's spouse (416.1202(b)). Marriage + classification uses _ssi_is_married, including spouses living apart. + A marital unit holds an unmarried person or a married, cohabiting couple, so the members of a two-person marital unit who live in the same household are spouses. So are the head and spouse of one tax unit who share a marital unit, which covers situations that omit marital @@ -147,3 +151,56 @@ def _ssi_couple_budget_total(person, period, values): return _ssi_couple_total(person, period, values) + person.tax_unit.sum( where(dependent, values, 0) ) + + +def _ssi_is_married(person, period): + """Marriage classification without a co-residence requirement. + + Legal spouses can live apart (416.1806(a)(1)). A two-person marital + unit establishes marriage, as does a tax unit's head/spouse pair, even + when they have separate marital units. Apply the spouse lookup's + parent-link and default-marital-unit safeguards to both sources; + ambiguous candidates do not establish marriage. + """ + period = period.this_year + head_or_spouse = person("is_tax_unit_head_or_spouse", period) + dependent = person("is_tax_unit_dependent", period) + joint = head_or_spouse & person.tax_unit("tax_unit_married", period) + tax_unit = person.tax_unit.reference_entity.members_entity_id + couple = person.marital_unit.nb_persons() == 2 + possible_default = person.marital_unit.count == 1 + own_index = np.arange(person.count) + married = np.zeros(person.count, dtype=bool) + + for group, marital_couple in ( + (person.marital_unit, True), + (person.tax_unit, False), + ): + first, second = ( + _parent_indices(person, period, group) + if marital_couple + else tax_unit_parent_indices(person, period) + ) + candidates = np.zeros(person.count, dtype=int) + for member in group_member_indices(group): + safe = np.maximum(member, 0) + same_tax_unit = tax_unit[safe] == tax_unit + names_applicant = (first[safe] == own_index) | (second[safe] == own_index) + named_by_applicant = (first == member) | (second == member) + claims = possible_default & same_tax_unit & (dependent != dependent[safe]) + established = ( + couple + if marital_couple + else joint & head_or_spouse[safe] & same_tax_unit + ) + shown = ( + (member >= 0) + & (member != own_index) + & established + & ~claims + & ~names_applicant + & ~named_by_applicant + ) + candidates += shown + married |= candidates == 1 + return married diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/resources/deemed/ssi_resources_deemed_from_ineligible_parent.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/resources/deemed/ssi_resources_deemed_from_ineligible_parent.py index 375e65927f5..a1c99d3c6ae 100644 --- a/policyengine_us/variables/gov/ssa/ssi/eligibility/resources/deemed/ssi_resources_deemed_from_ineligible_parent.py +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/resources/deemed/ssi_resources_deemed_from_ineligible_parent.py @@ -133,7 +133,7 @@ def formula(person, period, parameters): # the payment is ineligible 'for any reason': they are still deemed a # share, but do not count in the division. Neither variable reads the # resource test. - income_eligible = person("ssi_countable_income", period) < person( + income_eligible = person("ssi_countable_income_monthly", period) < person( "ssi_amount_if_eligible", period ) deemed = np.zeros(person.count) diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/status/_ssi_parent_supplement.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/status/_ssi_parent_supplement.py index 3ba94803831..60e4ee18e40 100644 --- a/policyengine_us/variables/gov/ssa/ssi/eligibility/status/_ssi_parent_supplement.py +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/status/_ssi_parent_supplement.py @@ -1,4 +1,7 @@ from policyengine_us.model_api import * +from policyengine_us.variables.gov.ssa.ssi.eligibility.income.deemed.from_ineligible_spouse._ssi_annual_spousal_deeming import ( + ssi_budget_spousal_deeming_applies, +) from policyengine_us.variables.gov.ssa.ssi.eligibility.resources.deemed._ssi_spouses import ( _ssi_couple_total, ) @@ -112,7 +115,8 @@ def _ssi_parent_supplement_level(person, period, parameters): """ individual, couple = _ssi_parent_supplement_rates(person, period, parameters) joint = person("ssi_claim_is_joint", period) - deeming = person("is_ssi_spousal_deeming_applies", period) + # The level covers the year, so it takes the year's deeming comparison. + deeming = ssi_budget_spousal_deeming_applies(person, period, parameters) monthly = select( [joint, deeming], [couple, max_(couple, individual)], diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/status/is_ssi_ineligible_child.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/status/is_ssi_ineligible_child.py index d178b8b63d8..ffd3d36668c 100644 --- a/policyengine_us/variables/gov/ssa/ssi/eligibility/status/is_ssi_ineligible_child.py +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/status/is_ssi_ineligible_child.py @@ -1,13 +1,53 @@ from policyengine_us.model_api import * +from policyengine_us.variables.gov.ssa.ssi.eligibility.resources.deemed._ssi_spouses import ( + _ssi_is_married, +) class is_ssi_ineligible_child(Variable): value_type = bool entity = Person label = "Is an SSI-ineligible child" - definition_period = YEAR + documentation = ( + "A child under the SSI ineligible-child deeming definition who is not " + "eligible for SSI. " + "Whose child the person is, and whether they live with the " + "claimant, are tested where the allocation is summed." + ) + definition_period = MONTH + reference = ( + "https://www.ecfr.gov/current/title-20/section-416.1160#p-416.1160(d)", + "https://www.ecfr.gov/current/title-20/section-416.1856", + "https://www.law.cornell.edu/uscode/text/42/1382c#c", + "https://secure.ssa.gov/poms.nsf/lnx/0501310115", + ) def formula(person, period, parameters): - abd = person("is_ssi_aged_blind_disabled", period) - child = person("is_child", period) - return ~abd & child + p = parameters(period).gov.ssa.ssi.eligibility.child + # SI 01310.115 A.3: the ineligible-student deeming limit was under + # 21 before June 16, 2008 and under 22 afterward. The general SSI + # child definition remains distinct. Monthly status follows the + # parameters at the start of the month; no mid-month proration is + # modeled. Full-time attendance remains the model's proxy for + # regularly attending school. + annual_period = period.this_year + student = person("is_full_time_student", annual_period) & ( + person("age", annual_period) < p.deeming_student_age_limit + ) + # Marriage is distinct from the co-resident spouse lookup used for + # deeming: legal spouses can live apart. + child = ( + (person("is_child", annual_period) | student) + & ~_ssi_is_married(person, annual_period) + & ~person("is_household_head", annual_period) + ) + # 'Is not eligible for SSI benefits': aged, blind or disabled people + # who meet the citizenship or qualified-noncitizen condition are + # treated as eligible. The income and resource tests are not read, + # because they depend on deemed income and so on this allocation. + immigration_status = person("immigration_status", annual_period) + is_citizen = immigration_status == immigration_status.possible_values.CITIZEN + eligible = person("is_ssi_aged_blind_disabled", annual_period) & ( + is_citizen | person("is_ssi_qualified_noncitizen", annual_period) + ) + return child & ~eligible diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/status/is_ssi_ineligible_parent.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/status/is_ssi_ineligible_parent.py index 4b172a31db3..231bd5f373a 100644 --- a/policyengine_us/variables/gov/ssa/ssi/eligibility/status/is_ssi_ineligible_parent.py +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/status/is_ssi_ineligible_parent.py @@ -5,6 +5,9 @@ from policyengine_us.variables.gov.ssa.ssi.eligibility.income.deemed.from_ineligible_spouse._deemed_income_without_ism import ( ssi_income_deemed_from_ineligible_spouse_without_ism, ) +from policyengine_us.variables.gov.ssa.ssi.eligibility.income.deemed.from_ineligible_spouse._ssi_annual_spousal_deeming import ( + ssi_budget_spousal_deeming_applies, +) from policyengine_us.variables.gov.ssa.ssi.eligibility.resources.deemed._ssi_spouses import ( _ssi_established_spouse_indices, ) @@ -57,8 +60,11 @@ def formula(person, period, parameters): person, period, parameters ) p = parameters(period).gov.ssa.ssi + # This test covers the year, so it compares the year's remaining spouse + # income with the year's rate difference, or takes a supplied flag. benefit_rate = where( - joint_claim | person("is_ssi_spousal_deeming_applies", period), + joint_claim + | ssi_budget_spousal_deeming_applies(person, period, parameters), p.amount.couple, p.amount.individual, ) diff --git a/policyengine_us/variables/gov/ssa/ssi/eligibility/status/ssi_receives_public_income_maintenance.py b/policyengine_us/variables/gov/ssa/ssi/eligibility/status/ssi_receives_public_income_maintenance.py new file mode 100644 index 00000000000..d5bb891478a --- /dev/null +++ b/policyengine_us/variables/gov/ssa/ssi/eligibility/status/ssi_receives_public_income_maintenance.py @@ -0,0 +1,25 @@ +from policyengine_us.model_api import * + + +class ssi_receives_public_income_maintenance(Variable): + value_type = bool + entity = Person + label = "Receives public income-maintenance payments for SSI purposes" + documentation = ( + "Whether this person receives one of the public income-maintenance " + "payments listed in 20 CFR 416.1142(a), such as TANF, need-based " + "State or local assistance, or, from September 30, 2024, SNAP. SSI " + "makes no ineligible-child allocation for a child who receives them " + "(416.1163(b)). A child in a TANF grant held down by a family cap " + "is not treated as receiving TANF (POMS SI 01320.410). This input " + "is not derived from modeled benefits: SNAP counts SSI as income, " + "so deriving it from modeled SNAP would make SSI depend on itself." + ) + definition_period = YEAR + default_value = False + reference = ( + "https://www.ecfr.gov/current/title-20/section-416.1142#p-416.1142(a)", + "https://www.ecfr.gov/current/title-20/section-416.1163#p-416.1163(b)", + "https://secure.ssa.gov/poms.nsf/lnx/0501320141", + "https://secure.ssa.gov/poms.nsf/lnx/0501320410", + ) diff --git a/policyengine_us/variables/gov/ssa/ssi/ssi_amount_if_eligible.py b/policyengine_us/variables/gov/ssa/ssi/ssi_amount_if_eligible.py index 8bc3c8a92f2..f088dcda6cb 100644 --- a/policyengine_us/variables/gov/ssa/ssi/ssi_amount_if_eligible.py +++ b/policyengine_us/variables/gov/ssa/ssi/ssi_amount_if_eligible.py @@ -26,7 +26,7 @@ def formula(person, period, parameters): # SSI-eligible. ssi_claim_is_joint remains true for state SSPs. couple_computation = person("ssi_couple_computation_applies", period) - deeming_applies = person("is_ssi_spousal_deeming_applies", period.this_year) + deeming_applies = person("is_ssi_spousal_deeming_applies_monthly", period) individual_or_deeming_amount = where( deeming_applies, diff --git a/policyengine_us/variables/gov/ssa/ssi/uncapped_ssi.py b/policyengine_us/variables/gov/ssa/ssi/uncapped_ssi.py index b9541abddde..ac8917bbded 100644 --- a/policyengine_us/variables/gov/ssa/ssi/uncapped_ssi.py +++ b/policyengine_us/variables/gov/ssa/ssi/uncapped_ssi.py @@ -16,7 +16,7 @@ class uncapped_ssi(Variable): def formula(person, period, parameters): amount = person("ssi_amount_if_eligible", period) - countable_income = person("ssi_countable_income", period) + countable_income = person("ssi_countable_income_monthly", period) uncapped = amount - countable_income # 20 CFR 416.1163(e)(2): 'Your SSI benefit under the deeming rules # cannot be higher than it would be if deeming did not apply. @@ -27,5 +27,5 @@ def formula(person, period, parameters): # zero floor keeps this consistent with the payment for programs # that read the shortfall below zero. without_deeming = person("uncapped_ssi_without_spousal_deeming", period) - deeming_applies = person("is_ssi_spousal_deeming_applies", period.this_year) + deeming_applies = person("is_ssi_spousal_deeming_applies_monthly", period) return where(deeming_applies, min_(uncapped, without_deeming), uncapped) diff --git a/policyengine_us/variables/gov/ssa/ssi/uncapped_ssi_without_spousal_deeming.py b/policyengine_us/variables/gov/ssa/ssi/uncapped_ssi_without_spousal_deeming.py index 62e324c1b4d..89da9f31e0a 100644 --- a/policyengine_us/variables/gov/ssa/ssi/uncapped_ssi_without_spousal_deeming.py +++ b/policyengine_us/variables/gov/ssa/ssi/uncapped_ssi_without_spousal_deeming.py @@ -38,7 +38,7 @@ def formula(person, period, parameters): ) # Countable income adds income deemed from an ineligible spouse to the # person's own countable income; remove it. - own_countable_income = person("ssi_countable_income", period) - person( + own_countable_income = person("ssi_countable_income_monthly", period) - person( "ssi_income_deemed_from_ineligible_spouse_monthly", period ) # SSA applies the regular individual PMV to this individual @@ -50,7 +50,7 @@ def formula(person, period, parameters): # dates food under 416.420(a), and the month's shelter value, as # ssi_countable_income does. Core divides YEAR-defined income by 12. pmv_applies = person("ssi_pmv_applies", period) - deeming_applies = person("is_ssi_spousal_deeming_applies", period.this_year) + deeming_applies = person("is_ssi_spousal_deeming_applies_monthly", period) individual_pmv = ( p.amount.individual * p.income.ism.pmv_fbr_fraction + p.income.exclusions.general @@ -66,7 +66,9 @@ def formula(person, period, parameters): ) unearned = ( person("ssi_unearned_income", period) - + person("ssi_unearned_income_deemed_from_ineligible_parent", period) + + person( + "ssi_unearned_income_deemed_from_ineligible_parent_monthly", period + ) + individual_ism ) individual_countable = _apply_ssi_exclusions_monthly( diff --git a/policyengine_us/variables/gov/states/ca/cdss/capi/ca_capi_countable_income.py b/policyengine_us/variables/gov/states/ca/cdss/capi/ca_capi_countable_income.py new file mode 100644 index 00000000000..5068085b135 --- /dev/null +++ b/policyengine_us/variables/gov/states/ca/cdss/capi/ca_capi_countable_income.py @@ -0,0 +1,54 @@ +from policyengine_us.model_api import * +from policyengine_us.variables.gov.ssa.ssi.eligibility.income._annual_input import ( + annual_input, +) +from policyengine_us.variables.gov.ssa.ssi.eligibility.income._ssi_countable_income import ( + ssi_countable_income, +) +from policyengine_us.variables.gov.ssa.ssi.eligibility.income.deemed.from_ineligible_parent._ssi_parental_deemed_income import ( + ssi_parental_deemed_income, +) + + +class ca_capi_countable_income(Variable): + value_type = float + entity = Person + label = "California CAPI countable income" + unit = USD + definition_period = MONTH + defined_for = StateCode.CA + # Counties apply SSI income and deeming steps under MPP 49-035.12, + # .71 and .722 (PDF pages 25 and 30). + reference = ( + "https://www.cdss.ca.gov/Portals/9/CAPI/CAPI_Regulations-Accessible.pdf#page=30" + ) + + def formula(person, period, parameters): + supplied = annual_input(person, period, "ssi_countable_income") + if supplied is not None: + return supplied / MONTHS_IN_YEAR + + supplied_parent_deemed = annual_input( + person, period, "ssi_unearned_income_deemed_from_ineligible_parent" + ) + if supplied_parent_deemed is not None: + parent_deemed = supplied_parent_deemed / MONTHS_IN_YEAR + else: + # Counties divide parental income among SSI and CAPI children. + immigration_status = person("immigration_status", period) + is_citizen = ( + immigration_status == immigration_status.possible_values.CITIZEN + ) + ssi_recipient = person("is_ssi_aged_blind_disabled", period.this_year) & ( + is_citizen | person("is_ssi_qualified_noncitizen", period.this_year) + ) + recipients = person("is_child", period.this_year) & ( + ssi_recipient | person("ca_capi_eligible_person", period.this_year) + ) + parent_deemed = ssi_parental_deemed_income( + person, period, parameters, recipients=recipients + ) + + return ssi_countable_income( + person, period, parameters, parent_deemed=parent_deemed + ) diff --git a/policyengine_us/variables/gov/states/ca/cdss/capi/ca_capi_person.py b/policyengine_us/variables/gov/states/ca/cdss/capi/ca_capi_person.py index caddf021c70..0a87edcb2e7 100644 --- a/policyengine_us/variables/gov/states/ca/cdss/capi/ca_capi_person.py +++ b/policyengine_us/variables/gov/states/ca/cdss/capi/ca_capi_person.py @@ -50,7 +50,7 @@ def formula(person, period, parameters): / MONTHS_IN_YEAR ) countable_income = where( - separated, own_alone, person("ssi_countable_income", period) + separated, own_alone, person("ca_capi_countable_income", period) ) payment_standard = person("ca_capi_payment_standard", period) deemed_income = person( @@ -122,7 +122,7 @@ def formula(person, period, parameters): p = parameters(period).gov.states.ca.cdss.capi.payment_standard_offset deemed_benefit = max_(federal + supplement - p.single, 0) deeming = ( - (person("is_ssi_spousal_deeming_applies", period.this_year) & ~joint) + (person("is_ssi_spousal_deeming_applies_monthly", period) & ~joint) | unpaid_spouse ) & ~medical_facility return select( diff --git a/policyengine_us/variables/gov/states/ca/cdss/state_supplement/ca_state_supplement_person.py b/policyengine_us/variables/gov/states/ca/cdss/state_supplement/ca_state_supplement_person.py index 5e4cf980210..e94183a66fe 100644 --- a/policyengine_us/variables/gov/states/ca/cdss/state_supplement/ca_state_supplement_person.py +++ b/policyengine_us/variables/gov/states/ca/cdss/state_supplement/ca_state_supplement_person.py @@ -81,22 +81,19 @@ def formula(person, period, parameters): & (_ssi_couple_total(person, period.this_year, fails_test.astype(int)) > 0) ) earned = max_( - person("ssi_earned_income", period.this_year) - - person( - "ssi_blind_or_disabled_working_student_exclusion", period.this_year - ), + person("ssi_earned_income", period) + - person("ssi_blind_or_disabled_working_student_exclusion", period), 0, ) # NOTE: in-kind support uses the couple's presumed maximum value here, # because SSI still treats the pair as a couple. - ism = person("ssi_in_kind_support_and_maintenance", period) - unearned = ( - person("ssi_unearned_income", period.this_year) / MONTHS_IN_YEAR + ism - ) + ism = person("ssi_in_kind_support_and_maintenance_monthly", period) + unearned = person("ssi_unearned_income", period) + ism + # Apply exclusions to the current month before computing its supplement. own_countable_income = _apply_ssi_exclusions_monthly( - earned / MONTHS_IN_YEAR, unearned, parameters, period + earned, unearned, parameters, period ) - ssi_countable_income = person("ssi_countable_income", period) + ssi_countable_income = person("ssi_countable_income_monthly", period) couple_income = _ssi_couple_total( person, period.this_year, ssi_countable_income ) diff --git a/policyengine_us/variables/gov/states/ca/chhs/wdp/eligibility/_ca_wdp_annual_spousal_deeming.py b/policyengine_us/variables/gov/states/ca/chhs/wdp/eligibility/_ca_wdp_annual_spousal_deeming.py new file mode 100644 index 00000000000..be265715aa8 --- /dev/null +++ b/policyengine_us/variables/gov/states/ca/chhs/wdp/eligibility/_ca_wdp_annual_spousal_deeming.py @@ -0,0 +1,23 @@ +"""Retain the California WDP screens' existing annual income approximation.""" + +from policyengine_us.model_api import * +from policyengine_us.variables.gov.ssa.ssi.eligibility.income._annual_input import ( + annual_input, +) +from policyengine_us.variables.gov.ssa.ssi.eligibility.income.deemed.from_ineligible_spouse._ssi_annual_spousal_deeming import ( + ssi_annual_spousal_deeming_applies, +) + + +def ca_wdp_annual_spousal_deeming_applies(person, period, parameters): + """Apply the SSI differential to the screens' annual income budget. + + A supplied annual flag takes precedence, as when the screens read + is_ssi_spousal_deeming_applies directly. + """ + supplied = annual_input(person, period, "is_ssi_spousal_deeming_applies") + if supplied is not None: + return supplied + return person("is_ssi_eligible_individual", period) & ( + ssi_annual_spousal_deeming_applies(person, period, parameters) + ) diff --git a/policyengine_us/variables/gov/states/ca/chhs/wdp/eligibility/ca_wdp_income_eligible.py b/policyengine_us/variables/gov/states/ca/chhs/wdp/eligibility/ca_wdp_income_eligible.py index 540cc9cc9d3..66d2fafc961 100644 --- a/policyengine_us/variables/gov/states/ca/chhs/wdp/eligibility/ca_wdp_income_eligible.py +++ b/policyengine_us/variables/gov/states/ca/chhs/wdp/eligibility/ca_wdp_income_eligible.py @@ -1,4 +1,7 @@ from policyengine_us.model_api import * +from policyengine_us.variables.gov.states.ca.chhs.wdp.eligibility._ca_wdp_annual_spousal_deeming import ( + ca_wdp_annual_spousal_deeming_applies, +) from policyengine_us.variables.gov.ssa.ssi.eligibility.resources.deemed._ssi_spouses import ( _ssi_couple_total, ) @@ -28,7 +31,9 @@ def formula(person, period, parameters): _ssi_couple_total(person, period.this_year, personal_income) - personal_income ) - spousal_deeming_applies = person("is_ssi_spousal_deeming_applies", period) + spousal_deeming_applies = ca_wdp_annual_spousal_deeming_applies( + person, period, parameters + ) countable_income = personal_income + where( spousal_deeming_applies, spouse_income, diff --git a/policyengine_us/variables/gov/states/ca/chhs/wdp/eligibility/ca_wdp_ssi_ssp_income_eligible.py b/policyengine_us/variables/gov/states/ca/chhs/wdp/eligibility/ca_wdp_ssi_ssp_income_eligible.py index 8b048ca054d..d8968ba2958 100644 --- a/policyengine_us/variables/gov/states/ca/chhs/wdp/eligibility/ca_wdp_ssi_ssp_income_eligible.py +++ b/policyengine_us/variables/gov/states/ca/chhs/wdp/eligibility/ca_wdp_ssi_ssp_income_eligible.py @@ -1,4 +1,7 @@ from policyengine_us.model_api import * +from policyengine_us.variables.gov.states.ca.chhs.wdp.eligibility._ca_wdp_annual_spousal_deeming import ( + ca_wdp_annual_spousal_deeming_applies, +) from policyengine_us.variables.gov.ssa.ssi.eligibility.income._apply_ssi_exclusions import ( _apply_ssi_exclusions, ) @@ -37,8 +40,8 @@ def formula(person, period, parameters): period.first_month ).gov.states.ca.cdss.state_supplement.payment_standard fbr = parameters(period.first_month).gov.ssa.ssi.amount - uses_couple_standard = person("ssi_claim_is_joint", period) | person( - "is_ssi_spousal_deeming_applies", period + uses_couple_standard = person("ssi_claim_is_joint", period) | ( + ca_wdp_annual_spousal_deeming_applies(person, period, parameters) ) monthly_standard = where( uses_couple_standard, diff --git a/policyengine_us/variables/gov/states/co/ssa/co_ssa_in_kind_support_and_maintenance.py b/policyengine_us/variables/gov/states/co/ssa/co_ssa_in_kind_support_and_maintenance.py index 850cfe81429..3f9fae50e7c 100644 --- a/policyengine_us/variables/gov/states/co/ssa/co_ssa_in_kind_support_and_maintenance.py +++ b/policyengine_us/variables/gov/states/co/ssa/co_ssa_in_kind_support_and_maintenance.py @@ -59,7 +59,7 @@ def _ssa_ism(person, period, parameters): # (3.520.79(B)(6), 3.520.71(E)), so read that month's # ssi_in_kind_support_and_maintenance. It dates food by the # 20 CFR 416.420(a) income month and shelter by the payment month. - pmv_ism = person("ssi_in_kind_support_and_maintenance", period) + pmv_ism = person("ssi_in_kind_support_and_maintenance_monthly", period) couple_computation = person("ssi_couple_computation_applies", period) pmv_ism = where(couple_computation, pmv_ism / 2, pmv_ism) arrangement = person("ssi_federal_living_arrangement", period) @@ -109,7 +109,7 @@ def formula_2002(person, period, parameters): # value, so in these years AND-CS counts no ISM for a client in # another person's household and still offsets that reduction in # full. - ism = person("ssi_in_kind_support_and_maintenance", period) + ism = person("ssi_in_kind_support_and_maintenance_monthly", period) couple_computation = person("ssi_couple_computation_applies", period) return where(couple_computation, ism / 2, ism) diff --git a/policyengine_us/variables/gov/states/ct/dss/ssp/income/ct_ssp_countable_income.py b/policyengine_us/variables/gov/states/ct/dss/ssp/income/ct_ssp_countable_income.py index 44c69bb62e6..3ba941bc3af 100644 --- a/policyengine_us/variables/gov/states/ct/dss/ssp/income/ct_ssp_countable_income.py +++ b/policyengine_us/variables/gov/states/ct/dss/ssp/income/ct_ssp_countable_income.py @@ -23,7 +23,7 @@ def formula(person, period, parameters): [ "ssi_unearned_income", "ssi", - "ssi_unearned_income_deemed_from_ineligible_spouse", + "ssi_unearned_income_deemed_from_ineligible_spouse_monthly", ], ) unearned_disregard = person("ct_ssp_unearned_income_disregard", period) @@ -34,7 +34,7 @@ def formula(person, period, parameters): period, [ "ssi_earned_income", - "ssi_earned_income_deemed_from_ineligible_spouse", + "ssi_earned_income_deemed_from_ineligible_spouse_monthly", ], ) earned_disregard = person("ct_ssp_earned_income_disregard", period) diff --git a/policyengine_us/variables/gov/states/ct/dss/ssp/income/ct_ssp_earned_income_disregard.py b/policyengine_us/variables/gov/states/ct/dss/ssp/income/ct_ssp_earned_income_disregard.py index ca004a4ce77..cde939e3af9 100644 --- a/policyengine_us/variables/gov/states/ct/dss/ssp/income/ct_ssp_earned_income_disregard.py +++ b/policyengine_us/variables/gov/states/ct/dss/ssp/income/ct_ssp_earned_income_disregard.py @@ -20,7 +20,7 @@ def formula(person, period, parameters): period, [ "ssi_earned_income", - "ssi_earned_income_deemed_from_ineligible_spouse", + "ssi_earned_income_deemed_from_ineligible_spouse_monthly", ], ) is_blind = person("is_blind", period.this_year) diff --git a/policyengine_us/variables/gov/states/ct/dss/ssp/income/ct_ssp_gross_income.py b/policyengine_us/variables/gov/states/ct/dss/ssp/income/ct_ssp_gross_income.py index e8e2a0cb64a..037827d747b 100644 --- a/policyengine_us/variables/gov/states/ct/dss/ssp/income/ct_ssp_gross_income.py +++ b/policyengine_us/variables/gov/states/ct/dss/ssp/income/ct_ssp_gross_income.py @@ -23,7 +23,7 @@ def formula(person, period, parameters): "ssi_earned_income", "ssi_unearned_income", "ssi", - "ssi_earned_income_deemed_from_ineligible_spouse", - "ssi_unearned_income_deemed_from_ineligible_spouse", + "ssi_earned_income_deemed_from_ineligible_spouse_monthly", + "ssi_unearned_income_deemed_from_ineligible_spouse_monthly", ], ) diff --git a/policyengine_us/variables/gov/states/fl/dcf/oss/fl_oss.py b/policyengine_us/variables/gov/states/fl/dcf/oss/fl_oss.py index 08d2f86d495..799f263fc5b 100644 --- a/policyengine_us/variables/gov/states/fl/dcf/oss/fl_oss.py +++ b/policyengine_us/variables/gov/states/fl/dcf/oss/fl_oss.py @@ -53,7 +53,7 @@ def formula(person, period, parameters): provider_rate = person("fl_oss_provider_rate", period) # total_needs = recognized cost of care + personal needs allowance. total_needs = provider_rate + p.pna - countable_income = person("ssi_countable_income", period) + countable_income = person("ssi_countable_income_monthly", period) max_oss = person("fl_oss_max_oss", period) # Deficit (2640.0131.04 Step 2), floored at $0 and capped by the # Appendix A-12 Maximum OSS Payment. diff --git a/policyengine_us/variables/gov/states/fl/dcf/oss/fl_oss_eligible.py b/policyengine_us/variables/gov/states/fl/dcf/oss/fl_oss_eligible.py index b535187e546..3b7b60286e7 100644 --- a/policyengine_us/variables/gov/states/fl/dcf/oss/fl_oss_eligible.py +++ b/policyengine_us/variables/gov/states/fl/dcf/oss/fl_oss_eligible.py @@ -66,7 +66,7 @@ def formula(person, period, parameters): receives_ssi = (person("ssi", period) > 0) | person("receives_ssi", period) # FAC 65A-2.033(2): income within OSS income standard (Group 2). income_standard = person("fl_oss_income_standard", period) - countable_income = person("ssi_countable_income", period) + countable_income = person("ssi_countable_income_monthly", period) income_within_standard = countable_income <= income_standard return ( categorically_eligible diff --git a/policyengine_us/variables/gov/states/ia/hhs/ssa/_ia_ssa_smme_spouse_income.py b/policyengine_us/variables/gov/states/ia/hhs/ssa/_ia_ssa_smme_spouse_income.py index d7025ab87d9..611d20ffea0 100644 --- a/policyengine_us/variables/gov/states/ia/hhs/ssa/_ia_ssa_smme_spouse_income.py +++ b/policyengine_us/variables/gov/states/ia/hhs/ssa/_ia_ssa_smme_spouse_income.py @@ -59,7 +59,7 @@ def ia_ssa_smme_spouse_income(person, period): ) spouse_unearned = ia_ssa_spouse_value(person, period, unearned) allocations = ( - add(person.tax_unit, period, ["ssi_ineligible_child_allocation"]) + add(person.tax_unit, period, ["ssi_ineligible_child_allocation_monthly"]) * ~not_ineligible ) unearned_left = max_(spouse_unearned - allocations, 0) diff --git a/policyengine_us/variables/gov/states/ia/hhs/ssa/ia_ssa.py b/policyengine_us/variables/gov/states/ia/hhs/ssa/ia_ssa.py index f6f1301741c..8966ef315e6 100644 --- a/policyengine_us/variables/gov/states/ia/hhs/ssa/ia_ssa.py +++ b/policyengine_us/variables/gov/states/ia/hhs/ssa/ia_ssa.py @@ -138,7 +138,7 @@ def formula(person, period, parameters): # Medicaid-paid stay, which SSI separates). spouse_income = ( joint - | person("is_ssi_spousal_deeming_applies", period.this_year) + | person("is_ssi_spousal_deeming_applies_monthly", period) | person("ia_ssa_smme_spousal_deeming_applies", period) | ia_ssa_smme_spouse_is_sga_applicant(person, period) ) diff --git a/policyengine_us/variables/gov/states/ia/hhs/ssa/ia_ssa_care_countable_income.py b/policyengine_us/variables/gov/states/ia/hhs/ssa/ia_ssa_care_countable_income.py index db306fbb4f0..c288a16e594 100644 --- a/policyengine_us/variables/gov/states/ia/hhs/ssa/ia_ssa_care_countable_income.py +++ b/policyengine_us/variables/gov/states/ia/hhs/ssa/ia_ssa_care_countable_income.py @@ -82,7 +82,7 @@ def formula(person, period, parameters): deemed = where( home, person("ia_ssa_income_deemed_from_parents", period), - person("ssi_unearned_income_deemed_from_ineligible_parent", period), + person("ssi_unearned_income_deemed_from_ineligible_parent_monthly", period), ) unearned = unearned + ~adult * deemed # NOTE: 6-B pp.60-61 treats spouses "as individuals beginning the month diff --git a/policyengine_us/variables/gov/states/ia/hhs/ssa/ia_ssa_federal.py b/policyengine_us/variables/gov/states/ia/hhs/ssa/ia_ssa_federal.py index 7b4aef0dc93..5dd96e2e3a0 100644 --- a/policyengine_us/variables/gov/states/ia/hhs/ssa/ia_ssa_federal.py +++ b/policyengine_us/variables/gov/states/ia/hhs/ssa/ia_ssa_federal.py @@ -44,7 +44,7 @@ def formula(person, period, parameters): max_(dependent, ia_ssa_spouse_value(person, period, dependent)), dependent, ) - recipient_income = person("ssi_countable_income", period) + person( + recipient_income = person("ssi_countable_income_monthly", period) + person( "ssi", period ) group_income = ( diff --git a/policyengine_us/variables/gov/states/ia/hhs/ssa/ia_ssa_ihhrc_participation.py b/policyengine_us/variables/gov/states/ia/hhs/ssa/ia_ssa_ihhrc_participation.py index f3b6cbaceed..b73c90c6649 100644 --- a/policyengine_us/variables/gov/states/ia/hhs/ssa/ia_ssa_ihhrc_participation.py +++ b/policyengine_us/variables/gov/states/ia/hhs/ssa/ia_ssa_ihhrc_participation.py @@ -55,7 +55,7 @@ def formula(person, period, parameters): # (ia_ssa.yaml Case 50). head_or_spouse = person("is_tax_unit_head_or_spouse", period.this_year) dependents = head_or_spouse * person.tax_unit.sum( - person("ssi_ineligible_child_allocation", period) + person("ssi_ineligible_child_allocation_monthly", period) ) participation = max_(income - maintenance - dependents - deductions, 0) # No client participation is required in a first partial month. diff --git a/policyengine_us/variables/gov/states/ia/hhs/ssa/ia_ssa_income_deemed_from_parents.py b/policyengine_us/variables/gov/states/ia/hhs/ssa/ia_ssa_income_deemed_from_parents.py index 61c7b267d66..532d60ddb0e 100644 --- a/policyengine_us/variables/gov/states/ia/hhs/ssa/ia_ssa_income_deemed_from_parents.py +++ b/policyengine_us/variables/gov/states/ia/hhs/ssa/ia_ssa_income_deemed_from_parents.py @@ -66,7 +66,7 @@ def formula(person, period, parameters): # standard less that child's own income. sibling_allowance = np.bincount( pool, - weights=person("ssi_ineligible_child_allocation", period), + weights=person("ssi_ineligible_child_allocation_monthly", period), minlength=pool_count, )[pool] exclusions = ssi.income.exclusions diff --git a/policyengine_us/variables/gov/states/ia/hhs/ssa/ia_ssa_smme_countable_income.py b/policyengine_us/variables/gov/states/ia/hhs/ssa/ia_ssa_smme_countable_income.py index 7de641454fa..ae07c5fe0f4 100644 --- a/policyengine_us/variables/gov/states/ia/hhs/ssa/ia_ssa_smme_countable_income.py +++ b/policyengine_us/variables/gov/states/ia/hhs/ssa/ia_ssa_smme_countable_income.py @@ -41,7 +41,7 @@ def formula(person, period, parameters): # nothing, 8-E p.12 says to "Process as a one-person household" # (Cases 83-84). # NOTE: Group-specific Medicaid budgeting is not modeled. - income = person("ssi_countable_income", period) + person("ssi", period) + income = person("ssi_countable_income_monthly", period) + person("ssi", period) # SSI counts income only for people it treats as aged, blind or # disabled, so ssi_countable_income is 0 for a disabled person working # above the SGA level, whom SMME still covers (Iowa Code @@ -72,7 +72,7 @@ def formula(person, period, parameters): 0, ) unearned = person("ssi_unearned_income", period) + person( - "ssi_in_kind_support_and_maintenance", period + "ssi_in_kind_support_and_maintenance_monthly", period ) deemed = person("ia_ssa_smme_spousal_deeming_applies", period) spouse_earned, spouse_unearned = ia_ssa_smme_spouse_income(person, period) diff --git a/policyengine_us/variables/gov/states/id/dhw/aabd/id_aabd.py b/policyengine_us/variables/gov/states/id/dhw/aabd/id_aabd.py index 822990e39b4..3f4effd5219 100644 --- a/policyengine_us/variables/gov/states/id/dhw/aabd/id_aabd.py +++ b/policyengine_us/variables/gov/states/id/dhw/aabd/id_aabd.py @@ -32,6 +32,6 @@ def formula(person, period, parameters): # AABD cash = basic allowance - countable income, capped at max # (Section 514). Idaho mirrors SSI disregards (Sections 540-546). - countable_income = person("ssi_countable_income", period) + countable_income = person("ssi_countable_income_monthly", period) financial_need = max_(0, per_person_allowance - countable_income) return min_(financial_need, per_person_max) diff --git a/policyengine_us/variables/gov/states/in/fssa/ssp/in_ssp_rcap.py b/policyengine_us/variables/gov/states/in/fssa/ssp/in_ssp_rcap.py index 72773a67fdc..7cd4535f360 100644 --- a/policyengine_us/variables/gov/states/in/fssa/ssp/in_ssp_rcap.py +++ b/policyengine_us/variables/gov/states/in/fssa/ssp/in_ssp_rcap.py @@ -29,5 +29,5 @@ def formula(person, period, parameters): average_days_per_month = 365 / MONTHS_IN_YEAR state_standard = per_diem * average_days_per_month ssi_monthly = person("ssi", period) - countable_income = person("ssi_countable_income", period) + countable_income = person("ssi_countable_income_monthly", period) return max_(state_standard - ssi_monthly - countable_income, 0) diff --git a/policyengine_us/variables/gov/states/in/fssa/ssp/in_ssp_sapn.py b/policyengine_us/variables/gov/states/in/fssa/ssp/in_ssp_sapn.py index 33545090117..5474e1ed7db 100644 --- a/policyengine_us/variables/gov/states/in/fssa/ssp/in_ssp_sapn.py +++ b/policyengine_us/variables/gov/states/in/fssa/ssp/in_ssp_sapn.py @@ -29,7 +29,7 @@ def formula(person, period, parameters): ) is_couple = joint_claim & both_eligible ssi_monthly = person("ssi", period) - countable_income = person("ssi_countable_income", period) + countable_income = person("ssi_countable_income_monthly", period) max_individual = p.sapn.amount.individual max_couple = p.sapn.amount.couple pna = p.personal_needs_allowance diff --git a/policyengine_us/variables/gov/states/ky/dcbs/ssp/ky_ssp_countable_income.py b/policyengine_us/variables/gov/states/ky/dcbs/ssp/ky_ssp_countable_income.py index 3866d6061ea..accd41d0b48 100644 --- a/policyengine_us/variables/gov/states/ky/dcbs/ssp/ky_ssp_countable_income.py +++ b/policyengine_us/variables/gov/states/ky/dcbs/ssp/ky_ssp_countable_income.py @@ -28,8 +28,10 @@ def formula(person, period, parameters): ) unearned = ( person("ssi_marital_unearned_income", period) - + person("ssi_unearned_income_deemed_from_ineligible_parent", period) - + person("ssi_in_kind_support_and_maintenance", period) + + person( + "ssi_unearned_income_deemed_from_ineligible_parent_monthly", period + ) + + person("ssi_in_kind_support_and_maintenance_monthly", period) ) p = parameters(period).gov.ssa.ssi.income.exclusions countable_earned = max_(earned - p.earned, 0) * (1 - p.earned_share) diff --git a/policyengine_us/variables/gov/states/la/hhs/oss/la_oss.py b/policyengine_us/variables/gov/states/la/hhs/oss/la_oss.py index e7f9a8d8992..f82ea496eae 100644 --- a/policyengine_us/variables/gov/states/la/hhs/oss/la_oss.py +++ b/policyengine_us/variables/gov/states/la/hhs/oss/la_oss.py @@ -23,6 +23,6 @@ def formula(person, period, parameters): # $0.50/$0.49 round-up rule are not modeled at the moment. p = parameters(period).gov.states.la.hhs.oss ssi = person("ssi", period) - countable_income = person("ssi_countable_income", period) + countable_income = person("ssi_countable_income_monthly", period) raw = p.personal_care_needs_allowance - ssi - countable_income return min_(max_(raw, 0), p.maximum_payment) diff --git a/policyengine_us/variables/gov/states/md/dhs/fia/paa/md_paa_countable_income.py b/policyengine_us/variables/gov/states/md/dhs/fia/paa/md_paa_countable_income.py index 1cec1b9fe3f..49a625049f9 100644 --- a/policyengine_us/variables/gov/states/md/dhs/fia/paa/md_paa_countable_income.py +++ b/policyengine_us/variables/gov/states/md/dhs/fia/paa/md_paa_countable_income.py @@ -37,7 +37,7 @@ def formula(person, period, parameters): unearned = ( _ssi_couple_income(person, period, "ssi_unearned_income") + person("ssi_unearned_income_deemed_from_ineligible_parent", period) - + person("ssi_in_kind_support_and_maintenance", period) + + person("ssi_in_kind_support_and_maintenance_monthly", period) ) personal_countable = _apply_ssi_exclusions_monthly( adjusted_earned, diff --git a/policyengine_us/variables/gov/states/md/dhs/fia/paa/md_paa_imputed_federal_ssi.py b/policyengine_us/variables/gov/states/md/dhs/fia/paa/md_paa_imputed_federal_ssi.py index f3e7d87a3f5..f13aaa05631 100644 --- a/policyengine_us/variables/gov/states/md/dhs/fia/paa/md_paa_imputed_federal_ssi.py +++ b/policyengine_us/variables/gov/states/md/dhs/fia/paa/md_paa_imputed_federal_ssi.py @@ -61,7 +61,7 @@ def formula(person, period, parameters): ) couple_ssi = p.couple * vtr_factor - (countable_income + deemed_income) deeming = ( - person("is_ssi_spousal_deeming_applies", period.this_year) + person("is_ssi_spousal_deeming_applies_monthly", period) & ~in_medical_facility ) reported_ssi = max_( diff --git a/policyengine_us/variables/gov/states/mn/dhs/msa/eligibility/mn_msa_net_income_eligible.py b/policyengine_us/variables/gov/states/mn/dhs/msa/eligibility/mn_msa_net_income_eligible.py index ceefa00797f..af8ea0ad2f4 100644 --- a/policyengine_us/variables/gov/states/mn/dhs/msa/eligibility/mn_msa_net_income_eligible.py +++ b/policyengine_us/variables/gov/states/mn/dhs/msa/eligibility/mn_msa_net_income_eligible.py @@ -50,8 +50,8 @@ def formula(person, period, parameters): period, [ "ssi_unearned_income", - "ssi_unearned_income_deemed_from_ineligible_spouse", - "ssi_unearned_income_deemed_from_ineligible_parent", + "ssi_unearned_income_deemed_from_ineligible_spouse_monthly", + "ssi_unearned_income_deemed_from_ineligible_parent_monthly", ], ) @@ -74,7 +74,7 @@ def formula(person, period, parameters): period.this_year, [ "ssi_earned_income", - "ssi_earned_income_deemed_from_ineligible_spouse", + "ssi_earned_income_deemed_from_ineligible_spouse_monthly", ], ) annual_unearned = add( @@ -82,8 +82,8 @@ def formula(person, period, parameters): period.this_year, [ "ssi_unearned_income", - "ssi_unearned_income_deemed_from_ineligible_spouse", - "ssi_unearned_income_deemed_from_ineligible_parent", + "ssi_unearned_income_deemed_from_ineligible_spouse_monthly", + "ssi_unearned_income_deemed_from_ineligible_parent_monthly", ], ) couple_earned = _ssi_couple_total(person, period.this_year, annual_earned) diff --git a/policyengine_us/variables/gov/states/mn/dhs/msa/income/mn_msa_gross_income.py b/policyengine_us/variables/gov/states/mn/dhs/msa/income/mn_msa_gross_income.py index a6438e3c287..f06c60f2ce7 100644 --- a/policyengine_us/variables/gov/states/mn/dhs/msa/income/mn_msa_gross_income.py +++ b/policyengine_us/variables/gov/states/mn/dhs/msa/income/mn_msa_gross_income.py @@ -23,9 +23,9 @@ def formula(person, period, parameters): [ "ssi_earned_income", "ssi_unearned_income", - "ssi_earned_income_deemed_from_ineligible_spouse", - "ssi_unearned_income_deemed_from_ineligible_spouse", - "ssi_unearned_income_deemed_from_ineligible_parent", + "ssi_earned_income_deemed_from_ineligible_spouse_monthly", + "ssi_unearned_income_deemed_from_ineligible_spouse_monthly", + "ssi_unearned_income_deemed_from_ineligible_parent_monthly", ], ) # MSA gross income is measured before deductions and disregards. diff --git a/policyengine_us/variables/gov/states/mn/dhs/msa/mn_msa_person.py b/policyengine_us/variables/gov/states/mn/dhs/msa/mn_msa_person.py index 844b39ab6ff..5be81540dba 100644 --- a/policyengine_us/variables/gov/states/mn/dhs/msa/mn_msa_person.py +++ b/policyengine_us/variables/gov/states/mn/dhs/msa/mn_msa_person.py @@ -59,8 +59,8 @@ def formula(person, period, parameters): period, [ "ssi_unearned_income", - "ssi_unearned_income_deemed_from_ineligible_spouse", - "ssi_unearned_income_deemed_from_ineligible_parent", + "ssi_unearned_income_deemed_from_ineligible_spouse_monthly", + "ssi_unearned_income_deemed_from_ineligible_parent_monthly", ], ) disregard = where(is_medicaid_facility, 0, p.general) @@ -90,7 +90,7 @@ def formula(person, period, parameters): period.this_year, [ "ssi_earned_income", - "ssi_earned_income_deemed_from_ineligible_spouse", + "ssi_earned_income_deemed_from_ineligible_spouse_monthly", ], ) annual_unearned = add( @@ -98,8 +98,8 @@ def formula(person, period, parameters): period.this_year, [ "ssi_unearned_income", - "ssi_unearned_income_deemed_from_ineligible_spouse", - "ssi_unearned_income_deemed_from_ineligible_parent", + "ssi_unearned_income_deemed_from_ineligible_spouse_monthly", + "ssi_unearned_income_deemed_from_ineligible_parent_monthly", ], ) couple_earned = _ssi_couple_total(person, period.this_year, annual_earned) diff --git a/policyengine_us/variables/gov/states/nc/ncdhhs/sa/nc_sa_eligible.py b/policyengine_us/variables/gov/states/nc/ncdhhs/sa/nc_sa_eligible.py index 30db42526e9..d7e56816df5 100644 --- a/policyengine_us/variables/gov/states/nc/ncdhhs/sa/nc_sa_eligible.py +++ b/policyengine_us/variables/gov/states/nc/ncdhhs/sa/nc_sa_eligible.py @@ -34,7 +34,7 @@ def formula(person, period, parameters): # countable income, including deemed spousal income, so an applicant # denied SSI for spousal income qualifies (SA-5400 V). over_income_for_ssi = person("ssi_amount_if_eligible", period) <= person( - "ssi_countable_income", period + "ssi_countable_income_monthly", period ) # An SSI recipient automatically meets the categorical, financial and # resource requirements (SA-3100 II.B; SA-3200 I.A). An applicant over diff --git a/policyengine_us/variables/gov/states/nh/dhhs/ssp/nh_ssp_countable_income.py b/policyengine_us/variables/gov/states/nh/dhhs/ssp/nh_ssp_countable_income.py index 3df789f2c0c..d2dc0f297cf 100644 --- a/policyengine_us/variables/gov/states/nh/dhhs/ssp/nh_ssp_countable_income.py +++ b/policyengine_us/variables/gov/states/nh/dhhs/ssp/nh_ssp_countable_income.py @@ -57,11 +57,12 @@ def formula(person, period, parameters): unearned = max_(person("ssi_unearned_income", period), 0) + person( "ssi", period ) - # Blind children use the parental allocation in He-W 652.03(f)-(g). + # Blind children use the parental allocation in He-W 652.03(f)-(g), + # with siblings limited to those He-W 652.03(h)(1) allows. # NOTE: that term uses SSI's earned income, so the parents' pre-tax # health premiums are excluded there; 652.03(f)(2) names no such exclusion. unearned = unearned + person( - "ssi_unearned_income_deemed_from_ineligible_parent", period + "nh_ssp_unearned_income_deemed_from_ineligible_parent", period ) unearned = unearned + spouse_value(unearned, spouse) other = max_(person("nh_ssp_other_income_deductions", period), 0) diff --git a/policyengine_us/variables/gov/states/nh/dhhs/ssp/nh_ssp_ineligible_child.py b/policyengine_us/variables/gov/states/nh/dhhs/ssp/nh_ssp_ineligible_child.py new file mode 100644 index 00000000000..1869ede2d18 --- /dev/null +++ b/policyengine_us/variables/gov/states/nh/dhhs/ssp/nh_ssp_ineligible_child.py @@ -0,0 +1,31 @@ +from policyengine_us.model_api import * + + +class nh_ssp_ineligible_child(Variable): + value_type = bool + entity = Person + label = "New Hampshire adult assistance ineligible child" + definition_period = MONTH + defined_for = StateCode.NH + reference = "https://gc.nh.gov/rules/state_agencies/he-w600.html" + documentation = ( + "An SSI-ineligible child whom New Hampshire also counts when it " + "allocates parental income: under 18, or under 20 while a full-time " + "student in a secondary school or equivalent training. An older " + "college student gets no allocation." + ) + + def formula(person, period, parameters): + p = parameters(period).gov.states.nh.dhhs.ssp.ineligible_child + year = period.this_year + age = person("age", year) + # He-W 652.03(h)(1): a sibling "under the age of 20 if a full-time + # student in a secondary school", including equivalent vocational or + # technical training. is_in_secondary_school covers that training. + secondary_student = ( + person("is_full_time_student", year) + & person("is_in_secondary_school", year) + & (age < p.secondary_student_age_limit) + ) + in_scope = (age < p.age_limit) | secondary_student + return person("is_ssi_ineligible_child", period) & in_scope diff --git a/policyengine_us/variables/gov/states/nh/dhhs/ssp/nh_ssp_unearned_income_deemed_from_ineligible_parent.py b/policyengine_us/variables/gov/states/nh/dhhs/ssp/nh_ssp_unearned_income_deemed_from_ineligible_parent.py new file mode 100644 index 00000000000..9de570ea092 --- /dev/null +++ b/policyengine_us/variables/gov/states/nh/dhhs/ssp/nh_ssp_unearned_income_deemed_from_ineligible_parent.py @@ -0,0 +1,34 @@ +from policyengine_us.variables.gov.ssa.ssi.eligibility.income._annual_input import ( + annual_input, +) +from policyengine_us.model_api import * +from policyengine_us.variables.gov.ssa.ssi.eligibility.income.deemed.from_ineligible_parent._ssi_parental_deemed_income import ( + ssi_parental_deemed_income, +) + + +class nh_ssp_unearned_income_deemed_from_ineligible_parent(Variable): + value_type = float + entity = Person + label = "New Hampshire adult assistance income deemed from ineligible parents" + unit = USD + definition_period = MONTH + defined_for = StateCode.NH + reference = "https://gc.nh.gov/rules/state_agencies/he-w600.html" + documentation = ( + "SSI's monthly parental deeming, with the ineligible-child " + "allocation limited to the siblings He-W 652.03(h)(1) allows." + ) + + def formula(person, period, parameters): + supplied = annual_input( + person, period, "ssi_unearned_income_deemed_from_ineligible_parent" + ) + if supplied is not None: + return supplied / MONTHS_IN_YEAR + # Keep SSI's allocation amount and its reduction by the child's + # income; only the children who receive one follow New Hampshire. + allocations = person( + "ssi_ineligible_child_allocation_monthly", period + ) * person("nh_ssp_ineligible_child", period) + return ssi_parental_deemed_income(person, period, parameters, allocations) diff --git a/policyengine_us/variables/gov/states/ny/otda/ssp/ny_ssp.py b/policyengine_us/variables/gov/states/ny/otda/ssp/ny_ssp.py index c69e3ac2acf..4cf4ab020eb 100644 --- a/policyengine_us/variables/gov/states/ny/otda/ssp/ny_ssp.py +++ b/policyengine_us/variables/gov/states/ny/otda/ssp/ny_ssp.py @@ -91,7 +91,7 @@ def formula(person, period, parameters): # October 1, 2014, and the model follows the regulation: countable # income includes the deemed income (398-2.1(g)), measured against the # individual's own FBR. - deeming = person("is_ssi_spousal_deeming_applies", period.this_year) + deeming = person("is_ssi_spousal_deeming_applies_monthly", period) federal_la = person("ssi_federal_living_arrangement", period) # 20 CFR 416.1131(a): one-third of the FBR counts as income in another # person's household. @@ -100,7 +100,7 @@ def formula(person, period, parameters): 1 - fbr.one_third_reduction_rate, 1, ) - countable = person("ssi_countable_income", period) + countable = person("ssi_countable_income_monthly", period) regulatory = max_(individual - max_(countable - own_fbr, 0), 0) eligible = person("is_ssi_eligible", period) & person( "takes_up_ssi_if_eligible", period.this_year @@ -122,7 +122,7 @@ def formula(person, period, parameters): # hospitals and pay $25 in residential health care facilities. The # model follows the statute and regulation. personal_needs_eligible = (person("ssi", period) > 0) & ( - person("ssi_countable_income", period) == 0 + person("ssi_countable_income_monthly", period) == 0 ) personal_needs = select( [ diff --git a/policyengine_us/variables/gov/states/ny/otda/ssp/ny_ssp_is_minor.py b/policyengine_us/variables/gov/states/ny/otda/ssp/ny_ssp_is_minor.py index 55e7265f1b6..53db36d19d7 100644 --- a/policyengine_us/variables/gov/states/ny/otda/ssp/ny_ssp_is_minor.py +++ b/policyengine_us/variables/gov/states/ny/otda/ssp/ny_ssp_is_minor.py @@ -28,8 +28,9 @@ def formula(person, period, parameters): p = parameters(period).gov.states.ny.otda.ssp age = person("age", period) student = person("is_full_time_student", period) - # Marriage uses the SSI spouse test, so a child of a married couple - # is not treated as married. + # New York uses the co-resident SSI spouse lookup as its marriage + # proxy, which does not pair a parent with their child. SSI's separate + # 416.1856 marriage classification uses _ssi_is_married. married = _ssi_spouse_index(person, period) >= 0 head = person("is_household_head", period) under_age = (age < p.minor_age) | ((age < p.student_minor_age) & student) diff --git a/policyengine_us/variables/gov/states/ok/dhs/ssp/_ok_ssp_income.py b/policyengine_us/variables/gov/states/ok/dhs/ssp/_ok_ssp_income.py index a738c6f9464..bbff4771c12 100644 --- a/policyengine_us/variables/gov/states/ok/dhs/ssp/_ok_ssp_income.py +++ b/policyengine_us/variables/gov/states/ok/dhs/ssp/_ok_ssp_income.py @@ -32,13 +32,15 @@ def ok_ssp_income(person, period, parameters, *, combined): * ssi.income.exclusions.child_support_share, 0, ) - # NOTE: the deemed parental income uses the federal ineligible-child - # allocation (couple FBR minus individual FBR, 497 in 2026); Appendix C-1 - # Schedule VIII.C lists 498, so a sibling's allocation can be $1 lower. - # It also uses SSI's earned income, which excludes the parents' pre-tax - # health premiums that 317:35-5-42(b)(9)(A) counts as wages. + # The deemed parental income allocates only for children younger than 18 + # (OAC 340:15-1-2, 340:15-1-6(b)(1)). + # NOTE: it keeps the federal allocation amount (couple FBR minus + # individual FBR, 497 in 2026); Appendix C-1 Schedule VIII.C lists 498, + # so a sibling's allocation can be $1 lower. It also uses SSI's earned + # income, which excludes the parents' pre-tax health premiums that + # 317:35-5-42(b)(9)(A) counts as wages. unearned = unearned + person( - "ssi_unearned_income_deemed_from_ineligible_parent", period + "ok_ssp_unearned_income_deemed_from_ineligible_parent", period ) earned = max_( earned @@ -62,7 +64,7 @@ def ok_ssp_income(person, period, parameters, *, combined): # disabled spouse who is not eligible (issue 10243), so the half equals the # deeming value (1/6 couple FBR + $10) even when 317:35-5-42(m)(4) deems # nothing and the individual value would apply. - ism = person("ssi_in_kind_support_and_maintenance", period) + ism = person("ssi_in_kind_support_and_maintenance_monthly", period) ism = where(joint, ism / 2, ism) if combined: eligible = person("ok_ssp_eligible", period) diff --git a/policyengine_us/variables/gov/states/ok/dhs/ssp/ok_ssp_ineligible_child.py b/policyengine_us/variables/gov/states/ok/dhs/ssp/ok_ssp_ineligible_child.py new file mode 100644 index 00000000000..76838493998 --- /dev/null +++ b/policyengine_us/variables/gov/states/ok/dhs/ssp/ok_ssp_ineligible_child.py @@ -0,0 +1,30 @@ +from policyengine_us.model_api import * + + +class ok_ssp_ineligible_child(Variable): + value_type = bool + entity = Person + label = "Oklahoma SSP ineligible child" + definition_period = MONTH + defined_for = StateCode.OK + reference = ( + # OAC 340:15-1-2, as proposed in OKDHS circulation WF 22-15. + "https://oklahoma.gov/content/dam/ok/en/okdhs/documents/okdhs-pdf-library/policy/proposed-policy/2022-perms/22-15%20Circulation.pdf#page=7", + "https://www.law.cornell.edu/regulations/oklahoma/OAC-340-15-1-6", + ) + documentation = ( + "An SSI-ineligible child whom Oklahoma also counts: younger than 18 " + "and not blind or disabled. Oklahoma gives no allocation for an " + "older student." + ) + + def formula(person, period, parameters): + p = parameters(period).gov.states.ok.dhs.ssp + # OAC 340:15-1-2 excludes blind and disabled children regardless + # of whether their immigration status permits SSI eligibility. + younger = person("age", period.this_year) < p.ineligible_child_age_limit + return ( + person("is_ssi_ineligible_child", period) + & younger + & ~person("is_ssi_aged_blind_disabled", period.this_year) + ) diff --git a/policyengine_us/variables/gov/states/ok/dhs/ssp/ok_ssp_spouse_child_allocation.py b/policyengine_us/variables/gov/states/ok/dhs/ssp/ok_ssp_spouse_child_allocation.py index b274e4ea099..d86a2569ead 100644 --- a/policyengine_us/variables/gov/states/ok/dhs/ssp/ok_ssp_spouse_child_allocation.py +++ b/policyengine_us/variables/gov/states/ok/dhs/ssp/ok_ssp_spouse_child_allocation.py @@ -7,12 +7,21 @@ class ok_ssp_spouse_child_allocation(Variable): label = "Oklahoma SSP ineligible spouse allocation for dependent children" definition_period = MONTH unit = USD - reference = "https://www.law.cornell.edu/regulations/oklahoma/OAC-340-15-1-5" - documentation = "The total allocation for the family's children who are not aged, blind or disabled, each reduced by that child's own income. Blended families and children in a TANF case are not modeled separately." + reference = ( + "https://www.law.cornell.edu/regulations/oklahoma/OAC-340-15-1-5", + # OAC 340:15-1-2, as proposed in OKDHS circulation WF 22-15. + "https://oklahoma.gov/content/dam/ok/en/okdhs/documents/okdhs-pdf-library/policy/proposed-policy/2022-perms/22-15%20Circulation.pdf#page=7", + ) + documentation = ( + "The total allocation for the family's unmarried SSI-ineligible children " + "who are not household heads and are younger than 18 (OAC 340:15-1-2). " + "Each allocation is reduced by the child's own income. Blended families " + "and children in a TANF case are not modeled separately." + ) def formula(person, period, parameters): p = parameters(period).gov.states.ok.dhs.ssp - child = person("is_ssi_ineligible_child", period.this_year) + child = person("ok_ssp_ineligible_child", period) child_income = max_(person("ssi_earned_income", period), 0) + max_( person("ssi_unearned_income", period), 0 ) diff --git a/policyengine_us/variables/gov/states/ok/dhs/ssp/ok_ssp_unearned_income_deemed_from_ineligible_parent.py b/policyengine_us/variables/gov/states/ok/dhs/ssp/ok_ssp_unearned_income_deemed_from_ineligible_parent.py new file mode 100644 index 00000000000..85954b159e0 --- /dev/null +++ b/policyengine_us/variables/gov/states/ok/dhs/ssp/ok_ssp_unearned_income_deemed_from_ineligible_parent.py @@ -0,0 +1,39 @@ +from policyengine_us.variables.gov.ssa.ssi.eligibility.income._annual_input import ( + annual_input, +) +from policyengine_us.model_api import * +from policyengine_us.variables.gov.ssa.ssi.eligibility.income.deemed.from_ineligible_parent._ssi_parental_deemed_income import ( + ssi_parental_deemed_income, +) + + +class ok_ssp_unearned_income_deemed_from_ineligible_parent(Variable): + value_type = float + entity = Person + label = "Oklahoma SSP income deemed from ineligible parents" + unit = USD + definition_period = MONTH + defined_for = StateCode.OK + reference = ( + "https://www.law.cornell.edu/regulations/oklahoma/OAC-340-15-1-6", + # OAC 340:15-1-2, as proposed in OKDHS circulation WF 22-15. + "https://oklahoma.gov/content/dam/ok/en/okdhs/documents/okdhs-pdf-library/policy/proposed-policy/2022-perms/22-15%20Circulation.pdf#page=7", + ) + documentation = ( + "SSI's monthly parental deeming, with the ineligible-child " + "allocation limited to children younger than 18 (OAC 340:15-1-2)." + ) + + def formula(person, period, parameters): + supplied = annual_input( + person, period, "ssi_unearned_income_deemed_from_ineligible_parent" + ) + if supplied is not None: + return supplied / MONTHS_IN_YEAR + # OAC 340:15-1-6(b)(1) imports the state parental-deeming procedure. + # Keep SSI's allocation amount and its reduction by the child's + # income; only the children who receive one follow Oklahoma. + allocations = person( + "ssi_ineligible_child_allocation_monthly", period + ) * person("ok_ssp_ineligible_child", period) + return ssi_parental_deemed_income(person, period, parameters, allocations) diff --git a/policyengine_us/variables/gov/states/sc/scdhhs/ssi_state_supplement/sc_ssi_state_supplement.py b/policyengine_us/variables/gov/states/sc/scdhhs/ssi_state_supplement/sc_ssi_state_supplement.py index ef835f77dc1..3c3dc5c3485 100644 --- a/policyengine_us/variables/gov/states/sc/scdhhs/ssi_state_supplement/sc_ssi_state_supplement.py +++ b/policyengine_us/variables/gov/states/sc/scdhhs/ssi_state_supplement/sc_ssi_state_supplement.py @@ -17,6 +17,6 @@ def formula(person, period, parameters): # Per S.C. Code Regs. 126-910: OSS = max(0, NIL - countable income) p = parameters(period).gov.states.sc.scdhhs.ssi_state_supplement nil = p.net_income_limit - countable_income = person("ssi_countable_income", period) + countable_income = person("ssi_countable_income_monthly", period) ssi = person("ssi", period) return max_(0, nil - countable_income - ssi) diff --git a/policyengine_us/variables/gov/states/sc/scdhhs/ssi_state_supplement/sc_ssi_state_supplement_eligible.py b/policyengine_us/variables/gov/states/sc/scdhhs/ssi_state_supplement/sc_ssi_state_supplement_eligible.py index 56c9168bdd3..1afeb5dd21d 100644 --- a/policyengine_us/variables/gov/states/sc/scdhhs/ssi_state_supplement/sc_ssi_state_supplement_eligible.py +++ b/policyengine_us/variables/gov/states/sc/scdhhs/ssi_state_supplement/sc_ssi_state_supplement_eligible.py @@ -18,7 +18,7 @@ def formula(person, period, parameters): in_facility = person("is_in_residential_care_facility", period) p = parameters(period).gov.states.sc.scdhhs.ssi_state_supplement nil = p.net_income_limit - countable_income = person("ssi_countable_income", period) + countable_income = person("ssi_countable_income_monthly", period) ssi = person("ssi", period) income_eligible = (countable_income + ssi) < nil return is_aged_blind_disabled & in_facility & income_eligible diff --git a/policyengine_us/variables/gov/states/sc/scdhhs/ssi_state_supplement/sc_ssi_state_supplement_pna.py b/policyengine_us/variables/gov/states/sc/scdhhs/ssi_state_supplement/sc_ssi_state_supplement_pna.py index 84716e45cd3..556403e1fcd 100644 --- a/policyengine_us/variables/gov/states/sc/scdhhs/ssi_state_supplement/sc_ssi_state_supplement_pna.py +++ b/policyengine_us/variables/gov/states/sc/scdhhs/ssi_state_supplement/sc_ssi_state_supplement_pna.py @@ -19,5 +19,5 @@ def formula(person, period, parameters): ).gov.states.sc.scdhhs.ssi_state_supplement.personal_needs_allowance # Per S.C. Code Regs. 126-910(G): SSI-only PNA if no other # countable income; higher PNA if other income sources exist - ssi_only = person("ssi_countable_income", period) == 0 + ssi_only = person("ssi_countable_income_monthly", period) == 0 return where(ssi_only, p.ssi_only, p.other_income) diff --git a/policyengine_us/variables/gov/states/tx/hhsc/ssi_state_supplement/tx_ssi_state_supplement_eligible.py b/policyengine_us/variables/gov/states/tx/hhsc/ssi_state_supplement/tx_ssi_state_supplement_eligible.py index fe1fe9cd905..1b108bc7427 100644 --- a/policyengine_us/variables/gov/states/tx/hhsc/ssi_state_supplement/tx_ssi_state_supplement_eligible.py +++ b/policyengine_us/variables/gov/states/tx/hhsc/ssi_state_supplement/tx_ssi_state_supplement_eligible.py @@ -39,7 +39,7 @@ def formula(person, period, parameters): # income, held to their $30 half of the $60 couple standard (H-6000). p = parameters(period).gov.ssa.ssi own_countable_income = max_( - person("ssi_countable_income", period) + person("ssi_countable_income_monthly", period) - person("ssi_income_deemed_from_ineligible_spouse_monthly", period), 0, ) diff --git a/policyengine_us/variables/gov/states/va/dars/ag/va_ag_countable_income.py b/policyengine_us/variables/gov/states/va/dars/ag/va_ag_countable_income.py index c5164013ec4..bb4ec545715 100644 --- a/policyengine_us/variables/gov/states/va/dars/ag/va_ag_countable_income.py +++ b/policyengine_us/variables/gov/states/va/dars/ag/va_ag_countable_income.py @@ -66,7 +66,9 @@ def formula(person, period, parameters): # although Chapter B section 6 makes the assistance unit the applicant # only. countable = where( - ssi > 0, person("ssi_countable_income", period) + ssi, non_ssi_countable + ssi > 0, + person("ssi_countable_income_monthly", period) + ssi, + non_ssi_countable, ) exclusions = max_(person("va_ag_allowable_income_exclusions", period), 0) return max_(countable - exclusions, 0) diff --git a/policyengine_us/variables/household/demographic/person/_parent_links.py b/policyengine_us/variables/household/demographic/person/_parent_links.py index 2e7d7ec2c2f..4dc2487102a 100644 --- a/policyengine_us/variables/household/demographic/person/_parent_links.py +++ b/policyengine_us/variables/household/demographic/person/_parent_links.py @@ -20,6 +20,9 @@ - Input that breaks the contract gets a defined, member-order-free fallback, not a legal identity: an id that matches two members of one group resolves to neither, so it acts as an absent parent. +- An id that names a parent outside the simulation must be unique to that + parent and the same for each of their children, because the SSI spousal + allocation compares ids to find siblings. - A person is a parent when own_children_in_household is positive or when a co-resident person's id names them. Neither source erases the other. - A household has links when any member has a nonzero id. Formulas keep diff --git a/source_conflicts/candidates.yaml b/source_conflicts/candidates.yaml index 4c63260bc3e..4e9ec7b6c8e 100644 --- a/source_conflicts/candidates.yaml +++ b/source_conflicts/candidates.yaml @@ -15887,30 +15887,57 @@ candidates: - id: us:ssi-spousal-deeming-child-scope program: ssi years: - from: 2026 - to: 2026 + from: 1987 type: calendar question: Does the regulation's ineligible-child definition include the claimant's siblings in spouse-to-spouse deeming, or does POMS limit it to the couple's children? sources: - kind: regulation citation: 20 CFR 416.1160(d) - url: null + url: https://www.ecfr.gov/current/title-20/section-416.1160#p-416.1160(d) + - kind: regulation + citation: 20 CFR 416.1163(b) + url: https://www.ecfr.gov/current/title-20/section-416.1163#p-416.1163(b) + - kind: regulation + citation: 20 CFR 416.1160(c)(2) + url: https://www.ecfr.gov/current/title-20/section-416.1160#p-416.1160(c)(2) + - kind: regulation + citation: 20 CFR 416.1101 + url: https://www.ecfr.gov/current/title-20/section-416.1101 + - kind: regulation + citation: 20 CFR 416.1132(a) + url: https://www.ecfr.gov/current/title-20/section-416.1132#p-416.1132(a) + - kind: rulemaking + citation: 52 FR 8883 (March 20, 1987) + url: https://www.govinfo.gov/content/pkg/FR-1987-03-20/pdf/FR-1987-03-20.pdf - kind: manual - citation: POMS SI 01310.115 A.3; POMS SI 01310.140 A + citation: POMS SI 01310.115 A.3 url: https://secure.ssa.gov/poms.nsf/lnx/0501310115 + - kind: manual + citation: POMS SI 01310.140 A + url: https://secure.ssa.gov/poms.nsf/lnx/0501310140 readings: - statute: The full regulatory definition would include the claimant's own siblings. - other: POMS limits spouse-to-spouse deeming to the children of either member of the couple. + statute: 416.1160(d) defines an ineligible child to include the natural or adopted child of the claimant's parent + or of that parent's spouse, and 416.1160(c)(2) and 416.1163(b) apply that definition in spouse-to-spouse deeming, + so the claimant's co-resident siblings and step-siblings receive allocations whether or not the parent lives there. + other: POMS SI 01310.140 A forms the spouse-to-spouse deeming household from the couple and the children of either + member, so only those children receive allocations. + example: In 2026 a claimant with no income, whose spouse has $1,000 of monthly unearned income and whose 15-year-old + brother lives with them, gets $994 a month of SSI with the brother's $497 allocation and $511 without it. pe_us: - follows: unknown + follows: statute code: + - policyengine_us/variables/gov/ssa/ssi/eligibility/income/deemed/from_ineligible_spouse/ssi_spousal_deeming_child_allocations.py - policyengine_us/variables/gov/ssa/ssi/eligibility/status/is_ssi_ineligible_child.py prs: - https://github.com/PolicyEngine/policyengine-us/pull/10146 - state: unreviewed - note: 'The open PR follows POMS rather than the broader regulatory reading; no statutory comparison or specific - ruling is supplied. Code not yet on main: ssi_spousal_deeming_child_allocations, ssi_ineligible_child_allocation.' + state: ruled + note: Follows the regulation. 416.1160(d) defines an ineligible child once for all deeming, 416.1160(c)(2) applies it + to spouse deemors, "you" is the claimant (416.1101), and a household is a place of residence (416.1132(a)). The + claimant's co-resident siblings, half-siblings and step-siblings get allocations; the spouse's siblings do not. + POMS SI 01310.140 A lists only the couple's children and is not followed. The code finds a sibling through a parent + id the claimant and the child share, and a step-sibling when the claimant's parent and that parent's spouse both + live in the household. It applies this scope in every year; the 1987 final rule is the earliest text checked. - id: us:standard-plan-minimum-consolidated program: student-loans years: @@ -16370,6 +16397,50 @@ candidates: - https://github.com/PolicyEngine/policyengine-us/pull/10815 state: ruled note: Follow the regulation and operational payment instructions over the plan's checkbox. The model caps summed hourly ceilings at the family's billed expenses because it records expenses for the SPM unit rather than separately for each child or provider. +- id: us:medicaid-parental-child-allocation-ssi-floor + program: medicaid + years: + from: 2015 + type: calendar + question: May a non-209(b) state exclude a child from optional aged, blind or disabled Medicaid parental allocations when SSI includes the child? + sources: + - kind: statute + citation: 42 USC 1396a(r)(2)(A)-(B) + url: https://www.govinfo.gov/content/pkg/USCODE-2024-title42/html/USCODE-2024-title42-chap7-subchapXIX-sec1396a.htm + - kind: regulation + citation: 42 CFR 435.601(d)(2)-(3) + url: https://www.ecfr.gov/current/title-42/section-435.601#p-435.601(d)(2) + - kind: manual + citation: New York Medicaid Reference Guide, Allocation, printed page 233 + url: https://healthweb-back.health.ny.gov/health_care/medicaid/reference/mrg/income.pdf#page=136 + - kind: manual + citation: Wisconsin Medicaid Eligibility Handbook 15.1.2 + url: https://www.emhandbooks.wisconsin.gov/meh-ebd/policy_files/15/15.1.htm + - kind: manual + citation: POMS SI 01715.020 + url: https://secure.ssa.gov/poms.nsf/lnx/0501715020 + - kind: regulation + citation: 42 CFR 435.602(b) + url: https://www.ecfr.gov/current/title-42/section-435.602#p-435.602(b) + - kind: regulation + citation: 20 CFR 416.1160(d) and 416.1856 + url: https://www.ecfr.gov/current/title-20/section-416.1160#p-416.1160(d) + - kind: guidance + citation: CMS State Medicaid Manual 3240.4 + url: https://www.cms.gov/regulations-and-guidance/guidance/manuals/downloads/p45_03.zip + readings: + statute: Non-209(b) states allocate for every child SSI does, because a narrower child definition removes allocations and so makes ineligible some people whom SSI's method finds eligible, a more restrictive methodology that 42 USC 1396a(r)(2) and 42 CFR 435.601(d)(2)-(3) bar. + other: State child definitions exclusively govern allocations, including New York's under-18 limit and Wisconsin's minor or dependent-18 limit and nonblind, nondisabled requirement. + pe_us: + follows: statute + code: + - policyengine_us/variables/gov/hhs/medicaid/income/deemed/from_ineligible_parent/medicaid_optional_senior_or_disabled_unearned_income_deemed_from_ineligible_parent_monthly.py + - policyengine_us/parameters/gov/hhs/medicaid/eligibility/categories/senior_or_disabled/income/deeming/ineligible_child_age_limit.yaml + - policyengine_us/parameters/gov/hhs/medicaid/eligibility/categories/senior_or_disabled/income/deeming/ineligible_child_requires_nonblind_nondisabled.yaml + prs: + - https://github.com/PolicyEngine/policyengine-us/pull/10146 + state: ruled + note: Follows the statute. A child definition narrower than SSI's removes allocations and so makes ineligible some people whom SSI's method finds eligible, which 42 USC 1396a(r)(2)(B) and 42 CFR 435.601(d)(3) bar outside 209(b) states. So the model does not apply New York's or Wisconsin's narrower manual definitions, and it can show eligibility those manuals would deny. Missouri (children under 18) and Virginia (children under 21 who are not blind or disabled), which POMS SI 01715.020 lists as 209(b) states, keep their manual child definitions under 42 USC 1396a(f). Their January 1, 1972 state plans are unchecked. - id: us-ut:medicaid-parent-standard-2018-cms-table program: medicaid years: