Skip to content

Tighten maintenance loan proxy logic#1587

Merged
MaxGhenis merged 3 commits intomainfrom
fix-560-maintenance-loans-followup
Apr 14, 2026
Merged

Tighten maintenance loan proxy logic#1587
MaxGhenis merged 3 commits intomainfrom
fix-560-maintenance-loans-followup

Conversation

@MaxGhenis
Copy link
Copy Markdown
Collaborator

Summary

  • split maintenance loan eligibility into explicit helper variables for England-system scope and higher-education evidence
  • tighten the sponsor, living-arrangement, and assessed-household-income proxies using a fast two-candidate adult proxy plus sponsor benefit-unit income
  • add focused policy and Python regression coverage for higher-education evidence precedence and sponsor-income edge cases

Validation

  • uv run policyengine-core test policyengine_uk/tests/policy/baseline/gov/dfe/maintenance_loans/maintenance_loan.yaml
  • uv run pytest -q policyengine_uk/tests/test_maintenance_loan_proxies.py
  • full 2025 maintenance-loan chain on enhanced_frs_2023_24.h5: candidate benunit income 0.02s, sponsor detection 0.05s, sponsor income 0.01s, household income 0.01s, award 0.02s

Aggregate Impact

Measured on enhanced_frs_2023_24.h5 at 2025, comparing merged #1586 against this branch on current weights.

  • maintenance_loan mean: 143.9555 -> 162.5093 (+18.5539, +12.9%)
  • maintenance_loan recipient mean: 8057.7370 -> 9096.2669 (+1038.5298, +12.9%)
  • maintenance_loan recipient rate: unchanged at 1.78655%
  • household_tax mean: unchanged at 24904.1915
  • hbai_household_net_income mean: unchanged at 44999.9928
  • relative poverty AHC: unchanged at 21.4478%
  • relative poverty BHC: unchanged at 17.2909%

Caveat

  • maintenance_loan_in_england_system still proxies Student Finance England membership from current household country, so cross-border domicile cases remain approximate.

@MaxGhenis MaxGhenis force-pushed the fix-560-maintenance-loans-followup branch from 644f3f8 to fe67280 Compare April 13, 2026 23:38
@MaxGhenis MaxGhenis force-pushed the fix-560-maintenance-loans-followup branch from fe67280 to b954ddb Compare April 13, 2026 23:39
@MaxGhenis
Copy link
Copy Markdown
Collaborator Author

2025 aggregate impact on current weights versus merged :\n\n- mean: (, )\n- recipient mean: (, )\n- recipient rate: unchanged at \n- mean: unchanged at \n- mean: unchanged at \n- relative poverty AHC: unchanged at \n- relative poverty BHC: unchanged at \n\nLocal validation on the final rebased head:\n- WARNING:policyengine_core.scripts:Several country packages detected : policyengine_uk, policyengine_core.country_template. Using policyengine_uk by default. To use another package, please use the --country-package option.
============================= test session starts ==============================
platform darwin -- Python 3.13.9, pytest-8.4.1, pluggy-1.6.0
rootdir: /Users/maxghenis/worktrees/policyengine-uk-fix-560-followup
configfile: pyproject.toml
collected 21 items

policyengine_uk/tests/policy/baseline/gov/dfe/maintenance_loans/maintenance_loan.yaml .....................

============================== 21 passed in 0.20s ==============================\n- ..... [100%]
=============================== warnings summary ===============================
.venv/lib/python3.13/site-packages/pydantic/_internal/_config.py:323
/Users/maxghenis/worktrees/policyengine-uk-fix-560-followup/.venv/lib/python3.13/site-packages/pydantic/_internal/_config.py:323: PydanticDeprecatedSince20: Support for class-based config is deprecated, use ConfigDict instead. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.11/migration/
warnings.warn(DEPRECATION_MESSAGE, DeprecationWarning)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
5 passed, 1 warning in 2.20s\n\nThe remaining known approximation is that still proxies Student Finance England membership from current household country, so cross-border domicile cases remain approximate.

@MaxGhenis
Copy link
Copy Markdown
Collaborator Author

Dataset-backed aggregate check on enhanced_frs_2023_24.h5 at 2025, comparing merged #1586 against this follow-up branch on the same current weights:

  • maintenance_loan mean: 143.96 -> 162.51 (+18.55, +12.9%)
  • maintenance_loan recipient rate: 1.78655% -> 1.78655% (no change)
  • maintenance_loan recipient mean: £8,057.74 -> £9,096.27 (+£1,038.53, +12.9%)

The broader household aggregates I checked were unchanged to displayed precision:

  • household_tax mean: no change
  • hbai_household_net_income mean: no change
  • relative poverty BHC: no change
  • relative poverty AHC: no change

So the follow-up is tightening the maintenance-loan proxy and raising award amounts for the same modeled recipient pool, without moving the broader tax/poverty aggregates on current weights.

@MaxGhenis MaxGhenis marked this pull request as ready for review April 14, 2026 01:03
@MaxGhenis MaxGhenis merged commit 181afd2 into main Apr 14, 2026
2 checks passed
@MaxGhenis MaxGhenis deleted the fix-560-maintenance-loans-followup branch April 14, 2026 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant