Lesson 8 of 15

Yield to Maturity

Yield to Maturity

Yield to Maturity (YTM) is the single discount rate that equates a bond's present value of cash flows to its market price. It is the bond's implied rate of return if held to maturity.

P=t=1nC(1+y)t+F(1+y)nP = \sum_{t=1}^{n} \frac{C}{(1+y)^t} + \frac{F}{(1+y)^n}

There is no algebraic solution for yy, so we solve numerically using bisection search.

Bisection Algorithm

  1. Set bounds: lo = 0.0001, hi = 0.9999
  2. Compute mid = (lo + hi) / 2
  3. If bond_price(mid) > market_price: yield must be higher → lo = mid
  4. If bond_price(mid) < market_price: yield must be lower → hi = mid
  5. Repeat ~1000 times

Known Relationships

  • If price = face value → YTM = coupon rate
  • If price < face value → YTM > coupon rate
  • If price > face value → YTM < coupon rate

These help sanity-check your implementation.

Python runtime loading...
Loading...
Click "Run" to execute your code.