Main Content

forwardrates

Calculate forward rates forparametercurveobject

Description

example

outRates= forwardrates(obj,startDates,endDates)computes forward rates for theparametercurveobject (obj) based onstartDatesandendDates.

example

outRates= forwardrates(___,inpComp,inpBasis)指定选项除了任何输入argument combinations in the previous syntax.

Examples

collapse all

Create aparametercurveobject usingparametercurve.

PCobj = parametercurve('zero',datetime(2019,9,15),@(t)polyval([-0.0001 0.003 0.02],t),'Compounding',4,'Basis',5,'Parameters',[-0.0001 0.003 0.02])
PCobj = parametercurve with properties: Type: "zero" Settle: 15-Sep-2019 Compounding: 4 Basis: 5 FunctionHandle: @(t)polyval([-0.0001,0.003,0.02],t) Parameters: [-1.0000e-04 0.0030 0.0200]

Compute the forward rates usingforwardrates.

CurveSettle = datetime(2019,9,15); outRates = forwardrates(PCobj,datetime(2019,12,15),datetime(2020,9,15),6,7)
outRates = 0.0236

Input Arguments

collapse all

parametercurveobject, specified as a previously createdparametercurveobject.

Data Types:object

Start dates of the interval to discount over, specified as a scalar or anNPOINTS-by-1vector of a datetimes, serial date numbers, cell array of date character vectors, or string array.startDatesmust be earlier thanendDates.

Data Types:string|datetime|double|char|cell

Maturity dates ending the interval to discount over, specified as a scalar or anNPOINTS-by-1vector of a datetimes, serial date numbers, cell array of date character vectors, or string array.

Data Types:string|datetime|double|char|cell

(Optional) Input compounding frequency, specified as a scalar numeric using one of the supported values:–1,0,1,2,3,4,6, or12.

Data Types:double

(Optional) Input day-count basis, specified as a scalar integer.

  • 0 = actual/actual

  • 1 = 30/360 (SIA)

  • 2 = actual/360

  • 3 = actual/365

  • 4 = 30/360 (PSA)

  • 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, seeBasis.

Data Types:double

Output Arguments

collapse all

Forward rates, returned as a numeric.

Version History

Introduced in R2020a