File tree Expand file tree Collapse file tree
policyengine_uk/variables/gov/hmrc/student_loans Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,20 +17,21 @@ class plan_2_interest_rate(Variable):
1717
1818 def formula (person , period , parameters ):
1919 income = person ("adjusted_net_income" , period )
20- sl = parameters (period ).gov .hmrc .student_loans
21- rpi = parameters (period ).gov .economic_assumptions .yoy_growth .obr .rpi
20+ p = parameters (period ).gov
2221
2322 # Per Regulation 21AB, lower interest threshold = repayment threshold
24- lower_threshold = sl .thresholds .plan_2
25- upper_threshold = sl .interest_rates .plan_2 .upper_threshold
26- additional_rate = sl .interest_rates .plan_2 .additional_rate
27-
2823 # Below lower threshold: RPI only
2924 # Above upper threshold: RPI + 3%
3025 # Between: linear taper
3126 taper_fraction = np .clip (
32- (income - lower_threshold ) / (upper_threshold - lower_threshold ),
27+ (income - p .hmrc .student_loans .thresholds .plan_2 )
28+ / (
29+ p .hmrc .student_loans .interest_rates .plan_2 .upper_threshold
30+ - p .hmrc .student_loans .thresholds .plan_2
31+ ),
3332 0 ,
3433 1 ,
3534 )
36- return rpi + (additional_rate * taper_fraction )
35+ return p .economic_assumptions .yoy_growth .obr .rpi + (
36+ p .hmrc .student_loans .interest_rates .plan_2 .additional_rate * taper_fraction
37+ )
You can’t perform that action at this time.
0 commit comments