PolicyEngine / PolicyEngine/policyengine-uk

EFRS student_loan_repayments input overrides modelled repayment formula

Open
#1,764 0 comments 0 reactions 0 assignees View on GitHub

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 people
  • student_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:

  1. Populate student_loan_plan/related inputs in EFRS so student_loan_repayment can reproduce the reported repayment values.
  2. Keep student_loan_repayments as a reported baseline input but document/name it as such and avoid treating it as the modelled wrapper in policy comparisons.
  3. Change HBAI net income to subtract the modelled formula variable when the goal is policy-responsive net income.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.