| Contents | Index |
BondPrices = prbyzero(Bonds, Settle, ZeroRates, ZeroDates, Compounding)
Bonds | Coupon bond information used to compute prices. A number of bonds (NUMBONDS)-by-6 matrix where each row describes a bond. The first two columns are required; the rest are optional but must be added in order. All rows in Bonds must have the same number of columns. Columns are [Maturity CouponRate Face Period Basis EndMonthRule] where: | |
Maturity | Maturity date as a serial date number or date string. | |
CouponRate | Decimal number indicating the annual percentage rate used to determine the coupons payable on a bond. | |
Face | (Optional) Face or par value of the bond. Default = 100. | |
Period | (Optional) Coupons per year of the bond. Allowed values are 0, 1, 2 (default), 3, 4, 6, and 12. | |
Basis | (Optional) Day-count basis of the instrument. A vector of integers.
For more information, see basis. | |
EndMonthRule | (Optional) End-of-month rule. This rule applies only when Maturity is an end-of-month date for a month having 30 or fewer days. 0 = ignore rule, meaning that a bond's coupon payment date is always the same numerical day of the month. 1 = set rule on (default), meaning that a bond's coupon payment date is always the last actual day of the month. | |
Settle | Serial date number of the settlement date. | |
ZeroRates | NUMDATES-by-NUMCURVES matrix of observed zero rates, as decimal fractions. Each column represents a rate curve. Each row represents an observation date. | |
ZeroDates | NUMDATES-by-1 column of dates for observed zeros | |
Compounding | Scalar value representing the rate at which the input zero rates were compounded when annualized. This argument determines the formula for the discount factors. Compounding values are: 1, 2, 3, 4, 6, 12. | |
BondPrices = prbyzero(Bonds, Settle, ZeroRates, ZeroDates, Compounding) computes the bond prices in a portfolio using a set of zero curves.
BondPrices is a NUMBONDS-by-NUMCURVES matrix of clean bond prices. Each column is derived from the corresponding zero curve in ZeroRates.
In addition, you can use the Fixed-Income Toolbox™ method getZeroRates for an IRDataCurve object with a Dates property to create a vector of dates and data acceptable for prbyzero. For more information, see Converting an IRDataCurve or IRFunctionCurve Object.
This example uses zbtprice to compute a zero curve given a portfolio of coupon bonds and their prices. It then reverses the process, using the zero curve as input to prbyzero to compute the prices.
Bonds = [datenum('6/1/1998') 0.0475 100 2 0 0;
datenum('7/1/2000') 0.06 100 2 0 0;
datenum('7/1/2000') 0.09375 100 6 1 0;
datenum('6/30/2001') 0.05125 100 1 3 1;
datenum('4/15/2002') 0.07125 100 4 1 0;
datenum('1/15/2000') 0.065 100 2 0 0;
datenum('9/1/1999') 0.08 100 3 3 0;
datenum('4/30/2001') 0.05875 100 2 0 0;
datenum('11/15/1999') 0.07125 100 2 0 0;
datenum('6/30/2000') 0.07 100 2 3 1;
datenum('7/1/2001') 0.0525 100 2 3 0;
datenum('4/30/2002') 0.07 100 2 0 0];
Prices = [ 99.375;
99.875;
105.75 ;
96.875;
103.625;
101.125;
103.125;
99.375;
101.0 ;
101.25 ;
96.375;
102.75 ];
Settle = datenum('12/18/1997');
Set semiannual compounding for the zero curve, on an actual/365 basis.
OutputCompounding = 2;
Execute zbtprice
[ZeroRates, ZeroDates] = zbtprice(Bonds, Prices, Settle,... OutputCompounding)
which returns the zero curve at the maturity dates.
ZeroRates =
0.0616
0.0609
0.0658
0.0590
0.0648
0.0655
0.0606
0.0601
0.0642
0.0621
0.0627
ZeroDates =
729907
730364
730439
730500
730667
730668
730971
731032
731033
731321
731336
Now execute prbyzero
BondPrices = prbyzero(Bonds, Settle, ZeroRates, ZeroDates)
which returns
BondPrices =
99.38
98.80
106.83
96.88
103.62
101.13
103.12
99.36
101.00
101.25
96.37
102.74
In this example zbtprice and prbyzero do not exactly reverse each other. Many of the bonds have the end-of-month rule off (EndMonthRule = 0). The rule subtly affects the time factor computation. If you set the rule on (EndMonthRule = 1) everywhere in the Bonds matrix, then prbyzero returns the original prices, except when the two incompatible prices fall on the same maturity date.
View demos and recorded presentations led by industry experts.
Now On Demand
Network with industry peers and learn the latest applications of the leading software product for computational finance.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |