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 0.6667 0.7500 0.8333 0.9167 1 1.0833 1.1667 1.2500 1.3333 1.4167 1.5000 1.5833 1.6667 1.7500 1.8333 1.9167 2 2.0833 2.1667 2.2500 2.3333 2.4167 2.5000 2.5833 2.6667 ... ] (1x49 double)
             dObs: [735600 735630 735660 735691 735721 735752 735782 735813 735843 735873 735904 735934 735965 735995 736026 736056 736087 736117 736147 736178 736208 736239 736269 736300 736330 736360 736391 736421 736452 736482 ... ] (1x49 double)

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 0.6667 0.7500 0.8333 0.9167 1 1.0833 1.1667 1.2500 1.3333 1.4167 1.5000 1.5833 1.6667 1.7500 1.8333 1.9167 2 2.0833 2.1667 2.2500 2.3333 2.4167 2.5000 2.5833 2.6667 ... ] (1x49 double)
         dObs: [735600 735630 735660 735691 735721 735752 735782 735813 735843 735873 735904 735934 735965 735995 736026 736056 736087 736117 736147 736178 736208 736239 736269 736300 736330 736360 736391 736421 736452 736482 736513 ... ] (1x49 double)
        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