Fixed Income (Bond) Mathematics
A Masterclass Edition lesson on the calculus and linear algebra behind bond risk management.
Of all the financial instruments, bonds may seem the most straightforward. You lend money (buy the bond), and you receive a series of fixed payments (coupons) and a final principal payment at maturity.
The complexity arises when interest rates in the market change. If rates go up, your existing bond with its lower fixed coupon becomes less attractive, so its price falls. If rates go down, your bond becomes more attractive, and its price rises.
The core challenge for any fixed income portfolio manager is to answer two questions:
- How much will my bond's price change if interest rates move?
- How can I structure a portfolio of many bonds to have a precise, desired sensitivity to interest rate changes?
The answers to these questions are not just "finance"; they are fundamentally about linear approximation, the very heart of calculus and linear algebra.
Part 1: The Price of a Bond - A Vector Dot Product
A standard bond is defined by its future cash flows. Let's consider a simple 3-year bond with a $1000 face value and a 5% annual coupon.
We can represent this as a Cash Flow Vector (`C`): `C = [50, 50, 1050]`
The price of this bond today is the **dot product** of the Cash Flow vector and a **Discount Factor Vector (`D`)** derived from the current yield `y`.
Price=C⋅D=t=1∑n(1+y)tCt This vector formulation is clean, powerful, and the foundation for everything that follows.
Part 2: Duration - The First Derivative (Linear Risk)
We want to find the slope of the price-yield curve. In calculus, the slope is the first derivative.
The percentage price change for a small change in yield (Δy) is given by Modified Duration (Dmod):
%ΔPrice≈−Dmod⋅Δy Duration is the first-order linear approximation of a bond's risk. A bond with a Modified Duration of 7 years will lose approximately 7% of its value if interest rates rise by 1%.
The Linear Algebra Connection: The formula for duration is derived by taking the derivative of our vector dot product formulation for price. It is the weighted-average time to maturity of a bond's cash flows.
Part 3: Convexity - The Second Derivative (Non-Linear Risk)
Our linear approximation using duration is good, but not perfect. The true price-yield relationship is a curve.
Convexity captures this curvature. To get a more accurate approximation, we need the **second derivative** of the price function. This is a **Taylor expansion**.
%ΔPrice≈−Dmod⋅Δy+21Cvx⋅(Δy)2 This provides a much more accurate estimate of price changes for larger movements in interest rates.
Part 4: Portfolio Immunization - A System of Linear Equations
Imagine you are a pension fund with a liability of **$100 million** due in **7.3 years**. You want to build a portfolio of bonds to fund this future payment and be immune to interest rate changes.
You must match the properties of your assets (the bond portfolio) to your liability. This creates a **system of linear equations**.
Let's say you can buy Bond A and Bond B. You need to find the weights `w_A` and `w_B` to solve:
- Match Present Values: wA+wB=PV(Liability)
- Match Durations: (wA/W)⋅DA+(wB/W)⋅DB=DLiab
- Match Convexities: (wA/W)⋅Cvx,A+(wB/W)⋅Cvx,B=Cvx,Liab
This is an `Ax=b` problem! In a real-world scenario with more bonds than constraints, you would use **least-squares approximation** to find the weights that get you as close as possible to a perfect match.