quantlib.termstructures.yields.piecewise_yield_curve.DiscountCubicPiecewiseYieldCurve.forward_rate

DiscountCubicPiecewiseYieldCurve.forward_rate(self, d1, d2, DayCounter day_counter=None, Compounding compounding=Compounding.Continuous, int frequency=Annual, bool extrapolate=False)

Returns the forward interest rate between two dates or times.

In the former case, times are calculated as fractions of year from the reference date. If both dates (times) are equal the instantaneous forward rate is returned.

Parameters:
d1Date or Time.

The start date or time used to calculate the forward rate.

d2Date or Time or Period

The end date, time or period used to calculate the forward rate.

day_counterDayCounter

The day counter used to compute the time.

compoundingint

The compounding as defined in quantlib.compounding

frequencyint

A frequency as defined in quantlib.time.date

extrapolatebool, optional

Default to False