Documentation

getForwardRates

Get forward rates for input dates for IRDataCurve

Syntax

F = getForwardRates(CurveObj, InpDates)
F = getForwardRates(CurveObj, InpDates, 'Parameter1', Value1,
'Parameter2', Value2, ...)

Arguments

CurveObj

Interest-rate curve object that is constructed using IRDataCurve.

InpDates

Vector of input dates using MATLAB® date format. The input dates must be after the settle date.

Compounding

(Optional) Scalar that sets the compounding frequency per year for forward rates. The default Compounding value is CurveObj.Compounding. Acceptable values are:

  • −1 = Continuous compounding

  • 0 = Simple interest (no compounding)

  • 1 = Annual compounding

  • 2 = Semiannual compounding

  • 3 = Compounding three times per year

  • 4 = Quarterly compounding

  • 6 = Bimonthly compounding

  • 12 = Monthly compounding

Basis

(Optional) Day-count basis values for the forward rates:

  • 0 = actual/actual (default)

  • 1 = 30/360 (SIA)

  • 2 = actual/360

  • 3 = actual/365

  • 4 = 30/360 (BMA)

  • 5 = 30/360 (ISDA)

  • 6 = 30/360 (European)

  • 7 = actual/365 (Japanese)

  • 8 = actual/actual (ICMA)

  • 9 = actual/360 (ICMA)

  • 10 = actual/365 (ICMA)

  • 11 = 30/360E (ICMA)

  • 12 = actual/365 (ISDA)

  • 13 = BUS/252

For more information, see basis.

Description

F = getForwardRates(CurveObj, InpDates, 'Parameter1', Value1, 'Parameter2', Value2, ...) returns forward rates for the input dates. getForwardRates returns discrete forward rates for the intervals input into this method. For example, running the following code:

getForwardRates(irdc, {Date1, Date2, Date3}) 
gives three forwards rates and the three tenors are: [Settle, Date1], [Date1, Date2], and [Date2, Date3].

You must enter the optional arguments for Basis and Compounding as parameter/value pairs. The getForwardRates method returns forward rates corresponding to the periodicity of the dates input to getForwardRates. For example, where the dates are monthly, monthly forward rates are returned. The first element of the output is the forward rate from the Settle to one month, the second element is the forward rate from one month to two months, etc.

Examples

collapse all

Get Forward Rates For Input Dates for an IRDataCurve

This example shows how to get forward rates for input dates for an IRDataCurve.

Data = [2.09 2.47 2.71 3.12 3.43 3.85 4.57 4.58]/100;
Dates = daysadd(today,[360 2*360 3*360 5*360 7*360 10*360 20*360 30*360],1);
irdc = IRDataCurve('Zero',today,Dates,Data);
getForwardRates(irdc, today+30:30:today+720)
ans =

    0.0174
    0.0180
    0.0187
    0.0193
    0.0199
    0.0205
    0.0212
    0.0218
    0.0224
    0.0230
    0.0237
    0.0243
    0.0249
    0.0255
    0.0262
    0.0268
    0.0274
    0.0280
    0.0287
    0.0293
    0.0299
    0.0305
    0.0312
    0.0318

Use getForwardRates to Compute the 5 Year Forward Rate in 5 Years Time

Use getForwardRates to compute the forward rate from the Settle date to 5 years from now and then the forward rate for the period from 5 years to 10 years from now.

Data = [2.09 2.47 2.71 3.12 3.43 3.85 4.57 4.58]/100;
Dates = daysadd(today,[360 2*360 3*360 5*360 7*360 10*360 20*360 30*360],1);
irdc = IRDataCurve('Zero',today,Dates,Data);
getForwardRates(irdc,datemnth(irdc.Settle,12*[5 10]))
ans =

    0.0312
    0.0458

The first element (.0312) is the forward rate from the Settle to 5 years from now. The second rate (0.0458) is the forward rate for the period from 5 years to 10 years from now, in other words, the 5-year forward rate 5 years from now.

Related Examples

See Also

Introduced in R2008b

Was this topic helpful?