Main Content

getZeroRates

Get zero rates for input dates for IRFunctionCurve

Description

example

F = getZeroRates(CurveObj,InpDates) computes zero rates for input dates for an IRFunctionCurve object.

Note

The parametercurve object and the associated zerorates were introduced in R2020a as part of a new object-based framework in the Financial Instruments Toolbox™ which supports end-to-end workflows in instrument modeling and analysis. For more information, see Get Started with Workflows Using Object-Based Framework for Pricing Financial Instruments.

example

F = getZeroRates(___,Name,Value) adds optional name-value pair arguments.

Examples

collapse all

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

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

    0.0201
    0.0202
    0.0204
    0.0205
    0.0206
    0.0207
    0.0209
    0.0210
    0.0211
    0.0212
      ⋮

Input Arguments

collapse all

Interest-rate curve object, specified by using IRFunctionCurve.

Data Types: object

Input dates, specified as an NINST-by-1 vector using a datetime array, string array, or date character vectors. The input dates must be after the Settle date of IRFunctionCurve.

To support existing code, getZeroRates also accepts serial date numbers as inputs, but they are not recommended.

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: F = getZeroRates(irfc, CurveSettle+30:30:CurveSettle+720)

Compounding frequency per-year for zero rates, specified as the comma-separated pair consisting of 'Compounding' and a scalar numeric using one of the supported values:

  • −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

Data Types: double

Day count basis for the zero rates, specified as the comma-separated pair consisting of 'Basis' and 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 vector.

Version History

Introduced in R2008b

expand all