Options
All
  • Public
  • Public/Protected
  • All
Menu

Concrete interest rate class

This class encapsulate the interest rate compounding algebra. It manages day-counting conventions, compounding conventions, conversion between different conventions, discount/compound factor calculations, and implied/equivalent rate calculations.

test

Converted rates are checked against known good results

Hierarchy

  • InterestRate

Implements

Index

Constructors

constructor

Properties

Private _comp

Private _dc

Private _freq

_freq: Real

Private _freqMakesSense

_freqMakesSense: boolean

Private _r

_r: Rate = QL_NULL_REAL

Methods

compoundFactor1

  • compound factor implied by the rate compounded at time t.

    returns the compound (a.k.a capitalization) factor implied by the rate compounded at time t.

    warning Time must be measured using InterestRate's own day counter.

    Parameters

    Returns Real

compoundFactor2

  • compoundFactor2(d1: Date, d2: Date, refStart?: Date, refEnd?: Date): Real
  • compound factor implied by the rate compounded between two dates returns the compound (a.k.a capitalization) factor implied by the rate compounded between two dates.

    Parameters

    • d1: Date
    • d2: Date
    • Default value refStart: Date = null
    • Default value refEnd: Date = null

    Returns Real

compounding

dayCounter

  • Returns DayCounter

discountFactor1

  • discount factor implied by the rate compounded at time t.

    warning Time must be measured using InterestRate's own day counter.

    Parameters

    Returns Real

discountFactor2

  • discountFactor2(d1: Date, d2: Date, refStart?: Date, refEnd?: Date): DiscountFactor
  • discount factor implied by the rate compounded between two dates

    Parameters

    • d1: Date
    • d2: Date
    • Default value refStart: Date = null
    • Default value refEnd: Date = null

    Returns DiscountFactor

equivalentRate1

  • equivalent interest rate for a compounding period t.

    The resulting InterestRate shares the same implicit day-counting rule of the original InterestRate instance.

    warning Time must be measured using the InterestRate's own day counter.

    Parameters

    Returns InterestRate

equivalentRate2

  • equivalent rate for a compounding period between two dates

    The resulting rate is calculated taking the required day-counting rule into account.

    Parameters

    Returns InterestRate

f

frequency

  • Returns Frequency

rate

  • Returns Rate

toString

  • toString(): string
  • Returns string

Static impliedRate1

  • implied interest rate for a given compound factor at a given time.

    The resulting InterestRate has the day-counter provided as input.

    warning Time must be measured using the day-counter provided as input.

    Parameters

    Returns InterestRate

Static impliedRate2

  • implied rate for a given compound factor between two dates.

    The resulting rate is calculated taking the required day-counting rule into account.

    Parameters

    Returns InterestRate