Rates.IDiscountRateCurveInterpolator

Classes

IDiscountRateCurveInterpolator General interface to interpolate a discount rate curve.
date date(year, month, day) –> date object
class Rates.IDiscountRateCurveInterpolator.IDiscountRateCurveInterpolator[source]

General interface to interpolate a discount rate curve. See Also ——– LogCubicSplineDiscountRateCurveInterpolator: LogCubicSplineDiscountRateCurveInterpolator

Methods

discount_factor(...) Compute the discount factor for a given maturity.
linear_rate((maturity: datetime.date) -> float) Compute the linear rate for a given maturity defined by \(ln(Df(0,T))/T\) where \(Df(0,T)\) is the discount factor for maturity \(T\).
discount_factor(maturity: datetime.date) → float[source]

Compute the discount factor for a given maturity.

Parameters:

maturity : date

Maturity of the cash flow to be discounted.

Returns:

discount_factor : float

The quantity \(D(t,T)\) that depend on a present instant \(t\) and a future date \(T\) so that a cash flow \(C_T\) paid at time \(T\) has value \(D(t,T)C_T\)

linear_rate(maturity: datetime.date) → float[source]

Compute the linear rate for a given maturity defined by \(ln(Df(0,T))/T\) where \(Df(0,T)\) is the discount factor for maturity \(T\).

Parameters:

maturity : date

Maturity of the linear rate.

Returns:

linear_rate : float

The quantity \(L(t,T)\) that depend on a present instant \(t\) and a future date \(T\) so that borrowing 1 unit of cash at time \(t\) and returning it back at time \(T\) costs \(L(t,T)\delta_(t,T)\) units of cash with \(\delta(t,T)\) being the year fraction between time \(t\) and \(T\)