Header menu logo FSharp.Finance.Personal

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

Apportionment (Module)

a breakdown of how an actual payment is apportioned to principal, fee, interest and charges

FinalStats (Module)

final statistics resulting from the calculations

OffsetDayType (Module)

the day of the amortisation schedule, which can be a normal day, evaluation day or settlement day

Schedule (Module)

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

ScheduleItem (Module)

amortisation schedule item showing apportionment of payments to principal, fee, interest and charges

Accumulator

a container for aggregating figures separately from the main schedule

Apportionment (Type)

a breakdown of how an actual payment is apportioned to principal, fee, interest and charges

BalanceStatus

the status of the balance on a given offset day

FinalStats (Type)

final statistics resulting from the calculations

GenerationResult

results of the amortisation schedule generation

OffsetDayType (Type)

the day of the amortisation schedule, which can be a normal day, evaluation day or settlement day

Schedule (Type)

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

ScheduleItem (Type)

amortisation schedule item showing apportionment of payments to principal, fee, interest and charges

Functions and values

Function or value Description

amortise p actualPayments

Full Usage: amortise p actualPayments

Parameters:
Returns: GenerationResult

generates an amortisation schedule and final statistics

p : Parameters
actualPayments : Map<int<MeasureProduct<OffsetDay, MeasureOne>>, ActualPayment array>
Returns: GenerationResult

apportionFee basicFeeConfig previousFeeBalance assignable principal feeTotal

Full Usage: apportionFee basicFeeConfig previousFeeBalance assignable principal feeTotal

Parameters:
Returns: int64<MeasureProduct<Cent, MeasureOne>>

apportions the fee

basicFeeConfig : 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>>

apportionInterest madePaymentTotal previousSettlementFigure cappedNewInterestM previousInterestBalance

Full Usage: apportionInterest madePaymentTotal previousSettlementFigure cappedNewInterestM previousInterestBalance

Parameters:
Returns: decimal<MeasureProduct<Cent, MeasureOne>>

apportions the interest

madePaymentTotal : int64<MeasureProduct<Cent, MeasureOne>>
previousSettlementFigure : int64<MeasureProduct<Cent, MeasureOne>>
cappedNewInterestM : decimal<MeasureProduct<Cent, MeasureOne>>
previousInterestBalance : decimal<MeasureProduct<Cent, MeasureOne>>
Returns: decimal<MeasureProduct<Cent, MeasureOne>>

calculateActuarialInterest p previous previousDay currentDay interestRounding

Full Usage: calculateActuarialInterest p previous previousDay currentDay interestRounding

Parameters:
Returns: decimal<MeasureProduct<Cent, MeasureOne>>

calculates actuarial interest between two days

p : Parameters
previous : ScheduleItem
previousDay : int<MeasureProduct<OffsetDay, MeasureOne>>
currentDay : int<MeasureProduct<OffsetDay, MeasureOne>>
interestRounding : Rounding
Returns: decimal<MeasureProduct<Cent, MeasureOne>>

calculateFee feeTotal appliedPaymentDay originalFinalPaymentDay

Full Usage: calculateFee feeTotal appliedPaymentDay originalFinalPaymentDay

Parameters:
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

feeTotal : int64<MeasureProduct<Cent, MeasureOne>>
appliedPaymentDay : int<MeasureProduct<OffsetDay, MeasureOne>>
originalFinalPaymentDay : int<MeasureProduct<OffsetDay, MeasureOne>>
Returns: int64<MeasureProduct<Cent, MeasureOne>>

calculateFeeRebate advancedFeeConfig scheduleConfig startDate feeTotal currentDay cumulativeFee

Full Usage: calculateFeeRebate advancedFeeConfig scheduleConfig startDate feeTotal currentDay cumulativeFee

Parameters:
Returns: int64<MeasureProduct<Cent, MeasureOne>>

determines the value of any fee rebate in the event of settlement, depending on settings

advancedFeeConfig : 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>>

calculateFinalInterestReduction currentDay maxAppliedPaymentDay appliedPaymentCount interestM

Full Usage: calculateFinalInterestReduction currentDay maxAppliedPaymentDay appliedPaymentCount interestM

Parameters:
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

currentDay : int<MeasureProduct<OffsetDay, MeasureOne>>
maxAppliedPaymentDay : int<MeasureProduct<OffsetDay, MeasureOne>>
appliedPaymentCount : uint
interestM : decimal<MeasureProduct<Cent, MeasureOne>>
Returns: decimal<MeasureProduct<Cent, MeasureOne>>

calculateInterestAdjustment previousBalanceStatus currentGeneratedPayment settlement cappedNewInterestM cumulativeActuarialInterestM initialInterestBalanceM basicParameters

Full Usage: calculateInterestAdjustment previousBalanceStatus currentGeneratedPayment settlement cappedNewInterestM cumulativeActuarialInterestM initialInterestBalanceM basicParameters

Parameters:
Returns: decimal<MeasureProduct<Cent, MeasureOne>>

calculates any new interest accrued since the previous item, according to the interest method supplied in the schedule parameters

previousBalanceStatus : 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>>

calculateNewInterest interestMethod previousBalanceStatus cumulativeActuarialInterestM cappedActuarialInterestM initialInterestBalanceM actuarialInterestM

Full Usage: calculateNewInterest interestMethod previousBalanceStatus cumulativeActuarialInterestM cappedActuarialInterestM initialInterestBalanceM actuarialInterestM

Parameters:
Returns: decimal<MeasureProduct<Cent, MeasureOne>>

calculates new interest based on the interest method

interestMethod : 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>>

calculatePaymentDue si originalPayment rescheduledPayment extraPaymentsBalance interestPortionL minimumPayment

Full Usage: calculatePaymentDue si originalPayment rescheduledPayment extraPaymentsBalance interestPortionL minimumPayment

Parameters:
Returns: int64<MeasureProduct<Cent, MeasureOne>>

determines any payment due on the day

si : 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>>

calculateStats items

Full Usage: calculateStats items

Parameters:
Returns: Schedule

wraps the amortisation schedule in some statistics, and optionally calculates the final APR (optional because it can be processor-intensive)

items : Map<int<MeasureProduct<OffsetDay, MeasureOne>>, ScheduleItem>
Returns: Schedule

calculateStatutoryFeeRebate bp appliedPayments initialStats appliedPaymentDay window

Full Usage: calculateStatutoryFeeRebate bp appliedPayments initialStats appliedPaymentDay window

Parameters:
Returns: int64<MeasureProduct<Cent, MeasureOne>>

for UK FCA-regulated agreements, calculates the fee rebate due

bp : BasicParameters
appliedPayments : Map<int<MeasureProduct<OffsetDay, MeasureOne>>, AppliedPayment>
initialStats : InitialStats
appliedPaymentDay : int<MeasureProduct<OffsetDay, MeasureOne>>
window : int
Returns: int64<MeasureProduct<Cent, MeasureOne>>

createInitialScheduleItem startDate principal fee interest advancedFeeConfig

Full Usage: createInitialScheduleItem startDate principal fee interest advancedFeeConfig

Parameters:
Returns: ScheduleItem
startDate : Date
principal : int64<MeasureProduct<Cent, MeasureOne>>
fee : int64<MeasureProduct<Cent, MeasureOne>>
interest : decimal<MeasureProduct<Cent, MeasureOne>>
advancedFeeConfig : AdvancedConfig voption
Returns: ScheduleItem

createInitialTotals interest

Full Usage: createInitialTotals interest

Parameters:
Returns: Accumulator

deduplicateDay0 a

Full Usage: deduplicateDay0 a

Parameters:
Returns: (int<MeasureProduct<OffsetDay, MeasureOne>> * ScheduleItem) array

feePercentage principal feeTotal

Full Usage: feePercentage principal feeTotal

Parameters:
Returns: Percent

calculates the fee total as a percentage of the principal, for further calculation (weighting payments made when apportioning to fee and principal)

principal : int64<MeasureProduct<Cent, MeasureOne>>
feeTotal : int64<MeasureProduct<Cent, MeasureOne>>
Returns: Percent

getAdvances currentDay principal

Full Usage: getAdvances currentDay principal

Parameters:
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

currentDay : int<MeasureProduct<OffsetDay, MeasureOne>>
principal : 'a
Returns: 'a[]

getBalanceStatus principalBalance previousBalanceStatus

Full Usage: getBalanceStatus principalBalance previousBalanceStatus

Parameters:
Returns: BalanceStatus

gets the balance status based on the principal balance

principalBalance : int64<MeasureProduct<Cent, MeasureOne>>
previousBalanceStatus : BalanceStatus
Returns: BalanceStatus

getDailyInterestRates p fromDay toDay

Full Usage: getDailyInterestRates p fromDay toDay

Parameters:
Returns: DailyRate array

getWindow unitPeriodMap currentDay currentScheduledPayment previousWindow

Full Usage: getWindow unitPeriodMap currentDay currentScheduledPayment previousWindow

Parameters:
    unitPeriodMap : 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

unitPeriodMap : Map<'a, int> option
currentDay : 'a
currentScheduledPayment : ScheduledPayment
previousWindow : int
Returns: int

isSettledWithinGracePeriod p

Full Usage: isSettledWithinGracePeriod p

Parameters:
Returns: bool

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)

p : Parameters
Returns: bool

mapUnitPeriods scheduleConfig startDate maxAppliedPaymentDay

Full Usage: mapUnitPeriods scheduleConfig startDate maxAppliedPaymentDay

Parameters:
Returns: Map<int<MeasureProduct<OffsetDay, MeasureOne>>, int> option

get the unit period and project it over the schedule to determine the amortisation windows

scheduleConfig : ScheduleConfig
startDate : Date
maxAppliedPaymentDay : int<MeasureProduct<OffsetDay, MeasureOne>>
Returns: Map<int<MeasureProduct<OffsetDay, MeasureOne>>, int> option

markMissedPaymentsAsLate schedule

Full Usage: markMissedPaymentsAsLate schedule

Parameters:
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

schedule : (int<MeasureProduct<OffsetDay, MeasureOne>> * ScheduleItem) array
Returns: Map<int<MeasureProduct<OffsetDay, MeasureOne>>, ScheduleItem>

Active patterns

Active pattern Description

(|NotPaidAtAll|SomePaid|FullyPaid|) (actualPaymentTotal, paymentDueTotal)

Full Usage: (|NotPaidAtAll|SomePaid|FullyPaid|) (actualPaymentTotal, paymentDueTotal)

Parameters:
Returns: Choice<unit, int64<MeasureProduct<Cent, MeasureOne>>, unit>

pattern matching for payments due vs payments made

actualPaymentTotal : int64<MeasureProduct<Cent, MeasureOne>>
paymentDueTotal : int64<MeasureProduct<Cent, MeasureOne>>
Returns: Choice<unit, int64<MeasureProduct<Cent, MeasureOne>>, unit>

Type something to start searching.