| Financial Toolbox | Search  Help Desk |
| pyld2zero | Examples See Also |
Zero curve given a par yield curve.
Syntax
[zr, cd] = pyld2zero(pr,cd,sd,ocomp,obasis,icomp,ibasis,maxiter) [zr, cd] = pyld2zero(pr,cd,sd,ocomp,obasis,icomp,ibasis) [zr, cd] = pyld2zero(pr,cd,sd,ocomp,obasis,icomp) [zr, cd] = pyld2zero(pr,cd,sd,ocomp,obasis) [zr, cd] = pyld2zero(pr,cd,sd,ocomp) [zr, cd] = pyld2zero(pr,cd,sd)
Arguments
prpr constitute a par yield curve for the investment horizon represented by cd.cdpr. Use datenum to convert date strings to serial date numbers.sdpr.ocompzr. Allowed values are:12 = semi-annual compounding (default)3 = compounding three times per year4 = quarterly compounding6 = bimonthly compounding12 = monthly compoundingobasiszr.0 = actual/actual (default), 1 = 30/360, 2 = actual/360, 3 = actual/365.icomppr. Allowed values are the same as for ocomp. Default = ocomp.ibasispr. Allowed values are the same as for obasis. Default = obasis.maxiterzr. A scalar. Default = 200.Description
[zr, cd] = pyld2zero(pr,cd,sd,ocomp,obasis,icomp,ibasis,maxiter)
returns a zero curve given a par yield curve and its maturity dates.
zrzr constitute a zero curve for the investment horizon represented by cd.cdzr. This vector is the same as the input vector cd. Use datestr to convert serial date numbers to date strings.Example
Given a par yield curvepr over a set of maturity dates cd, and a settlement date sd:
pr = [0.0479
0.0522
0.0540
0.0540
0.0536
0.0532
0.0532
0.0539
0.0558
0.0543];
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 monthly compounding for the zero curve, on an actual/365 basis. The par yield curve was compounded annually on an actual/actual basis. Derive the zero curve within 50 iterations.
ocomp = 12; obasis = 3; icomp = 1; ibasis = 0; maxiter = 50;Execute the function
[zr, cd] = pyld2zero(pr,cd,sd,ocomp,obasis,icomp,ibasis,maxiter)which returns the zero curve
zr at the maturity dates cd:
zr =
0.0466
0.0494
0.0514
0.0514
0.0504
0.0504
0.0502
0.0514
0.0535
0.0530
cd =
729700
729735
729770
729791
729818
729847
729875
729931
730002
730071
(For readability, pr and zr are shown only to the basis point. However, MATLAB computed them at full precision. If you enter pr as shown, zr may differ due to rounding.)
See Also
zero2pyld and other functions for Term Structure of Interest Rates