getForwardRates

Get forward rates for input dates for IRDataCurve

Syntax

F = getForwardRates(CurveObj,InpDates)
F = getForwardRates(CurveObj,InpDates,Name,Value)

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,Name,Value) 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 comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

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, and so on.

Examples

collapse all

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

CurveSettle = datenum('2-Mar-2016');
Data = [2.09 2.47 2.71 3.12 3.43 3.85 4.57 4.58]/100;
Dates = datemnth(CurveSettle,12*[1 2 3 5 7 10 20 30]);
irdc = IRDataCurve('Zero',CurveSettle,Dates,Data);
getForwardRates(irdc, CurveSettle+30:30:CurveSettle+720)
ans = 24×1

    0.0174
    0.0180
    0.0187
    0.0193
    0.0199
    0.0205
    0.0212
    0.0218
    0.0224
    0.0230
      ⋮

Use getForwardRates to compute the forward rate from the Settle date to 5 years from March 1, 2017 and then the forward rate for the period from 5 years to 10 years from March 1, 2017.

Data = [2.09 2.47 2.71 3.12 3.43 3.85 4.57 4.58]/100;
Dates = daysadd(736755,[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 = 2×1

    0.0350
    0.0456

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

Use the following data to create an IRDataCurve object:

Data = [0.1 0.30 0.70 1.05 1.45 1.71 2.12 2.43 2.85 3.57]/100;
Settle = datenum('08-Aug-2016'); % Today's date
Dates = datemnth(Settle,[3 6 9 12*[1 2 3 5 7 10 20]]);
irdc = IRDataCurve('Zero',Settle,Dates,Data)
irdc = 
			 Type: Zero
		   Settle: 736550 (08-Aug-2016)
	  Compounding: 2
			Basis: 0 (actual/actual)
	 InterpMethod: linear
			Dates: [10x1 double]
			 Data: [10x1 double]

Compute the implied 6 month forward rates in 1 month, 2 months, and 3 months from the Settle date.

IntervalMonth = 6; % Interval for 6 month forward rates
FwdMonths = [1 2 3]'; % Starting in 1, 2, and 3 months from Settle
N = length(FwdMonths);
FwdRates_6M = zeros(N,1);

for k = 1:N
    FwdDates = datemnth(irdc.Settle, [FwdMonths(k) FwdMonths(k)+IntervalMonth]);
    f = getForwardRates(irdc,FwdDates);
    FwdRates_6M(k) = f(2);
end

[FwdMonths FwdRates_6M]
ans = 3×2

    1.0000    0.0050
    2.0000    0.0074
    3.0000    0.0101

Introduced in R2008b