fift_analytics.gilts.zero_coupon.curve_yield_extrapolation.derive_yield_from_zero_curve#
- fift_analytics.gilts.zero_coupon.curve_yield_extrapolation.derive_yield_from_zero_curve(zero_curve: list[tuple[int, float]], target_maturity: float) float#
Derive the implicit yield for a given maturity using a zero-coupon bond curve.
- Formula:
\[y = y1 + ((t - t1) * (y2 - y1)) / (t2 - t1)\]Interpolates between two maturities.
for maturities less than 3 months, uses 3 months.
for maturities greater than largest tenor point on the curve, it extrapolates.
- Parameters:
zero_curve (list) -- A list of tuples representing the zero-coupon bond curve. Each tuple contains (maturity_in_months, annual_yield). Example: [(3, 0.01), (6, 0.015), (12, 0.02), (18, 0.025)]
target_maturity (float) -- The target maturity in months for which to derive the yield.
- Returns:
The interpolated or extrapolated yield for the given maturity.
- Return type:
float
- Example:
>>> zero_curve = [(3, 0.01), (6, 0.015), (12, 0.02), (18, 0.025)] >>> derive_yield_from_zero_curve(zero_curve, 9) 0.0175 >>> derive_yield_from_zero_curve(zero_curve, 2) 0.01 >>> derive_yield_from_zero_curve(zero_curve, 24) 0.03