Financial Toolbox | ![]() ![]() |
Sensitivity of Bond Prices to Changes in Interest Rates
Macaulay and modified duration measure the sensitivity of a bond's price to changes in the level of interest rates. Convexity measures the change in duration for small shifts in the yield curve, and thus measures the second-order price sensitivity of a bond. Both measures can gauge the vulnerability of a bond portfolio's value to changes in the level of interest rates.
ftspex1.m
.
Step 1.
Define three bonds using values for the settlement date, maturity date, face value, and coupon rate. For simplicity, accept default values for the coupon payment periodicity (semi-annual), end-of-month payment rule (rule in effect), and day-count basis (actual/actual). Also, synchronize the coupon payment structure to the maturity date (no odd first or last coupon dates). Any inputs for which defaults are accepted are set to empty matrices ([]
) as placeholders where appropriate.
Settle = '19-Aug-1999'; Maturity = ['17-Jun-2010'; '09-Jun-2015'; '14-May-2025']; Face = [100; 100; 1000]; CouponRate = [0.07; 0.06; 0.045];Also, specify the yield curve information.
Yields = [0.05; 0.06; 0.065];
Step 2. Use Financial Toolbox functions to calculate the price, modified duration in years, and convexity in years of each bond.
The true price is quoted (clean) price plus accrued interest.[CleanPrice, AccruedInterest] =bndprice
(Yields, CouponRate,... Settle, Maturity, 2, 0, [], [], [], [], [], Face); Durations =bnddury
(Yields, CouponRate, Settle, Maturity, 2, 0,... [], [], [], [], [], Face); Convexities =bndconvy
(Yields, CouponRate, Settle, Maturity,2, 0,... [], [], [], [], [], Face); Prices = CleanPrice + AccruedInterest;
Step 3. Choose a hypothetical amount by which to shift the yield curve (here, 0.2 percentage point or 20 basis points).
dY = 0.002;Weight the three bonds equally, and calculate the actual quantity of each bond in the portfolio, which has a total value of $100,000.
PortfolioPrice = 100000; PortfolioWeights = ones(3,1)/3; PortfolioAmounts = PortfolioPrice * PortfolioWeights ./ Prices;
Step 4. Calculate the modified duration and convexity of the portfolio. Note that the portfolio duration or convextity is a weighted average of the durations or convexities of the individual bonds. Calculate the first- and second-order approximations of the percent price change as a function of the change in the level of interest rates.
PortfolioDuration = PortfolioWeights' * Durations; PortfolioConvexity = PortfolioWeights' * Convexities; PercentApprox1 = -PortfolioDuration * dY * 100; PercentApprox2 = PercentApprox1 + ... PortfolioConvexity*dY^2*100/2.0;
Step 5. Estimate the new portfolio price using the two estimates for the percent price change.
PriceApprox1 = PortfolioPrice + ... PercentApprox1 * PortfolioPrice/100; PriceApprox2 = PortfolioPrice + ... PercentApprox2 * PortfolioPrice/100;
Step 6. Calculate the true new portfolio price by shifting the yield curve.
[CleanPrice, AccruedInterest] = bndprice
(Yields + dY,...
CouponRate, Settle, Maturity, 2, 0, [], [], [], [], [],...
Face);
NewPrice = PortfolioAmounts' * (CleanPrice + AccruedInterest);
Step 7.
Compare the results. The analysis results are as follows (verify these results by running the example M-file ftspex1.m
):
PriceApprox1
) will be $97,936.37.
PriceApprox2
) will be $97,967.90.
NewPrice
) for this yield curve shift is $97,967.51.
dY
) to see this effect.
dY
, the change in yield. The formulas are not well-defined unless each yield changes by the same amount. In actual financial markets, changes in yield curve level typically explain a substantial portion of bond price movements. However, other changes in the yield curve, such as slope, may also be important and are not captured here. Also, both formulas give local approximations whose accuracy deteriorates as dY
increases in size. You can demonstrate this by running the program with larger values of dY
.
![]() | Solving Sample Problems | Constructing a Bond Portfolio to Hedge Against Duration and Convexity | ![]() |