Rates.ConstantDiscountRateCurveFactory¶
Classes
CalendarTimeMeasure(base_date: datetime.date) |
Class to compute the duration in years between two dates using a 365 days per yer convention. |
ConstantDiscountRateCurveFactory(...) |
Class to create a discount rate curve corresponding to a constant instantaneous interest rate. |
RateCurveId(id) |
Container class to identify a discount rate curve. |
RawDiscountRateCurve(...) |
Container class to describe a discount rate curve. |
date |
date(year, month, day) –> date object |
timedelta |
Difference between two datetime values. |
-
class
Rates.ConstantDiscountRateCurveFactory.ConstantDiscountRateCurveFactory(value_date: datetime.date)[source]¶ Class to create a discount rate curve corresponding to a constant instantaneous interest rate.
Parameters: value_date : Date
The quotation date corresponding to the discount rate curve.
Methods
build((periodicity: datetime.timedelta, ...)Create a discount rate curve corresponding to a constant instantaneous interest rate. -
build(periodicity: datetime.timedelta, end_date: datetime.date, interest_rate: float) → Rates.RawDiscountRateCurve.RawDiscountRateCurve[source]¶ Create a discount rate curve corresponding to a constant instantaneous interest rate.
Parameters: periodicity : timedelta
The discretization of the discount rate curve in terms of duration.
end_date : date
The last maturity of the discount rate curve.
interest_rate : float
The constant instantaneous interest rate.
Examples
>>> from Rates.ConstantDiscountRateCurveFactory import ConstantDiscountRateCurveFactory >>> from datetime import date >>> from datetime import timedelta >>> value_date = date(2017,5,7) >>> rate_curve_factory = ConstantDiscountRateCurveFactory(value_date) >>> periodicity = timedelta(days=90) >>> end_date = date(2019,5,7) >>> interest_rate = 0.01 >>> rate_curve = rate_curve_factory.build(periodicity, end_date, interest_rate) >>> print(rate_curve.discount_factors[2]) 0.992630032118
-