Main Content

getParYields

Get par yields for input dates for IRDataCurve

Description

example

F = getParYields(CurveObj,InpDates) computes par yields for input dates for an IRDataCurve object.

example

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

Examples

collapse all

This example shows how to get par yields 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);
getParYields(irdc, CurveSettle+30:30:CurveSettle+720)
ans = 24×1

    0.0175
    0.0177
    0.0181
    0.0183
    0.0186
    0.0189
    0.0194
    0.0197
    0.0200
    0.0203
      ⋮

This example shows how set the compounding of an IRDataCurve to Zero (simple interest) and then compute par yields from that curve.

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,'Compounding',0);
SimpleInt = irdc.getParYields(Dates(1), 'Basis', 2, 'Compounding', 1)
SimpleInt = 0.0209

Input Arguments

collapse all

Interest-rate curve object, specified by using IRDataCurve.

Data Types: object

Input dates, specified using MATLAB® date format. The input dates must be after the Settle date of IRDataCurve.

Data Types: double

Name-Value Arguments

Specify optional 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.

Example: F = getParYields(irdc, CurveSettle+30:30:CurveSettle+720)

Compounding frequency per-year for par yield 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 par yield 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

Par yields, returned as a vector.

Introduced in R2008b