| Financial Toolbox | Search  Help Desk |
| zero2fwd | Examples See Also |
Forward curve given a zero curve.
Syntax
[fr, cd] = zero2fwd(zr, cd, sd, ocomp, obasis, icomp, ibasis) [fr, cd] = zero2fwd(zr, cd, sd, ocomp, obasis, icomp) [fr, cd] = zero2fwd(zr, cd, sd, ocomp, obasis) [fr, cd] = zero2fwd(zr, cd, sd, ocomp) [fr, cd] = zero2fwd(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.ocompfr. Allowed values are:12 = semi-annual compounding (default)3 = compounding three times per year4 = quarterly compounding6 = bimonthly compounding12 = monthly compounding365 = daily compounding1 = continuous compoundingobasisfr.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
[fr, cd] = zero2fwd(zr, cd, sd, ocomp, obasis, icomp, ibasis)
returns an implied forward rate curve given a zero curve and its maturity dates.
frfr constitute a forward curve over the dates in cd.cdfr. 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.0458
0.0502
0.0518
0.0519
0.0524
0.0519
0.0523
0.0525
0.0541
0.0529];
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 forward curve, on an actual/actual basis. The zero curve was compounded daily on an actual/365 basis.
ocomp = 1; obasis = 0; icomp = 365; ibasis = 3;Execute the function
[fr, cd] = zero2fwd(zr, cd, sd, ocomp, obasis, icomp, ibasis)which returns the forward rate curve
fr at the maturity dates cd:
fr =
0.0469
0.0519
0.0550
0.0536
0.0556
0.0511
0.0559
0.0546
0.0612
0.0487
cd =
729700
729735
729770
729791
729818
729847
729875
729931
730002
730071
(For readability, zr and fr are shown here only to the basis point. However, MATLAB computed them at full precision. If you enter zr as shown, fr may differ due to rounding.)
See Also
fwd2zero and other functions for Term Structure of Interest Rates