Derivatives, One Step at a Time

Duration turns a rate move into a price estimate

Loading Java…

Duration turns a rate move into a price estimate

The bakery holds a fixed-rate bond to fund a future equipment purchase. A higher yield reduces its resale value before maturity. Measure the slope of that price change, then test how far a slope alone can take you.

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.

What does duration measure?

For certain annual payments C(t)C(t), an annually compounded yield yy gives P=∑tC(t)(1+y)tP=\sum_t\frac{C(t)}{(1+y)^t}. Macaulay duration Dmac=∑tt PV⁡(C(t))PD_{\mathrm{mac}}=\frac{\sum_t t\,\operatorname{PV}(C(t))}{P} is the present-value-weighted payment time, in years. It is not simply the final maturity. Modified duration Dmod=Dmac1+yD_{\mathrm{mod}}=\frac{D_{\mathrm{mac}}}{1+y} gives the local annual-yield sensitivity:

ΔP≈−PDmodΔy\Delta P\approx-PD_{\mathrm{mod}}\Delta y

Yield changes enter as decimals: 20 basis points = 0.002, not 20 or 0.20.

Here define DV01=PDmod×0.0001\mathrm{DV01}=PD_{\mathrm{mod}}\times0.0001, the positive currency loss magnitude for a one-basis-point yield increase on a long ordinary bond. The signed price change is approximately −DV01 × shock in basis points. Other systems may report a signed DV01; check the convention.

For a continuous yield rr, P=∑tC(t)e−rtP=\sum_t C(t)e^{-rt}, and the weighted payment time itself is the sensitivity duration: ΔP≈−PDmacΔr\Delta P\approx-PD_{\mathrm{mac}}\Delta r. At equivalent base yields r=log⁡(1+y)r=\log(1+y), the base cash-flow weights agree, but a one-basis-point move in rr differs from a one-basis-point move in yy.

Fictional bond, valued just after a couponCash received
Year 1$6
Year 2$6
Year 3$106 (coupon plus principal)

The annual yield is 4%; face is $100. All prices and DV01s in this lesson are for this one $100-face holding. Scale them by holdings before using a portfolio cash budget.

Scenario and assumptions

Use fixed certain cash flows, annual coupon dates exactly one, two and three years away, no accrued interest, no options, credit change, fees or tax. Shock the bond’s single yield with all cash flows fixed. A curve-wide hedge would require assumptions about how different maturities move.

Exercise 1 — Value each dated payment

Add discounted coupons and principal. Keep full precision for the sensitivity weights; the $100 face is not today’s market value.

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

What is the bond price in dollars?

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 — Weight the payment times

Multiply each discounted cash flow by its payment time and divide by the same price. The last payment contributes 3×1063\times106, not 3×1003\times100.

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

What is Macaulay duration in years, 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 3 — Convert time into annual-yield sensitivity

Divide Macaulay duration by 1.04 because this yield compounds annually. The divisor would depend on coupon/yield frequency under other conventions.

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

What is modified duration, 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.

Payment times determine the weights

Year 1: $6; year 2: $6; year 3: $106. At 4% annual yield, price is $105.55 and Macaulay duration is 2.8381 years.

Year 1: $6; year 2: $6; year 3: $106. At 4% annual yield, price is $105.55 and Macaulay duration is 2.8381 years.

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

Exercise 4 — Put the slope into cash units

Multiply price, modified duration and one decimal basis point. This gives dollars per basis point for $100 face, rather than a percentage price change.

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

What is the positive DV01 in dollars, 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 5 — Estimate a 20 bp rise

Apply the negative slope to a move from 4.00% to 4.20%. Report the estimated new price, not just the signed loss.

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

What price does duration estimate after the +20 bp move?

Need a hint?

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

Waiting for your answer.

Exercise 6 — Reprice a larger changed input

First run the exact price at 4.20% and compare it with exercise 5. Then change all three 0.042 inputs to 0.05, representing a separate +100 bp move from the original base. Compare the exact result with the original duration estimate at a 0.01 shock. Each exercise starts from the original bond.

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

After changing the yield to 5%, what is the exact price?

Need a hint?

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

Waiting for your answer.

Estimate versus full repricing

At +20 bp: duration estimate $104.9741; exact $104.9763. At +100 bp: estimate $102.6698; exact $102.7232.

At +20 bp: duration estimate $104.9741; exact $104.9763. At +100 bp: estimate $102.6698; exact $102.7232.

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

Exercise 7 — Keep the quotation attached to DV01

At the equivalent continuous base yield log(1.04), compute the continuous-rate DV01. It is larger than the annual-yield DV01 because the printed rate move is measured differently.

In [ ]:
Java
CHECK YOUR UNDERSTANDING · CHOOSE ONE

Why do the two DV01 numbers differ?

Need a hint?

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

Waiting for your answer.

Remember

Duration is a local slope under a stated yield convention. Convert basis points to decimals, scale by market value, and test the estimate by repricing. A fixed maturity, Macaulay duration and modified duration answer different questions.

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.