Why Cash-Flow Derivatives Matter
Duration and convexity are often introduced as summary measures of how a price responds to a yield change. Their source is a simple operation: differentiate the present value of each dated payment with respect to the yield, then combine the results. This makes the role of payment time explicit. A later payment contributes more to the first and second derivatives than an otherwise equal earlier payment.
The formulas below use an annual effective yield \(y>-1\), with annual compounding. The cash flows are fixed, deterministic amounts paid at specified integer times. They do not change when the yield changes, and the finite schedule has no embedded options or other yield-dependent behavior. Cash flows may be positive or signed; when all are positive, the present-value weights have a particularly direct interpretation.
For a portfolio of ordinary positive cash flows, \(P(y)>0\) and the weights are nonnegative, so they sum to one like the weights in a weighted average. For signed cash flows, some weights may be negative. They still sum to one when price is nonzero, but they are not probabilities and a duration calculated from them need not lie between the earliest and latest payment times.
First Derivative: Duration
Differentiate one discounted payment while holding its amount \(C_t\) fixed. The power rule gives
Because the schedule is finite, the derivative of the sum is the sum of the derivatives. Thus the price slope is
The weighted average payment time is Macaulay duration. Dividing its time-weighted present value by price gives the definition below. The price's proportional first-derivative sensitivity is modified duration.
The minus sign is important: for positive fixed cash flows, an increase in yield reduces price, so \(P'(y)<0\). Macaulay duration is measured in years when payments are annual; modified duration is the local proportional price sensitivity per unit change in annual yield. The derivative is with respect to \(y\) expressed as a decimal, not a percentage-point number. These definitions use annual compounding; with another yield convention, first write the matching price formula and differentiate it rather than reusing the annual formula without adjustment.
Worked Example: Reading Duration From Present Values
A hypothetical bond pays \(\$105\) at the end of year 1 and \(\$231.525\) at the end of year 3. Its annual effective yield is \(5\%\). Find its price, Macaulay duration, and modified duration. Use the present-value-weight method, and avoid treating payment amounts as duration weights.
At \(y=0.05\), the discount factors for years 1 and 3 are \(1/1.05\) and \(1/(1.05)^3\). The present values are
The price is \(P=100+200=\$300\). The present-value weights are \(w_1=100/300=1/3\) and \(w_3=200/300=2/3\); they sum to 1. Hence
As a derivative check, \(P'=-(100+3\cdot200)/1.05=-700/1.05=-666.6667\). Then \(-P'/P=666.6667/300=2.2222\), matching modified duration. The method uses discounted values, not the undiscounted payments \(\$105\) and \(\$231.525\); using those amounts directly would give the wrong weights.
Second Derivative: Convexity
Differentiate each discounted payment a second time. Applying the power rule twice gives
Summing over the finite schedule yields
Annual-compounding convexity is the second price derivative relative to price. Substituting the present-value weights gives its cash-flow form.
The factor \(t(t+1)\) comes from differentiating the discount factor twice; it is not \(t^2\). Convexity is not simply the weighted average of squared payment times under this convention. The additional \(t\) in \(t(t+1)\) and the factor \((1+y)^{-2}\) are both required. For positive cash flows, \(P''(y)>0\), so the price curve is locally convex as a function of yield. Signed cash flows can make the second derivative positive, zero, or negative.
Worked Example: Calculating Convexity From a Three-Payment Schedule
A hypothetical security pays \(\$110\) at year 1, \(\$242\) at year 2, and \(\$399.30\) at year 3. Its annual effective yield is \(10\%\). Find price, Macaulay duration, modified duration, and annual-compounding convexity. Use the derivative formulas and avoid applying a convexity formula that omits the second-derivative factor.
Discount each payment at \(y=0.10\):
Therefore \(P=100+200+300=\$600\), with weights \(1/6,\ 1/3,\ 1/2\). The weighted payment time and modified duration are
For the second derivative, the time factors are \(1(2)=2\), \(2(3)=6\), and \(3(4)=12\). Their present-value-weighted sum is
Thus \(P''=5000/(1.1)^2=5000/1.21=4132.2314\), and
As a direct check, \(P''=P\mathcal{C}=600(6.8870523)=4132.2314\). The displayed duration and convexity are rounded to four decimal places. In particular, the year-3 payment contributes \(12PV_3\) to the unscaled second-derivative sum, not \(9PV_3\); using only \(t^2\) would be a different and incorrect calculation for this definition.
Signed Cash Flows and Interpretation
The same differentiation works for a net stream containing receipts and payments, provided each signed amount is fixed as yield varies. This is useful when forming the present value of an asset-minus-liability surplus. But if the net present value is zero, the ratios \(D_{\mathrm{mod}}=-P'/P\) and \(\mathcal{C}=P''/P\) are undefined. Even when price is nonzero, signed present-value weights can make the resulting ratios unintuitive. In those cases, the derivatives \(P'\) and \(P''\) themselves remain the direct quantities to calculate.
Worked Example: Derivatives of a Signed Net Cash-Flow Stream
At an annual effective yield of \(5\%\), a hypothetical net stream receives \(\$315\) at year 1, pays \(\$110.25\) at year 2, and receives \(\$243.10125\) at year 4. Receipts are positive and the payment is negative. Find its price, first and second price derivatives, modified-duration ratio, and convexity ratio. Use signed present values, avoiding the mistake of discarding the liability outflow.
Discount the signed amounts:
The price is \(P=300-100+200=\$400\), and the signed weights are \(3/4,\ -1/4,\ 1/2\). Their sum is 1. The time-weighted sum is \(1(300)+2(-100)+4(200)=900\), so
For the second derivative, the signed sum is \(2(300)+6(-100)+20(200)=4000\). Therefore
The direct checks are \(P(-P'/P)=857.1429=-P'\) and \(P\mathcal{C}=3628.1179=P''\). Ratios are rounded to four decimal places. The negative year-2 present value reduces both weighted sums. Treating it as a positive amount would change the stream rather than merely simplify the calculation.
Calculation Checks and Limits
These derivative identities are exact for the stated finite fixed-cash-flow model. They do not require a small yield change. A local price approximation may use the derivatives, but it is a separate step: the derivative formulas alone do not guarantee that an approximation remains accurate for a large rate movement. For this tutorial, the essential checks are that the same yield and compounding convention are used throughout, each payment is discounted to obtain its weight, and the \(t(t+1)\) factor is retained for the second derivative.
For positive cash flows, duration is a present-value-weighted average time and convexity is positive. For signed cash flows, the weighted-average interpretation and positivity need not hold. A zero or negative net price also prevents the usual normalized ratios from having their standard price-sensitivity interpretation. State the cash-flow signs and verify the price before reporting those ratios.
Write the annual-compounding price as a finite sum and specify the yield at which derivatives are evaluated.
Calculate signed \(PV_t\) values, then add them to find \(P\).
Use \(tPV_t\) for the first derivative and \(t(t+1)PV_t\) for the second.
If \(P\ne0\), divide the first and second derivatives by price to obtain the usual ratios; interpret them with care for signed streams.
Check Your Understanding
For each problem, use the annual-compounding definitions above. Round reported ratios to four decimal places unless an exact value is requested.
- A hypothetical note pays \(\$104\) at year 1 and \(\$216.32\) at year 2. The annual effective yield is \(4\%\). Find its price, Macaulay duration, modified duration, and convexity. (Answer: \(P=\$300\), \(D_{\mathrm{Mac}}=1.6667\), \(D_{\mathrm{mod}}=1.6026\), \(\mathcal{C}=4.3146\).)
- A fund receives \(\$110.25\) at year 2 and \(\$231.525\) at year 3. Its annual effective yield is \(5\%\). Find its price, modified duration, and convexity. (Answer: \(P=\$300\), \(D_{\mathrm{mod}}=2.5397\), \(\mathcal{C}=9.0703\).)
- A security pays \(\$110\), \(\$242\), and \(\$399.30\) at the ends of years 1, 2, and 3, respectively. At a \(10\%\) annual effective yield, find price, Macaulay duration, modified duration, and convexity. (Answer: \(P=\$600\), \(D_{\mathrm{Mac}}=2.3333\), \(D_{\mathrm{mod}}=2.1212\), \(\mathcal{C}=6.8871\).)
- A signed net stream at a \(5\%\) annual effective yield has present values \(+\$300\) at year 1, \(-\$100\) at year 2, and \(+\$200\) at year 4. Find its price and the ratios \(-P'/P\) and \(P''/P\). (Answer: \(P=\$400\), \(-P'/P=2.1429\), \(P''/P=9.0703\).)
- A positive-cash-flow portfolio has total present value \(\$400\) at a \(5\%\) annual effective yield. Its only payments occur at years 1 and 4, and its Macaulay duration is 2.5 years. Find the present value assigned to each payment time, modified duration, and convexity. (Answer: year 1 present value \(=\$200\), year 4 present value \(=\$200\), \(D_{\mathrm{mod}}=2.3810\), \(\mathcal{C}=9.9773\).)