cirtimespec

Specify time structure for Cox-Ingersoll-Ross tree

Description

example

TimeSpec = cirtimespec(ValuationDate,Maturity,NumPeriods) creates a time spec for a Cox-Ingersoll-Ross (CIR) tree.

example

TimeSpec = cirtimespec(___,Name,Value) adds additional name-value pair arguments.

Examples

collapse all

Set the number of levels and node times for an CIR tree by specifying a four-period tree with time steps of 1 year.

ValuationDate = 'Jan-1-2017'; 
Maturity = '01-Jan-2021'; 
NumPeriods = 4
NumPeriods = 4
CIRTimeSpec = cirtimespec(ValuationDate, Maturity, NumPeriods)
CIRTimeSpec = struct with fields:
           FinObj: 'CIRTimeSpec'
    ValuationDate: 736696
         Maturity: 738157
       NumPeriods: 4
      Compounding: 1
            Basis: 0
     EndMonthRule: 1
             tObs: [0 1 2 3 4]
             dObs: [736696 737061 737426 737791 738157]

Input Arguments

collapse all

Date marking the pricing date and first observation in the tree, specified as a scalar using a serial date number or date character vector.

Data Types: double | char

Date marking the depth of the tree, specified as a scalar using a serial date number or date character vector.

Data Types: double | char

Determines how many time steps are in tree, specified as a scalar using a nonnegative integer value.

Data Types: double

Name-Value Pair 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: TimeSpec = cirtimespec(Valuationdate,Maturity,NumPeriods,'Basis',3)

Frequency at which the rates are compounded when annualized, specified as the comma-separated pair consisting of 'Compounding' and a scalar value:

  • 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, specified as the comma-separated pair consisting of 'Basis' and a scalar value:

  • 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

End-of-month rule flag for generating dates when Maturity is an end-of-month date for a month having 30 or fewer days, specified as the comma-separated pair consisting of 'EndMonthRule' and a nonnegative integer [0, 1] using a scalar.

  • 0 = Ignore rule, meaning that a payment date is always the same numerical day of the month.

  • 1 = Set rule on, meaning that a payment date is always the last actual day of the month.

Data Types: logical

Output Arguments

collapse all

Time layout for the CIRTree, returned as a structure.

See Also

Introduced in R2018a