Derivatives, One Step at a Time

Convexity explains the error in duration

Loading Java…

Convexity explains the error in duration

A straight line understates the curvature of a fixed-payment bond’s price. Use a five-year zero to isolate that curvature without a coupon schedule, and check rather than assume that adding a second term is accurate enough.

Predict, run the provided Java calculation, then make the requested edit before answering. Each exercise uses its own stated inputs. Enter numbers without units; round final answers to two decimals unless four are requested. Keep intermediate precision. Code supports the finance rather than teaching Java syntax.

How does convexity improve a price estimate?

For a fixed-payment bond discounted at one continuous yield rr, P=∑tC(t)e−rtP=\sum_t C(t)e^{-rt}, D=∑tt PV⁡(C(t))PD=\frac{\sum_t t\,\operatorname{PV}(C(t))}{P}, and C=∑tt2PV⁡(C(t))PC=\frac{\sum_t t^2\operatorname{PV}(C(t))}{P}. The continuous-yield approximation is

ΔPP≈−D Δr+12C(Δr)2\frac{\Delta P}{P}\approx-D\,\Delta r+\frac{1}{2}C(\Delta r)^2

DD has year units; CC has year-squared units. Annual-yield convexity has a different formula; do not combine conventions.

A certain zero paying $1,000 at year five has P=1,000e−0.03×5P=1{,}000e^{-0.03\times5}, D=5D=5 and C=25C=25. The exact shocked price is Pe−5ΔrPe^{-5\Delta r}. Ordinary positive fixed cash flows give positive convexity here: the curve lies above its tangent. The positive second-order correction applies to upward and downward rate moves because Δr\Delta r is squared.

Define the residual as exact shocked price minus approximate shocked price. A smaller absolute residual is evidence of a better local approximation for that scenario, not proof it will work for any shock. Embedded exercise rights can change cash flows and effective convexity, including its sign.

Scenario and assumptions

All rates in this lesson compound continuously. Use a zero with five years remaining and no credit risk or embedded options. Base yield is 3%; ±200 bp shocks are illustrative stress scenarios. No coupon reinvestment occurs for this zero. Figures use fixed inputs.

Exercise 1 — Apply duration alone

A +200 bp move is Δr=0.02\Delta r=0.02. Estimate the new price with D=5D=5 and no curvature term. The price estimate should fall.

In [ ]:
Java
CHECK YOUR UNDERSTANDING · WRITE AN ANSWER

What is the duration-only shocked price?

Need a hint?

Round only the final answer to 2 decimal places. Retain the sign and enter no units.

Waiting for your answer.

Exercise 2 — Compute the exact benchmark

Reprice the same $1,000 payment at a continuous 5%. Keeping the maturity and cash amount fixed isolates the rate effect.

In [ ]:
Java
CHECK YOUR UNDERSTANDING · WRITE AN ANSWER

What is the exact price after +200 bp?

Need a hint?

Round only the final answer to 2 decimal places. Retain the sign and enter no units.

Waiting for your answer.

Exercise 3 — Calculate the curvature correction

Use 0.5×P×25×0.0220.5\times P\times25\times0.02^2. This is a positive dollar adjustment to the duration-only price, not an additional loss.

In [ ]:
Java
CHECK YOUR UNDERSTANDING · WRITE AN ANSWER

What dollar amount does convexity add?

Need a hint?

Round only the final answer to 2 decimal places. Retain the sign and enter no units.

Waiting for your answer.

A tangent misses curvature

Base $860.71; +200 bp duration-only $774.64; second-order $778.94; exact $778.80.

Base $860.71; +200 bp duration-only $774.64; second-order $778.94; exact $778.80.

The illustration uses fixed worked inputs. Editing code does not update it.

Exercise 4 — Combine both orders

Add the duration and convexity terms before rounding. This approximates a 9.5% decline rather than 10%.

In [ ]:
Java
CHECK YOUR UNDERSTANDING · WRITE AN ANSWER

What is the duration-plus-convexity price?

Need a hint?

Round only the final answer to 2 decimal places. Retain the sign and enter no units.

Waiting for your answer.

Exercise 5 — Measure what the approximation misses

Subtract the unrounded second-order result from exact repricing. Retain the sign; a negative residual means the approximation is too high.

In [ ]:
Java
CHECK YOUR UNDERSTANDING · WRITE AN ANSWER

What is exact minus approximate price, to four decimals?

Need a hint?

Round only the final answer to 4 decimal places. Retain the sign and enter no units.

Waiting for your answer.

Exercise 6 — Reverse the rate shock

Run the positive shock, then change all three 0.02 inputs to -0.02. The base rate remains 3%; the stressed rate becomes 1%. The duration term reverses sign while convexity remains positive.

In [ ]:
Java
CHECK YOUR UNDERSTANDING · WRITE AN ANSWER

After the edit, what is the estimated dollar price gain?

Need a hint?

Round only the final answer to 2 decimal places. Retain the sign and enter no units.

Waiting for your answer.

Opposite shocks are asymmetric

Exact gain at −200 bp: $90.52. Exact loss at +200 bp: $81.91. Convexity adds to both tangent estimates.

Exact gain at −200 bp: $90.52. Exact loss at +200 bp: $81.91. Convexity adds to both tangent estimates.

The illustration uses fixed worked inputs. Editing code does not update it.

Exercise 7 — Test a larger move and the fixed-cash-flow assumption

For +400 bp the code measures the exact-minus-second-order residual. Its absolute size is larger than for +200 bp. Also consider a callable bond whose issuer may redeem when rates fall.

In [ ]:
Java
CHECK YOUR UNDERSTANDING · CHOOSE ONE

Which conclusion survives both checks?

Need a hint?

Check the rate units, cash-flow dates and scenario assumptions.

Waiting for your answer.

Remember

Use a consistent compounding convention for duration and convexity. Square the rate move in the second-order term, retain full precision, and measure signed residuals against exact prices. Exercise rights and large shocks require more than a local expansion.

Keyboard shortcuts

Press Esc to enter cell command mode. Then use the keys below. Press Enter to edit again.

A
In command mode: insert a Java cell above the selected cell.
B
In command mode: insert a Java cell below the selected cell.
D, D
In command mode: press D twice within one second to delete the selected cell. Runtime variables remain until kernel restart.
Z
In command mode: undo the last cell deletion.
Shift + Enter
Run code, check a quiz answer, or advance past Markdown; then select the next cell.
Tab
Move focus to the next control or cell.
Shift + Tab
Move focus to the previous control or cell.
Enter
Edit the selected cell in command mode; check an answer when a quiz input is focused, or activate a focused button.
Esc
Enter cell command mode, or close this popup when it is open.