The Financial Toolbox™ product contains several functions to derive and analyze interest rate curves, including data conversion and extrapolation, bootstrapping, and interest-rate curve conversion functions.
One of the first problems in analyzing the term structure of interest rates is dealing with market data reported in different formats. Treasury bills, for example, are quoted with bid and asked bank-discount rates. Treasury notes and bonds, on the other hand, are quoted with bid and asked prices based on $100 face value. To examine the full spectrum of Treasury securities, analysts must convert data to a single format. Financial Toolbox functions ease this conversion. This brief example uses only one security each; analysts often use 30, 100, or more of each.
First, capture Treasury bill quotes in their reported format
% Maturity Days Bid Ask AskYield TBill = [datenum('12/26/2000') 53 0.0503 0.0499 0.0510];
then capture Treasury bond quotes in their reported format
% Coupon Maturity Bid Ask AskYield TBond = [0.08875 datenum(2001,11,5) 103+4/32 103+6/32 0.0564];
and note that these quotes are based on a November 3, 2000 settlement date.
Settle = datenum('3-Nov-2000');
Next use the toolbox
tbl2bond function to convert the Treasury
bill data to Treasury bond format.
TBTBond = tbl2bond(TBill)
TBTBond = 1.0e+05 * 0 7.3085 0.0010 0.0010 0.0000
(The second element of
TBTBond is the serial date number for December
Now combine short-term (Treasury bill) with long-term (Treasury bond) data to set up the overall term structure.
TBondsAll = [TBTBond; TBond]
TBondsAll = 1.0e+05 * 0 7.3085 0.0010 0.0010 0.0000 0.0000 7.3116 0.0010 0.0010 0.0000
The Financial Toolbox software provides a second data-preparation function,
tr2bonds, to convert the bond data into a form ready for the bootstrapping
tr2bonds generates a matrix of bond information sorted by
maturity date, plus vectors of prices and yields.
[Bonds, Prices, Yields] = tr2bonds(TBondsAll)
Bonds = 1.0e+05 * 7.3085 0 0.0010 0 0 0.0000 7.3116 0.0000 0.0010 0.0000 0 0.0000 Prices = 99.2654 103.1875 Yields = 0.0510 0.0564
Using this market data, you can use one of the Financial Toolbox bootstrapping functions to derive an implied zero curve. Bootstrapping is a process whereby you begin with known data points and solve
for unknown data points using an underlying arbitrage theory. Every coupon bond can be
valued as a package of zero-coupon bonds which mimic its cash flow and risk characteristics.
By mapping yields-to-maturity for each theoretical zero-coupon bond, to the dates spanning
the investment horizon, you can create a theoretical zero-rate curve. The Financial Toolbox software provides two bootstrapping functions:
zbtprice derives a zero curve from bond data and prices,
zbtyield derives a zero curve from bond data
and yields. Using
[ZeroRates, CurveDates] = zbtprice(Bonds, Prices, Settle)
ZeroRates = 0.05 0.06 CurveDates = 730846 731160
CurveDates gives the investment horizon.
ans = 26-Dec-2000 05-Nov-2001
[DiscRates, CurveDates] = zero2disc(ZeroRates, CurveDates, Settle); [FwdRates, CurveDates] = zero2fwd(ZeroRates, CurveDates, Settle); [PYldRates, CurveDates] = zero2pyld(ZeroRates, CurveDates, Settle);