Main Content

Understanding Interest-Rate Term Structure

This example shows how to compute discount factors from rates or rates from discount factors.

The interest-rate term structure represents the evolution of interest rates through time. In MATLAB®, the interest-rate environment is encapsulated in a structure called RateSpec (rate specification). This structure holds all information required to completely identify the evolution of interest rates. Several functions included in Financial Instruments Toolbox™ software are dedicated to the creating and managing of the RateSpec structure. Many others take this structure as an input argument representing the evolution of interest rates.

Before looking further at the RateSpec structure, examine three functions that provide key functionality for working with interest rates: disc2rate, its opposite, rate2disc, and ratetimes. The first two functions map between discount factors and interest rates. The third function, ratetimes, calculates the effect of term changes on the interest rates.

Interest Rates Versus Discount Factors

Discount factors are coefficients commonly used to find the current value of future cash flows. As such, there is a direct mapping between the rate applicable to a period of time, and the corresponding discount factor. The function disc2rate converts discount factors for a given term (period) into interest rates. The function rate2disc does the opposite; it converts interest rates applicable to a given term (period) into the corresponding discount factors.

Consider these annualized zero-coupon bond rates.

From

To

Rate

15 Feb 2000

15 Aug 2000

0.05

15 Feb 2000

15 Feb 2001

0.056

15 Feb 2000

15 Aug 2001

0.06

15 Feb 2000

15 Feb 2002

0.065

15 Feb 2000

15 Aug 2002

0.075

To calculate the discount factors corresponding to these interest rates, call rate2disc using the syntax:

% Disc = rate2disc(Compounding, Rates, EndDates, StartDates, ValuationDate);

where

  • Compounding represents the frequency at which the zero rates are compounded when annualized. For this example, assume this value to be 2.

  • Rates is a vector of annualized percentage rates representing the interest rate applicable to each time interval.

  • EndDates is a vector of dates representing the end of each interest-rate term (period).

  • StartDates is a vector of dates representing the beginning of each interest-rate term.

  • ValuationDate is the date of observation for which the discount factors are calculated. In this particular example, use February 15, 2000 as the beginning date for all interest-rate terms.

Define the variables and then use rate2disc.

StartDates = '15-Feb-2000';
EndDates  = ['15-Aug-2000'; '15-Feb-2001'; '15-Aug-2001'; ... 
'15-Feb-2002'; '15-Aug-2002'];
Compounding = 2;
ValuationDate = '15-Feb-2000';
Rates = [0.05; 0.056; 0.06; 0.065; 0.075];
Disc = rate2disc(Compounding, Rates, EndDates, StartDates, ValuationDate)
Disc = 5×1

    0.9756
    0.9463
    0.9151
    0.8799
    0.8319

By adding a fourth column to the rates table to include the corresponding discounts, you can see the evolution of the discount factors.

From

To

Rate

Discount

15 Feb 2000

15 Aug 2000

0.05

0.9756

15 Feb 2000

15 Feb 2001

0.056

0.9463

15 Feb 2000

15 Aug 2001

0.06

0.9151

15 Feb 2000

15 Feb 2002

0.065

0.8799

15 Feb 2000

15 Aug 2002

0.075

0.8319

Optional Time Factor Outputs

The function rate2disc optionally returns two additional output arguments: EndTimes and StartTimes. These vectors of time factors represent the start dates and end dates in discount periodic units. The scale of these units is determined by the value of the input variable Compounding.

To examine the time factor outputs, you can add these outut arguments.

[Disc, EndTimes, StartTimes] = rate2disc(Compounding, Rates, ... 
EndDates, StartDates, ValuationDate);

Arrange the two vectors into a single array for easier visualization.

Times = [StartTimes, EndTimes]
Times = 5×2

     0     1
     0     2
     0     3
     0     4
     0     5

Because the valuation date is equal to the start date for all periods, the StartTimes vector is composed of 0s. Also, since the value of Compounding is 2, the rates are compounded semiannually, which sets the units of periodic discount to six months. The vector EndDates is composed of dates separated by intervals of six months from the valuation date. This explains why the EndTimes vector is a progression of integers from 1 to 5.

Alternative Syntax for rate2disc

The function rate2disc also accommodates an alternative syntax that uses periodic discount units instead of dates. Since the relationship between discount factors and interest rates is based on time periods and not on absolute dates, this form of rate2disc allows you to work directly with time periods. In this mode, the valuation date corresponds to 0, and the vectors StartTimes and EndTimes are used as input arguments instead of their date equivalents, StartDates and EndDates.

Using as input the StartTimes and EndTimes, you obtain the results for the discount factors.

Disc = rate2disc(Compounding, Rates, EndTimes, StartTimes)
Disc = 5×1

    0.9756
    0.9463
    0.9151
    0.8799
    0.8319

Calculating Rates from Discounts

The function disc2rate is the complement to rate2disc. It finds the rates applicable to a set of compounding periods, given the discount factor in those periods.

Rates = disc2rate(Compounding, Disc, EndDates, StartDates, ValuationDate)
Rates = 5×1

    0.0500
    0.0560
    0.0600
    0.0650
    0.0750

Alternative Syntax for disc2rate

As in the case of rate2disc, disc2rate optionally returns StartTimes and EndTimes vectors representing the start and end times measured in discount periodic units.

[Rates, EndTimes, StartTimes] = disc2rate(Compounding, Disc, ... 
EndDates, StartDates, ValuationDate)
Rates = 5×1

    0.0500
    0.0560
    0.0600
    0.0650
    0.0750

EndTimes = 5×1

     1
     2
     3
     4
     5

StartTimes = 5×1

     0
     0
     0
     0
     0

Arrange the results in a matrix convenient to display.

Result = [StartTimes, EndTimes, Rates]
Result = 5×3

         0    1.0000    0.0500
         0    2.0000    0.0560
         0    3.0000    0.0600
         0    4.0000    0.0650
         0    5.0000    0.0750

As with rate2disc, the relationship between rates and discount factors is determined by time periods and not by absolute dates. So, the alternate syntax for disc2rate uses time vectors instead of dates, and it assumes that the valuation date corresponds to time = 0. Using this syntax, you can obtain the original values for the interest rates.

Rates = disc2rate(Compounding, Disc, EndTimes, StartTimes)
Rates = 5×1

    0.0500
    0.0560
    0.0600
    0.0650
    0.0750

See Also

| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |

Topics