The price curve bends up
A bond pays at each time , in years. At the yield (a decimal: 5% is 0.05), its price is .
Case study 2.2.4 found the tangent to this curve always below the true price. That is a concave-up curve: .
Differentiate one payment twice, by the power and chain rules (lessons 2.3.1 and 2.3.3). The first derivative is , as in case study 2.3.7. The second is , positive for every payment, so for any bond with positive payments.
Rule: Convexity
The second derivative of the price, per unit of price. Duration measures the slope; convexity measures the bend. For the 5-year 4% bond at 5%, .
Try it
SymPy differentiates the price formula once for and twice for . The bond is worth 95.6705, with and .
The second line sums over the payments: , and the same .
Duration plus convexity
Duration alone is the tangent: a straight-line estimate of the price change. Adding a term for the bend gives a parabola that follows the curve much further. Here is the change in yield.
Rule: Duration–convexity estimate
The first term is case study 2.2.4's tangent. The second is the correction for the bend; module 2.7 shows where the comes from. Because , the correction is positive whichever way the yield moves.
For a 2% rise, and . The estimate is a fall of 8.3112%, to 87.7192; the true fall is 8.3318%, to 87.6994. For a 2% fall the same correction is added again: a rise of 9.2900% against a true 9.3124%.
| yield move | true price | duration only | with convexity |
|---|---|---|---|
| 109.4269 | 108.2999 | 109.3535 | |
| 104.5797 | 104.0901 | 104.5584 | |
| 100.0000 | 99.8803 | 99.9974 | |
| 91.5753 | 91.4607 | 91.5778 | |
| 87.6994 | 87.2509 | 87.7192 | |
| 84.0292 | 83.0411 | 84.0947 |
Duration alone is off by 0.45 for a 2% rise; with convexity, by 0.02. Doubling the move roughly quadruples the duration error, as for any tangent. The convexity estimate's error grows about eight times, from 0.0025 to 0.0198, and it changes sign: it overshoots slightly when yields rise.
How far each estimate misses the true price. The duration error grows with the square of the move; the duration-plus-convexity error stays near zero over .
Try it
The table above, with the error of each estimate in the last two columns. and are the values from the first cell.
Convexity on the desk
Convexity grows quickly with maturity. A zero-coupon bond paying only at has : for 5 years at 5%, . At the same 5% yield:
| bond | duration | convexity |
|---|---|---|
| 5-year, 8% coupon | 4.1496 | 22.57 |
| 5-year, 4% coupon | 4.4003 | 24.47 |
| 5-year, zero coupon | 4.7619 | 27.21 |
| 10-year, 4% coupon | 7.9615 | 78.29 |
| 10-year, zero coupon | 9.5238 | 99.77 |
| 30-year, 4% coupon | 16.0942 | 377.43 |
Convexity grows much faster than duration. From 5 to 10 years, the 4% bond's duration grows 1.81 times and its convexity 3.2 times. For long bonds the correction matters even for moderate moves.
Try it
convexity divides the second central difference by the price. The loop reproduces the table, then the second loop tries four bump sizes on the 5-year 4% bond.
Risk aversion: a concave utility
Economists describe how much a person values wealth with a utility function . A common choice is .
Its slope is positive: more is better. Its second derivative is negative: each extra dollar adds less than the one before (lessons 2.3.4 and 2.4.2).
Offer someone with $100,000 a fair coin flip: win or lose $20,000. Their expected wealth, the average of the two equally likely outcomes, is still $100,000. But their expected utility is , below .
The reason is the shape. The chord between the two outcomes lies below a concave curve, so the average of the two utilities sits below the utility of the average. The loss hurts more than the gain helps.
Rule: Certainty equivalent and risk premium
The certainty equivalent CE is the sure wealth that is worth as much to the person as the gamble. For , . The risk premium is what they would give up to avoid the gamble.
Here $97,979.59, so the risk premium is $2,020.41. The figure shows a larger flip, $50,000 either way, where the shapes are easier to see.
Log utility and a fair flip of $50,000 on $100,000. The expected utility is the midpoint of the chord, below the curve. The curve falls to that height at $86,600, so the person would give up $13,400 to avoid the flip.
How big is the premium?
How strongly a person dislikes risk is the curvature relative to the slope: the Arrow–Pratt coefficient . For it is . For a fair flip of , the premium is about : half the curvature times the square of the move, like the convexity term.
| stake | 10,000 | 20,000 | 50,000 |
|---|---|---|---|
| risk premium | 501.26 | 2,020.41 | 13,397.46 |
| 500.00 | 2,000.00 | 12,500.00 |
Doubling the stake roughly quadruples the premium. The estimate is good for small stakes and too low for large ones. A richer person minds less: with $1,000,000, the same $20,000 flip has a premium of only $200.02.
Try it
The certainty equivalent and risk premium for three stakes, next to with .
The last two lines print against the expected utility, then the premium at $1,000,000.
The sign of decides
For the $20,000 flip on $100,000:
| utility | certainty equivalent | risk premium | |
|---|---|---|---|
| negative | 97,979.59 | 2,020.41 | |
| zero | 100,000.00 | 0 | |
| positive | 101,980.39 |
A concave utility is risk averse: the premium is positive. A straight line is risk neutral: only the expected wealth matters. A convex utility is risk seeking: the person would pay to take the gamble.
Try it
Each utility comes with its inverse, which turns the expected utility back into wealth.
The last lines try a flip that could lose everything: does not exist, and Python raises ValueError.
A log-utility investor treats ruin as infinitely bad: as wealth falls towards 0, falls without limit. So a model must check that every outcome leaves positive wealth before taking logs.
Convexity and certainty equivalents
Write two functions.
convexity(coupon, face, years, y, h=1e-4)returns for a bond with yearly coupons, estimating with the second central difference .certainty_equivalent(w, gain, loss)returns the certainty equivalent, for log utility, of a fair coin flip that addsgainor subtractsloss. Iflosswould leave no wealth, raiseValueError.
See the tests
def test_convexity():
"""The 5-year 4% bond at 5% has convexity about 24.47"""
expect_close(convexity(4, 100, 5, 0.05), 24.472405046329648, what="convexity(4, 100, 5, 0.05)", rel=1e-4)
def test_zero_coupon_convexity():
"""A 5-year zero at 5% has convexity 5 × 6 / 1.05²"""
expect_close(convexity(0, 100, 5, 0.05), 30 / 1.05**2, what="convexity(0, 100, 5, 0.05)", rel=1e-4)
def test_convexity_positive():
"""Bond convexity is positive"""
c = convexity(7, 100, 20, 0.06)
assert c > 0, f"expected positive convexity, got {c}"
def test_certainty_equivalent():
"""$100,000 facing a fair ±$20,000 flip: certainty equivalent about $97,980"""
expect_close(certainty_equivalent(100_000, 20_000, 20_000), 97979.58971132721, what="certainty_equivalent", rel=1e-9)
def test_risk_aversion():
"""The certainty equivalent is below the expected wealth"""
ce = certainty_equivalent(50_000, 10_000, 10_000)
assert ce < 50_000, f"expected a certainty equivalent below 50,000, got {ce}"
def test_ruin():
"""A loss that would leave no wealth raises ValueError"""
try:
certainty_equivalent(20_000, 20_000, 20_000)
except ValueError:
return
raise AssertionError("expected ValueError when the loss would leave no wealth")
Summary card
- A bond's price curve is concave up: each payment has second derivative . Convexity is .
- : the correction is positive whichever way yields move, and it grows faster than duration with maturity.
- Estimate with a 1 bp second central difference; check the scale a system quotes in.
- A concave utility () makes a fair gamble worth less than its expected value. The certainty equivalent has the same utility; the gap to expected wealth is the risk premium, about with .