New module: StudentLoan.fs — UK Plans 1/2/4/5 and US IBR income-contingent repayment - #63
Draft
simontreanor with Copilot wants to merge 2 commits into
Draft
simontreanor with Copilot wants to merge 2 commits into
simontreanor with Copilot wants to merge 2 commits into
Conversation
Agent-Logs-Url: https://github.com/simontreanor/FSharp.Finance.Personal/sessions/14a133ec-96a4-4caf-90d1-cc446c7d463a Co-authored-by: simontreanor <4550815+simontreanor@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add new module to model student loan repayments
New module: StudentLoan.fs — UK Plans 1/2/4/5 and US IBR income-contingent repayment
Apr 28, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
StudentLoanmodule modelling income-contingent student loan repayments for UK Plans 1, 2, 4, and 5 and the US IBR scheme.Types
Plan—UkPlan1 | UkPlan2 | UkPlan4 | UkPlan5 | UsIbrRepaymentRate— percentage of income above threshold applied annuallyThresholdUprating—Fixed | Rpi | GovernmentPolicyInterestMethod—NoInterest | Fixed | RpiOnly | RpiPlusScaledMargin(Plan 2 linearly scales from RPI to RPI+3% between ~£27,295–£49,130)WriteOffCondition— years until remaining balance is written offWriteOffEstimate—FullyRepaid of year | PartialWriteOff of remainingBalanceProjectionYear— annual snapshot (income, threshold, repayment, interest charged, closing balance)Core functions
planDefaults— returns(RepaymentRate, WriteOffCondition, InterestMethod)for a given plan and RPI rateannualRepayment—rate% × max(income − threshold, 0)annualInterestRate— resolves the applicable rate for a given income andInterestMethoduprateThreshold— applies RPI or policy-rate upratingprojectBalance— builds aProjectionYear arrayup to write-off or full repaymentestimatedWriteOff— top-level summary returningFullyRepaidorPartialWriteOffExample
All monetary values follow the existing
int64<Cent>convention; percentages useCalculation.Percent.