Amortisation Module
calculating the principal balance over time, taking into account the effects of charges, interest and fee
Types and nested modules
Type/Module | Description |
a breakdown of how an actual payment is apportioned to principal, fee, interest and charges |
|
final statistics resulting from the calculations |
|
the day of the amortisation schedule, which can be a normal day, evaluation day or settlement day |
|
a schedule showing the amortisation, itemising the effects of payments and calculating balances for each item, and producing some final statistics resulting from the calculations |
|
amortisation schedule item showing apportionment of payments to principal, fee, interest and charges |
|
a container for aggregating figures separately from the main schedule |
|
a breakdown of how an actual payment is apportioned to principal, fee, interest and charges |
|
the status of the balance on a given offset day |
|
final statistics resulting from the calculations |
|
results of the amortisation schedule generation |
|
the day of the amortisation schedule, which can be a normal day, evaluation day or settlement day |
|
a schedule showing the amortisation, itemising the effects of payments and calculating balances for each item, and producing some final statistics resulting from the calculations |
|
amortisation schedule item showing apportionment of payments to principal, fee, interest and charges |
Functions and values
Function or value |
Description
|
Full Usage:
amortise p actualPayments
Parameters:
Parameters
actualPayments : Map<int<MeasureProduct<OffsetDay, MeasureOne>>, ActualPayment array>
Returns: GenerationResult
|
generates an amortisation schedule and final statistics
|
Full Usage:
apportionFee basicFeeConfig previousFeeBalance assignable principal feeTotal
Parameters:
BasicConfig voption
previousFeeBalance : int64<MeasureProduct<Cent, MeasureOne>>
assignable : int64<MeasureProduct<Cent, MeasureOne>>
principal : int64<MeasureProduct<Cent, MeasureOne>>
feeTotal : int64<MeasureProduct<Cent, MeasureOne>>
Returns: int64<MeasureProduct<Cent, MeasureOne>>
|
apportions the fee
|
Full Usage:
apportionInterest madePaymentTotal previousSettlementFigure cappedNewInterestM previousInterestBalance
Parameters:
int64<MeasureProduct<Cent, MeasureOne>>
previousSettlementFigure : int64<MeasureProduct<Cent, MeasureOne>>
cappedNewInterestM : decimal<MeasureProduct<Cent, MeasureOne>>
previousInterestBalance : decimal<MeasureProduct<Cent, MeasureOne>>
Returns: decimal<MeasureProduct<Cent, MeasureOne>>
|
apportions the interest
|
Full Usage:
calculateActuarialInterest p previous previousDay currentDay interestRounding
Parameters:
Parameters
previous : ScheduleItem
previousDay : int<MeasureProduct<OffsetDay, MeasureOne>>
currentDay : int<MeasureProduct<OffsetDay, MeasureOne>>
interestRounding : Rounding
Returns: decimal<MeasureProduct<Cent, MeasureOne>>
|
calculates actuarial interest between two days
|
Full Usage:
calculateFee feeTotal appliedPaymentDay originalFinalPaymentDay
Parameters:
int64<MeasureProduct<Cent, MeasureOne>>
appliedPaymentDay : int<MeasureProduct<OffsetDay, MeasureOne>>
originalFinalPaymentDay : int<MeasureProduct<OffsetDay, MeasureOne>>
Returns: int64<MeasureProduct<Cent, MeasureOne>>
|
calculates the total fee payable up to a particular day, based on a proportion of days elapsed vs total number of days in the original schedule
|
Full Usage:
calculateFeeRebate advancedFeeConfig scheduleConfig startDate feeTotal currentDay cumulativeFee
Parameters:
AdvancedConfig voption
scheduleConfig : ScheduleConfig
startDate : Date
feeTotal : int64<MeasureProduct<Cent, MeasureOne>>
currentDay : int<MeasureProduct<OffsetDay, MeasureOne>>
cumulativeFee : int64<MeasureProduct<Cent, MeasureOne>>
Returns: int64<MeasureProduct<Cent, MeasureOne>>
|
determines the value of any fee rebate in the event of settlement, depending on settings
|
Full Usage:
calculateFinalInterestReduction currentDay maxAppliedPaymentDay appliedPaymentCount interestM
Parameters:
int<MeasureProduct<OffsetDay, MeasureOne>>
maxAppliedPaymentDay : int<MeasureProduct<OffsetDay, MeasureOne>>
appliedPaymentCount : uint
interestM : decimal<MeasureProduct<Cent, MeasureOne>>
Returns: decimal<MeasureProduct<Cent, MeasureOne>>
|
ignores small amounts of interest that have accumulated by the last day of the schedule, with the allowance being proportional to the length of the schedule
|
Full Usage:
calculateInterestAdjustment previousBalanceStatus currentGeneratedPayment settlement cappedNewInterestM cumulativeActuarialInterestM initialInterestBalanceM basicParameters
Parameters:
BalanceStatus
currentGeneratedPayment : GeneratedPayment
settlement : int64<MeasureProduct<Cent, MeasureOne>>
cappedNewInterestM : decimal<MeasureProduct<Cent, MeasureOne>>
cumulativeActuarialInterestM : decimal<MeasureProduct<Cent, MeasureOne>>
initialInterestBalanceM : decimal<MeasureProduct<Cent, MeasureOne>>
basicParameters : BasicParameters
Returns: decimal<MeasureProduct<Cent, MeasureOne>>
|
calculates any new interest accrued since the previous item, according to the interest method supplied in the schedule parameters
|
Full Usage:
calculateNewInterest interestMethod previousBalanceStatus cumulativeActuarialInterestM cappedActuarialInterestM initialInterestBalanceM actuarialInterestM
Parameters:
Method
previousBalanceStatus : BalanceStatus
cumulativeActuarialInterestM : decimal<MeasureProduct<Cent, MeasureOne>>
cappedActuarialInterestM : decimal<MeasureProduct<Cent, MeasureOne>>
initialInterestBalanceM : decimal<MeasureProduct<Cent, MeasureOne>>
actuarialInterestM : decimal<MeasureProduct<Cent, MeasureOne>>
Returns: decimal<MeasureProduct<Cent, MeasureOne>>
|
calculates new interest based on the interest method
|
Full Usage:
calculatePaymentDue si originalPayment rescheduledPayment extraPaymentsBalance interestPortionL minimumPayment
Parameters:
ScheduleItem
originalPayment : int64<MeasureProduct<Cent, MeasureOne>> voption
rescheduledPayment : RescheduledPayment voption
extraPaymentsBalance : int64<MeasureProduct<Cent, MeasureOne>>
interestPortionL : int64<MeasureProduct<Cent, MeasureOne>>
minimumPayment : MinimumPayment
Returns: int64<MeasureProduct<Cent, MeasureOne>>
|
determines any payment due on the day
|
Full Usage:
calculateStats items
Parameters:
Map<int<MeasureProduct<OffsetDay, MeasureOne>>, ScheduleItem>
Returns: Schedule
|
wraps the amortisation schedule in some statistics, and optionally calculates the final APR (optional because it can be processor-intensive)
|
Full Usage:
calculateStatutoryFeeRebate bp appliedPayments initialStats appliedPaymentDay window
Parameters:
BasicParameters
appliedPayments : Map<int<MeasureProduct<OffsetDay, MeasureOne>>, AppliedPayment>
initialStats : InitialStats
appliedPaymentDay : int<MeasureProduct<OffsetDay, MeasureOne>>
window : int
Returns: int64<MeasureProduct<Cent, MeasureOne>>
|
for UK FCA-regulated agreements, calculates the fee rebate due
|
Full Usage:
createInitialScheduleItem startDate principal fee interest advancedFeeConfig
Parameters:
Date
principal : int64<MeasureProduct<Cent, MeasureOne>>
fee : int64<MeasureProduct<Cent, MeasureOne>>
interest : decimal<MeasureProduct<Cent, MeasureOne>>
advancedFeeConfig : AdvancedConfig voption
Returns: ScheduleItem
|
|
Full Usage:
createInitialTotals interest
Parameters:
decimal<MeasureProduct<Cent, MeasureOne>>
Returns: Accumulator
|
|
Full Usage:
deduplicateDay0 a
Parameters:
(int<MeasureProduct<OffsetDay, MeasureOne>> * ScheduleItem) array
Returns: (int<MeasureProduct<OffsetDay, MeasureOne>> * ScheduleItem) array
|
|
Full Usage:
feePercentage principal feeTotal
Parameters:
int64<MeasureProduct<Cent, MeasureOne>>
feeTotal : int64<MeasureProduct<Cent, MeasureOne>>
Returns: Percent
|
calculates the fee total as a percentage of the principal, for further calculation (weighting payments made when apportioning to fee and principal)
|
Full Usage:
getAdvances currentDay principal
Parameters:
int<MeasureProduct<OffsetDay, MeasureOne>>
principal : 'a
Returns: 'a[]
|
gets an array of advances note: assumes single advance on day 0 (multiple advances are not currently supported), so this is based purely on the principal
|
Full Usage:
getBalanceStatus principalBalance previousBalanceStatus
Parameters:
int64<MeasureProduct<Cent, MeasureOne>>
previousBalanceStatus : BalanceStatus
Returns: BalanceStatus
|
gets the balance status based on the principal balance
|
Full Usage:
getDailyInterestRates p fromDay toDay
Parameters:
Parameters
fromDay : int<MeasureProduct<OffsetDay, MeasureOne>>
toDay : int<MeasureProduct<OffsetDay, MeasureOne>>
Returns: DailyRate array
|
|
Full Usage:
getWindow unitPeriodMap currentDay currentScheduledPayment previousWindow
Parameters:
Map<'a, int> option
currentDay : 'a
currentScheduledPayment : ScheduledPayment
previousWindow : int
Returns: int
|
gets the window for the current day based on either the unit-period map or the previous window
|
|
determines whether a schedule is settled within any grace period (e.g. no interest may be due if settlement is made within three days of the advance)
|
Full Usage:
mapUnitPeriods scheduleConfig startDate maxAppliedPaymentDay
Parameters:
ScheduleConfig
startDate : Date
maxAppliedPaymentDay : int<MeasureProduct<OffsetDay, MeasureOne>>
Returns: Map<int<MeasureProduct<OffsetDay, MeasureOne>>, int> option
|
get the unit period and project it over the schedule to determine the amortisation windows
|
Full Usage:
markMissedPaymentsAsLate schedule
Parameters:
(int<MeasureProduct<OffsetDay, MeasureOne>> * ScheduleItem) array
Returns: Map<int<MeasureProduct<OffsetDay, MeasureOne>>, ScheduleItem>
|
modifies missed payments or underpayments to reflect whether they are paid later in full or part or not at all within the payment window note: this is useful for credit reporting so as not to penalise those who pay late rather than not at all
|
Active patterns
Active pattern |
Description
|
Full Usage:
(|NotPaidAtAll|SomePaid|FullyPaid|) (actualPaymentTotal, paymentDueTotal)
Parameters:
int64<MeasureProduct<Cent, MeasureOne>>
paymentDueTotal : int64<MeasureProduct<Cent, MeasureOne>>
Returns: Choice<unit, int64<MeasureProduct<Cent, MeasureOne>>, unit>
|
pattern matching for payments due vs payments made
|