Tutorials › Exam FM - Financial Mathematics › Deriving Macaulay Duration From The Price Function

Exam FM · Macaulay and Modified Duration · Tutorial 561 of 998

Deriving Macaulay Duration From The Price Function

Learn why a bond’s Macaulay duration equals the present-value-weighted average time of its fixed cash flows, using the derivative of its price function.

Intermediate 10 min read

What You'll Learn

  • State the assumptions needed for a single-yield bond price function.
  • Differentiate the price function term by term.
  • Connect the price derivative to present-value weights and Macaulay duration.
  • Calculate duration and check it using the derivative identity.
  • Recognize when yield-dependent cash flows or a different yield convention invalidate the derivation.

Why Differentiate a Bond’s Price?

Macaulay duration can be described as the present-value-weighted average time of a bond’s cash flows. That description is useful for calculation, but it also raises a natural question: why should the derivative of a bond’s price with respect to yield produce those same time weights? The answer follows directly from the price function. Differentiation brings down each cash flow’s payment time, while discounting supplies the present-value weights.

The derivation depends on a specific valuation model. We assume that the bond has fixed, known cash flows, all paid at specified future times, and that a single annual effective yield discounts every payment. The yield is held constant across cash-flow dates when the price function is formed. These assumptions let us isolate exactly how the price function encodes timing.

Definition: Suppose a bond pays fixed cash flows \(C_k\) at future times \(t_k\), measured in years, and has annual effective yield \(y>-1\). Its price under a single-yield valuation is $$ P(y)=\sum_{k=1}^{n} C_k(1+y)^{-t_k}. $$ If the cash flows are nonnegative and the price is positive, define the present-value weight of payment \(k\) by \(w_k=C_k(1+y)^{-t_k}/P(y)\). Macaulay duration is $$ D_M=\sum_{k=1}^{n} t_k w_k =\frac{\sum_{k=1}^{n}t_k C_k(1+y)^{-t_k}}{P(y)}. $$

The weights add to one because the present values of all payments add to the price. With nonnegative cash flows, each weight is nonnegative, so the duration is an average of the payment times. The formula also applies when some payments are zero; those dates simply receive zero weight.

Deriving the Weighted-Time Formula

For each fixed cash flow, differentiate its discounted value with respect to \(y\). The payment amount and payment time do not change as yield changes; only the discount factor changes. Applying the power rule to each term gives the price derivative.

$$ \begin{aligned} P(y)&=\sum_{k=1}^{n}C_k(1+y)^{-t_k},\\ P'(y)&=\sum_{k=1}^{n}C_k\left[-t_k(1+y)^{-t_k-1}\right]\\ &=-\frac{1}{1+y}\sum_{k=1}^{n}t_k C_k(1+y)^{-t_k}. \end{aligned} $$

The sum in the last line is the price multiplied by Macaulay duration: by definition, \(P(y)D_M=\sum_k t_k C_k(1+y)^{-t_k}\). Substituting this identity into the derivative gives the result.

Theorem: For fixed, nonnegative cash flows discounted at a single annual effective yield \(y>-1\), with \(P(y)>0\), Macaulay duration satisfies $$ D_M=-\frac{(1+y)P'(y)}{P(y)}. $$ This follows because differentiating each discount factor multiplies its present value by \(-t_k/(1+y)\). Dividing the resulting sum by the price turns the time terms into present-value weights.

The sign is consistent with the price function: for nonnegative future payments, \(P'(y)\leq 0\), since increasing \(y\) reduces each discounted value. The factor \(1+y\) in the identity is also essential; it appears because the derivative of \((1+y)^{-t_k}\) contains the extra factor \((1+y)^{-1}\).

1
Write the price function.
List every future fixed payment and discount it at the stated annual effective yield.
2
Differentiate with respect to yield.
For a term \(C_k(1+y)^{-t_k}\), the derivative is \(-t_k C_k(1+y)^{-t_k-1}\).
3
Evaluate price and derivative at the yield.
Keep the same cash flows and time units in both calculations.
4
Recover duration and check it.
Use \(- (1+y)P'(y)/P(y)\), then compare with the weighted-time calculation when convenient.

Worked Calculations

Worked Example: A Four-Date Fixed Cash-Flow Stream

A bond-like contract pays 125 dollars at the end of each of years 1, 2, and 3, and 1,250 dollars at the end of year 4. Its annual effective yield is 25%. Find its Macaulay duration by differentiating its price function, and check the result using the present-value weights.

Method and assumptions. The four payments are fixed, all times are measured in years, and every payment is discounted at the same annual effective yield \(y=0.25\). Thus $$ P(y)=\frac{125}{1+y}+\frac{125}{(1+y)^2}+\frac{125}{(1+y)^3}+\frac{1250}{(1+y)^4}. $$

At \(y=0.25\), the discount factors are \(1/1.25=0.8\), \(1/1.25^2=0.64\), \(1/1.25^3=0.512\), and \(1/1.25^4=0.4096\). The four present values are therefore \(125(0.8)=100\), \(125(0.64)=80\), \(125(0.512)=64\), and \(1250(0.4096)=512\) dollars. The price is $$ P(0.25)=100+80+64+512=756. $$

Differentiate the function and evaluate the derivative by using each payment’s present value: $$ P'(0.25)=-\frac{1}{1.25}\left[1(100)+2(80)+3(64)+4(512)\right] =-\frac{2500}{1.25}=-2000. $$

The derivative identity gives $$ D_M=-\frac{1.25(-2000)}{756}=\frac{2500}{756} =3.306878\ldots. $$ Rounded to four decimal places, the duration is 3.3069 years.

Check by present-value weights. The weights are \(100/756\), \(80/756\), \(64/756\), and \(512/756\). They sum to \(756/756=1\), and their weighted time is \((1(100)+2(80)+3(64)+4(512))/756=2500/756\), agreeing with the derivative calculation. A common mistake this method avoids is weighting payment times by the cash-flow amounts rather than by their present values.

Worked Example: A Two-Year Coupon Bond

A bond with face value 100 dollars pays an annual coupon of 12 dollars and repays the 100-dollar principal at the end of year 2. Its annual effective yield is 10%. Find its price and Macaulay duration using the derivative of the price function.

Method and assumptions. The cash flows are 12 dollars at year 1 and 112 dollars at year 2. They are fixed and discounted at the same annual effective yield, so $$ P(y)=\frac{12}{1+y}+\frac{112}{(1+y)^2}. $$

At \(y=0.10\), the present values are \(12/1.1=120/11=10.9091\ldots\) dollars and \(112/1.21=11200/121=92.5620\ldots\) dollars. Keeping the exact fractions, the price is $$ P(0.10)=\frac{1320}{121}+\frac{11200}{121} =\frac{12520}{121}=103.4711\ldots. $$

Differentiate before substituting the yield: $$ P'(y)=-12(1+y)^{-2}-224(1+y)^{-3}. $$

At \(y=0.10\), the derivative can be evaluated from the present values and times: $$ P'(0.10)=-\frac{1}{1.1}\left[1\left(\frac{120}{11}\right)+2\left(\frac{11200}{121}\right)\right] =-\frac{237200}{1331}. $$

Therefore, $$ D_M=-\frac{1.1P'(0.10)}{P(0.10)} =\frac{23720}{12520} =\frac{593}{313} =1.894568\ldots. $$

The price is 103.47 dollars to the nearest cent, and duration is 1.8946 years to four decimal places. As a check, the present-value-weighted time is \(\left[120/11+2(11200/121)\right]/(12520/121)=593/313\). The common mistake avoided here is treating the 12-dollar coupon and 112-dollar final payment as the duration weights without first discounting them.

Worked Example: Checking a Derivative Against Cash-Flow Weights

A fixed stream pays 125 dollars at year 1, 250 dollars at year 2, and 937.50 dollars at year 3. The annual effective yield is 25%. Find duration both from the price derivative and from the cash-flow present values.

Method and assumptions. The payments and their dates are fixed. The price function is $$ P(y)=125(1+y)^{-1}+250(1+y)^{-2}+937.50(1+y)^{-3}. $$

At \(y=0.25\), the discount factors are \(0.8\), \(0.64\), and \(0.512\). The present values are \(125(0.8)=100\), \(250(0.64)=160\), and \(937.50(0.512)=480\) dollars. Thus \(P(0.25)=100+160+480=740\) dollars. The time-weighted present-value sum is $$ 1(100)+2(160)+3(480)=100+320+1440=1860. $$

Differentiating the price function gives \(P'(y)=-\sum_k t_kC_k(1+y)^{-t_k-1}\). Consequently, $$ P'(0.25)=-\frac{1860}{1.25}=-1488. $$

Using the derivative identity, $$ D_M=-\frac{1.25(-1488)}{740}=\frac{1860}{740} =2.513513\ldots. $$

The duration is 2.5135 years to four decimal places. The present-value weights, \(100/740\), \(160/740\), and \(480/740\), sum to one and give the same weighted time. This check catches a sign error in the derivative: because price falls as yield rises, the derivative here must be negative.

Assumptions, Limits, and Exam Traps

The formula is a result about a particular price function, not a universal rule for every security or yield convention. Before using it, identify what the cash flows are, when they occur, and how the yield discounts them.

  • Cash flows must be fixed as yield varies. If the amount or timing of a payment changes with yield, differentiating the price includes additional terms. The derivation above does not account for those terms.
  • Use a consistent yield convention. The displayed formula assumes an annual effective yield and times in years, with discount factor \((1+y)^{-t}\). If a yield is quoted under another compounding convention, the price function and derivative must match that convention.
  • One yield discounts every payment. The derivation is for a single-yield price function. A model that discounts different cash flows at different rates has a different derivative calculation.
  • Use present values, not undiscounted payments. The time weights are proportional to \(C_k(1+y)^{-t_k}\), not merely to \(C_k\).
  • Do not omit the factor \(1+y\). The derivative contains \((1+y)^{-t_k-1}\), not just \((1+y)^{-t_k}\). The extra factor produces \(D_M=-(1+y)P'(y)/P(y)\).

For example, in the two-year bond calculation, weighting the times directly by the cash flows would give \((1(12)+2(112))/(12+112)=236/124=1.9032\) years. That is not the Macaulay duration at a 10% yield. The correct weights use present values, giving \(593/313=1.8946\) years. The discrepancy occurs because the later payment is discounted for longer.

If cash flows include negative amounts, the differentiation identity can still be manipulated algebraically when the price is nonzero, but the resulting weights may be negative and need not describe an average time. The weighted-average interpretation therefore relies on nonnegative cash flows and positive price. These qualifications help distinguish a valid use of the formula from a calculation that merely resembles it.

Key takeaway: Differentiating each fixed discounted payment introduces its payment time. Summing those terms and dividing by price turns them into present-value weights, so the derivative identity reproduces Macaulay duration exactly under the stated single-yield assumptions.

Check Your Understanding

For each problem, use the stated cash-flow timing and yield convention. Answers are included for checking.

  1. A bond pays 6 dollars at the end of years 1 and 2, then 106 dollars at the end of year 3. Its annual effective yield is 0%. Find its price and Macaulay duration. (Answer: price 118.00 dollars; duration 2.8475 years.)
  2. A fixed stream pays 110 dollars at year 1 and 242 dollars at year 2. The annual effective yield is 10%. Find Macaulay duration using present-value weights. (Answer: 1.6667 years.)
  3. A contract pays 50 dollars at year 1, 100 dollars at year 2, and 200 dollars at year 4. The annual effective yield is 25%. Calculate duration using the derivative identity. (Answer: 2.6661 years.)
  4. At an annual effective yield of 8%, a fixed-cash-flow bond has price 500 dollars and price derivative \(P'(0.08)=-900\) dollars per unit yield. Find Macaulay duration. (Answer: 1.9440 years.)
  5. A fixed stream pays 100 dollars at year 1 and 200 dollars at year 3. Its annual effective yield is 10%. Find the duration, and state why the undiscounted-payment weighting is not the correct method. (Answer: 2.2461 years; use present-value weights, not the payment amounts.)
Clinical Biostats