Prepayment Classes

BasePrepayment

class cred.BasePrepayment
required_repayment(borrowing, dt)

Calculate the prepayment amount. Called by PeriodicBorrowings to calculate prepayment. Must be implemented by subclasses.

Parameters:
  • borrowing (PeriodicBorrowing) – Borrowing to use in calculating prepayment amount
  • dt (datetime) – Date of repayment
Returns:

Return type:

float

Defeasance

class cred.Defeasance(df_func, open_dt_offset=None, dfz_to_open=False, period_breakage='full_period')
open_date(borrowing)

Open date for borrowing

required_repayment(borrowing, dt)

Return the total estimated cost of replacement collateral

OpenPrepayment

class cred.OpenPrepayment(period_breakage='full_period')
net_accrued_interest(borrowing, dt)

Accrued but interest during the period in which dt falls. Calculates interest from and including the first day of the period, to but excluding dt net of any amount already paid.

required_repayment(borrowing, dt)

Return required repayment amount based on open prepayment.

unpaid_and_current_period_interest(borrowing, dt)

Unpaid interest including interest due on dt plus interest accruing through the end of the period in which dt falls.

unpaid_interest(borrowing, dt)

Unpaid interest, including interest due on dt.

StepDown

class cred.StepDown(expiration_offsets, premiums, period_breakage='full_period')
expiration_dates(borrowing)

Premium expiration dates adjusted for payment date business days by applying the expiration offsets to the borrowing’s first regular period start date.

ppmt_premium(borrowing, dt)

The prepayment premium for prepaying on dt.

premium_pct(borrowing, dt)

The premium at dt expressed as a percent in decimal form of the then outstanding balance.

required_repayment(borrowing, dt)

Required amount to prepay the borrowing at the given date.

SimpleYieldMaintenance

class cred.SimpleYieldMaintenance(rate_func, margin=0.0, wal_rate=False, open_dt_offset=None, ym_to_open=False, min_penalty=None, period_breakage='full_period')
discount_factors(borrowing, dt)

Discount factors used to calculate yield maintenance.

discount_rate(borrowing, dt)

Discount rate for yield maintenance at date.

discount_rate_term(borrowing, dt)

Return the number of days used to calculate the term of the discount rate. If wal_rate is True, returns the weight avgerage number of remaining days. If ym_to_open is True, calculates (weighted avg) days to the open date rather than the maturity date.

open_date(borrowing)

Open date for borrowing.

remaining_pmts(borrowing, dt)

Principal and interest payments from dt to maturity, or the open date if ym_to_open is True. Based on period end dates. The last payment will include all outstanding principal and accrued interest. Return value is a dict of {pmt_date: pmt} pairs.

required_repayment(borrowing, dt)

Return required repayment amount based on open prepayment.