| Financial Toolbox | Search  Help Desk |
| zero2pyld | Examples See Also |
Par yield curve given a zero curve.
Syntax
[pr, cd] = zero2pyld(zr, cd, sd, ocomp, obasis, icomp, ibasis) [pr, cd] = zero2pyld(zr, cd, sd, ocomp, obasis, icomp) [pr, cd] = zero2pyld(zr, cd, sd, ocomp, obasis) [pr, cd] = zero2pyld(zr, cd, sd, ocomp) [pr, cd] = zero2pyld(zr, cd, sd)
Arguments
zrzr constitute an implied zero curve for the investment horizon represented by cd.cdzr. Use datenum to convert date strings to serial date numbers.sdzr.ocomppr. Allowed values are:12 = semi-annual compounding (default)3 = compounding three times per year4 = quarterly compounding6 = bimonthly compounding12 = monthly compoundingobasispr.0 = actual/actual (default), 1 = 30/360, 2 = actual/360, 3 = actual/365.icompzr. Allowed values are the same as for ocomp. Default = ocomp.ibasiszr.obasis. Default = obasis.Description
[pr, cd] = zero2pyld(zr, cd, sd, ocomp, obasis, icomp, ibasis)
returns a par yield curve given a zero curve and its maturity dates.
prpr constitute a par yield curve for the investment horizon represented by cd.cdpr. This vector is the same as the input vector cd. Use datestr to convert serial date numbers to date strings.Example
Given a zero curvezr over a set of maturity dates cd, and a settlement date sd:
zr = [0.0457
0.0487
0.0506
0.0507
0.0505
0.0504
0.0506
0.0516
0.0539
0.0530];
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 annual compounding for the par yield curve, on an actual/actual basis. The zero curve was compounded monthly, on an actual/365 basis.
ocomp = 1; obasis = 0; icomp = 12; ibasis = 3;Execute the function
[pr, cd] = zero2pyld(zr, cd, sd, ocomp, obasis, icomp, ibasis)which returns the par yield curve
pr at the maturity dates cd:
pr =
0.0478
0.0509
0.0529
0.0529
0.0526
0.0524
0.0525
0.0534
0.0555
0.0543
cd =
729700
729735
729770
729791
729818
729847
729875
729931
730002
730071
(For readability, zr and pr are shown only to the basis point. However, MATLAB computed them at full precision. If you enter zr as shown, pr may differ due to rounding.)
See Also
pyld2zero and other functions for Term Structure of Interest Rates