Financial Toolbox    

Sensitivity of Bond Prices to Parallel Shifts in the Yield Curve

Often bond portfolio managers want to consider more than just the sensitivity of a portfolio's price to a small shift in the yield curve, particularly if the investment horizon is long. This example shows how MATLAB can visualize the price behavior of a portfolio of bonds over a wide range of yield curve scenarios, and as time progresses toward maturity.

This example uses the Financial Toolbox bond pricing functions to evaluate the impact of time-to-maturity and yield variation on the price of a bond portfolio. It plots the portfolio value and shows the behavior of bond prices as yield and time vary. This example M-file is ftspex3.m.

Step 1.   Specify values for the settlement date, maturity date, face value, coupon rate, and coupon payment periodicity of a four-bond portfolio. For simplicity, accept default values for the 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.

Also, specify the points on the yield curve for each bond.

Step 2.   Use Financial Toolbox functions to calculate the true bond prices as the sum of the quoted price plus accrued interest.

Step 3.   Assume the value of each bond is $25,000, and determine the quantity of each bond such that the portfolio value is $100,000.

Step 4.   Compute the portfolio price for a rolling series of settlement dates over a range of yields. The evaluation dates occur annually on January 15, beginning on 15-Jan-1995 (settlement) and extending out to 15-Jan-2018. Thus, this step evaluates portfolio price on a grid of time of progression (dT) and interest rates (dY).

Now that the grid and price vectors have been created, compute the price of each bond in the portfolio on the grid one bond at a time.

Scale the bond prices by the quantity of bonds.

Reshape the bond values to conform to the underlying evaluation grid.

Step 5.   Plot the price of the portfolio as a function of settlement date and a range of yields, and as a function of the change in yield (dY). This plot illustrates the interest rate sensitivity of the portfolio as time progresses (dT), under a range of interest rate scenarios. With the following graphics commands, you can visualize the three-dimensional surface relative to the current portfolio value (i.e., $100,000).

Add the base portfolio value to the existing surface plot.

Make it transparent, plot it so the price surface shows through, and draw a box around the plot.

Plot the x-axis using two-digit year (YY format) labels for ticks.

Add axis labels and set the three-dimensional viewpoint. MATLAB produces the figure.

MATLAB's three-dimensional graphics allow you to visualize the interest rate risk experienced by a bond portfolio over time. This example assumed parallel shifts in the term structure, but it might similarly have allowed other components to vary, such as the level and slope.


  Constructing a Bond Portfolio to Hedge Against Duration and Convexity Constructing Greek-Neutral Portfolios of European Stock Options