14 — Curve Construction and Forward Rates¶
Free learning pack¶
- MIT OCW Portfolio Theory I–III
https://ocw.mit.edu/courses/15-401-finance-theory-i-fall-2008/pages/video-lectures-and-slides/portfolio-theory/ resources/fixed_income.mdreference/fixed_income/curve_construction.md,forward_rates.md
Do not search for more material until these are insufficient.
PREDICT¶
A 1-year par yield is 4.80% and a 2-year par yield is 4.50% (lower — an inverted curve). Is the bootstrapped 2-year zero rate higher or lower than the 2-year par yield of 4.50%? Why might they differ at all for a bond that pays a coupon before maturity?
Formula (bootstrapping)¶
For consecutive annual-pay par bonds, solve shortest-to-longest maturity:
100 = sum_{k=1}^{n-1} coupon / (1+z_k)^k + (coupon+100) / (1+z_n)^n
where z_1 .. z_{n-1} are already known from earlier steps and you solve
for z_n.
import numpy as np
import pandas as pd
curve = pd.read_csv("../../data/mock_curve.csv")
par_yields = curve.loc[curve.tenor_years <= 5, "treasury_par_yield"].to_numpy()
print(par_yields) # 1Y..5Y par yields
# MANUAL FIRST:
# bootstrap the zero rate for each maturity in order (1Y, 2Y, 3Y, 4Y, 5Y).
# For each maturity n, discount the earlier coupons using the zero rates
# you already solved, then solve for z_n from the remaining price.
zero_rates = None
print(zero_rates)
PREDICT (forward rate)¶
The curve above is inverted at the short end. Do you expect the 1y-forward starting in 1 year (the "1y1y" forward) to be above or below today's 1-year zero rate?
Formula (forward rate)¶
f = ((1+z2)^t2 / (1+z1)^t1)^(1/(t2-t1)) - 1
# Using the zero_rates you just bootstrapped (z_1 at t=1, z_2 at t=2):
# MANUAL FIRST:
# compute the 1y1y forward rate (the rate for year 2, given what you
# already know about year 1).
forward_1y1y = None
print(forward_1y1y)
Experiment¶
Re-run bootstrapping with a steeper input curve (e.g. par yields rising 0.30% per year instead of falling). Compare how the zero curve and the 1y1y forward change shape.
Reference¶
reference/fixed_income/curve_construction.md
reference/fixed_income/forward_rates.md
Promote¶
Use src/pm/fixed_income/curve.py (bootstrap_zero_rates,
interpolate_zero_rate, forward_rate) only after your own implementation.
Test¶
pytest tests/test_fixed_income.py
ORAL CHECK¶
Explain to a PM why forward rates are a break-even, not a forecast — and what it means for a trade if realized rates come in exactly at the forwards.
Try /tutor fixed-income curve construction for an adaptive walkthrough.