| Financial Toolbox | Search  Help Desk |
| fwd2zero | Examples See Also |
Zero curve given a forward curve.
Syntax
[zr, cd] = fwd2zero(fr, cd, sd, ocomp, obasis, icomp, ibasis) [zr, cd] = fwd2zero(fr, cd, sd, ocomp, obasis, icomp) [zr, cd] = fwd2zero(fr, cd, sd, ocomp, obasis) [zr, cd] = fwd2zero(fr, cd, sd, ocomp) [zr, cd] = fwd2zero(fr, cd, sd)
Arguments
frfr constitute an implied forward curve for the investment horizon represented by cd.cdfr. Use datenum to convert date strings to serial date numbers.sdfr.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.icompfr. Allowed values are the same as for ocomp. Default = ocomp.ibasisfr.obasis. Default = obasis.Description
[zr, cd] = fwd2zero(fr, cd, sd, ocomp, obasis, icomp, ibasis)
returns a zero curve given an implied forward 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 an implied forward curvefr over a set of maturity dates cd, and a settlement date sd:
fr = [0.0469
0.0519
0.0549
0.0535
0.0558
0.0508
0.0560
0.0545
0.0615
0.0486];
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 zero curve, on an actual/365 basis. The forward curve was compounded annually on an actual/actual basis.
ocomp = 365; obasis = 3; icomp = 1; ibasis = 0;Execute the function
[zr, cd] = fwd2zero(fr, cd, sd, ocomp, obasis, icomp, ibasis)which returns the zero curve
zr at the maturity dates cd:
zr =
0.0458
0.0502
0.0518
0.0518
0.0524
0.0518
0.0523
0.0525
0.0541
0.0529
cd =
729700
729735
729770
729791
729818
729847
729875
729931
730002
730071
(For readability, fr and zr are shown here only to the basis point. However, MATLAB computed them at full precision. If you enter fr as shown, zr may differ due to rounding.)
See Also
zero2fwd and other functions for Term Structure of Interest Rates