PolicyEngine / PolicyEngine/policyengine-uk
EFRS student_loan_repayments input overrides modelled repayment formula
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 50
- Forks
- 33
- Avg merge
- 20h 58m
- Merged PRs (30d)
- 14
Description
Summary
In policyengine-uk==2.88.43, student_loan_repayments is defined as a person-level wrapper around student_loan_repayment:
def formula(person, period, parameters):
return person("student_loan_repayment", period)
However, the local Enhanced FRS dataset appears to provide nonzero student_loan_repayments input values while student_loan_plan is NONE, so the wrapper formula is overridden by reported/input data and diverges from the modelled policy formula.
Local reproduction
Dataset: enhanced_frs_2023_24.h5
Year: 2026
Package versions: policyengine-core==3.26.11, policyengine-uk==2.88.43
Example loaded row:
{
"person_id": 17001,
"adjusted_net_income": 40662.203125,
"student_loan_plan": "NONE",
"student_loan_repayment": 0.0,
"student_loan_repayments": 1096.3065185546875,
}
Across the local EFRS run I saw:
student_loan_repayment: 0 nonzero peoplestudent_loan_repayments: 5,570 nonzero people
This means HBAI net income subtracts the reported student_loan_repayments input, while the modelled policy formula is zero for every person because no repayment plan is present.
Why this matters
For policy-based validation, the modelled student_loan_repayment formula can match a RuleSpec encoding exactly. But the HBAI component student_loan_repayments behaves like a reported fixed input in the local EFRS baseline, not like the wrapper formula in source. That makes it hard to treat student-loan repayments as a policy-responsive HBAI component.
Possible fixes
Options depending on intended semantics:
- Populate
student_loan_plan/related inputs in EFRS sostudent_loan_repaymentcan reproduce the reported repayment values. - Keep
student_loan_repaymentsas a reported baseline input but document/name it as such and avoid treating it as the modelled wrapper in policy comparisons. - Change HBAI net income to subtract the modelled formula variable when the goal is policy-responsive net income.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the student_loan_repayments and student_loan_repayment definitions, the HBAI net income calculation, and the enhanced_frs_2023_24.h5 inputs described in the issue. Reproduce the 2026 discrepancy and determine which semantics are intended; done means the selected data, naming, or calculation behavior is aligned and the reported/modelled values no longer diverge unexpectedly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100