| Financial Toolbox | Search  Help Desk |
| disc2zero | Examples See Also |
Zero curve given a discount curve.
Syntax
[zr, cd] = disc2zero(dr, cd, sd, ocomp, obasis) [zr, cd] = disc2zero(dr, cd, sd, ocomp) [zr, cd] = disc2zero(dr, cd, sd)
Arguments
drdr constitute a discount curve for the investment horizon represented by cd.cddr. Use datenum to convert date strings to serial date numbers.sddr.ocompzr. Allowed values are:12 = semi-annual compounding (default)3 = compounding three times per year4 = quarterly compounding6 = bimonthly compounding12 = monthly compounding365 = daily compounding1 = continuous compoundingobasiszr.0 = actual/actual (default), 1 = 30/360, 2 = actual/360, 3 = actual/365.Description
[zr, cd] = disc2zero(dr, cd, sd, ocomp, obasis)
returns a zero curve given a discount curve and its maturity dates.
zrzr constitute a zero curve for the investment horizon represented by cd. The zero rates are the yields to maturity on theoretical zero-coupon bonds.cdzr. This vector is the same as the input vector cd. Use datestr to convert serial date numbers to date strings.Example
Given discount factorsdr over a set of maturity dates cd, and a settlement date sd:
dr = [0.9996
0.9947
0.9896
0.9866
0.9826
0.9786
0.9745
0.9665
0.9552
0.9466];
cd = [datenum('06-Nov-1997')
datenum('11-Dec-1997')
datenum('15-Jan-1998')
datenum('05-Feb-1998')
datenum('04-Mar-1998')
datenum('02-Apr-1998')
datenum('30-Apr-1998')
datenum('25-Jun-1998')
datenum('04-Sep-1998')
datenum('12-Nov-1998')];
sd = datenum('03-Nov-1997');
Set daily compounding for the output zero curve, on an actual/365 basis.
ocomp = 365; obasis = 3;Execute the function
[zr, cd] = disc2zero(dr, cd, sd, ocomp, obasis)which returns the zero curve
zr at the maturity dates cd:
zr =
0.0487
0.0510
0.0523
0.0524
0.0530
0.0526
0.0530
0.0532
0.0549
0.0536
cd =
729700
729735
729770
729791
729818
729847
729875
729931
730002
730071
(For readability, dr and zr are shown here only to the basis point. However, MATLAB computed them at full precision. If you enter dr as shown, zr may differ due to rounding.)
See Also
zero2disc and other functions for Term Structure of Interest Rates