Documentation

getForwardRates

Get forward rates for input dates for IRFunctionCurve

Syntax

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

Arguments

CurveObj

Interest-rate curve object that is constructed using IRFunctionCurve.

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 the forward rates are:

  • -1 =  Continuous compounding

  • 1 = Annual compounding

  • 2 = Semiannual compounding (default)

  • 3 = Compounding three times per year

  • 4 = Quarterly compounding

  • 6 = Bimonthly compounding

  • 12 = Monthly compounding

Basis

(Optional) Day-count basis 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/actual (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. You must enter the optional arguments for Basis and Compounding as parameter/value pairs.

Examples

collapse all

Get Forward Rates For Input Dates For an IRFunctionCurve

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

irfc = IRFunctionCurve('Forward',today,@(t) polyval([-0.0001 0.003 0.02],t));
getForwardRates(irfc, today+30:30:today+720)
ans =

    0.0202
    0.0205
    0.0207
    0.0210
    0.0212
    0.0215
    0.0217
    0.0219
    0.0222
    0.0224
    0.0226
    0.0229
    0.0231
    0.0233
    0.0235
    0.0238
    0.0240
    0.0242
    0.0244
    0.0247
    0.0249
    0.0251
    0.0253
    0.0255

Related Examples

Introduced in R2008b

Was this topic helpful?