Main Content

stttimespec

Specify time structure for standard trinomial tree

Description

example

TimeSpec = stttimespec(ValuationDate,Maturity,NumPeriods) creates a time spec for a standard trinomial (STT) tree.

Examples

collapse all

Create a RateSpec.

StartDates = datetime(2014,1,1); 
EndDates = datetime(2018,1,1); 
Rates = 0.025; 
Basis = 1; 
Compounding = -1;

RateSpec = intenvset('ValuationDate', StartDates, 'StartDates', StartDates,'EndDates',...
EndDates, 'Rates', Rates,'Compounding', Compounding, 'Basis', Basis)
RateSpec = struct with fields:
           FinObj: 'RateSpec'
      Compounding: -1
             Disc: 0.9048
            Rates: 0.0250
         EndTimes: 4
       StartTimes: 0
         EndDates: 737061
       StartDates: 735600
    ValuationDate: 735600
            Basis: 1
     EndMonthRule: 1

Create a StockSpec.

AssetPrice = 110; 
Sigma = 0.22; 
Div = 0.02; 
StockSpec = stockspec(Sigma, AssetPrice, 'continuous', Div)
StockSpec = struct with fields:
             FinObj: 'StockSpec'
              Sigma: 0.2200
         AssetPrice: 110
       DividendType: {'continuous'}
    DividendAmounts: 0.0200
    ExDividendDates: []

Create a STTTimespec and STTTree.

NumPeriods = length(cfdates(StartDates,EndDates,12));
TimeSpec = stttimespec(StartDates, EndDates, NumPeriods)
TimeSpec = struct with fields:
           FinObj: 'STTTimeSpec'
    ValuationDate: 735600
         Maturity: 737061
       NumPeriods: 48
            Basis: 0
     EndMonthRule: 1
             tObs: [0 0.0833 0.1667 0.2500 0.3333 0.4167 0.5000 0.5833 ... ]
             dObs: [735600 735630 735660 735691 735721 735752 735782 ... ]

STTT = stttree(StockSpec, RateSpec, TimeSpec)
STTT = struct with fields:
       FinObj: 'STStockTree'
    StockSpec: [1x1 struct]
     TimeSpec: [1x1 struct]
     RateSpec: [1x1 struct]
         tObs: [0 0.0833 0.1667 0.2500 0.3333 0.4167 0.5000 0.5833 ... ]
         dObs: [735600 735630 735660 735691 735721 735752 735782 735813 ... ]
        STree: {1x49 cell}
        Probs: {1x48 cell}

Input Arguments

collapse all

Date marking the pricing date and first observation in the tree, specified as a scalar datetime, string, or date character vector.

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

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

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

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

Data Types: double

Output Arguments

collapse all

Time layout for standard trinomial (STT) tree, returned as a structure.

Version History

Introduced in R2015b

expand all

See Also