zerorates

Calculate zero rates for parametercurve object

Description

example

outRates = zerorates(obj,inpDates) computes zero rates for the parametercurve object (obj) based on inpDates.

example

outRates = zerorates(___,inpComp,inpBasis) specifies options in addition to any of the input argument combinations in the previous syntax.

Examples

collapse all

Create a parametercurve object using parametercurve.

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 zero rates using zerorates.

CurveSettle = datetime(2019,9,15);
outRates = zerorates(PCobj,CurveSettle+30:30:CurveSettle+720)
outRates = 1×24

    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

Input Arguments

collapse all

parametercurve object, specified as a previously created parametercurve object.

Data Types: object

Input dates, specified as a scalar or an NPOINTS-by-1 vector of a datetimes, serial date numbers, cell array of date character vectors, or string array. StartDates must be earlier than EndDates.

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, or 12.

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, see Basis.

Data Types: double

Output Arguments

collapse all

Zero rates, returned as a numeric.

Introduced in R2020a