Skip to Main Content Skip to Search
Product Documentation

trintreeshape - Shape of recombining trinomial tree

Syntax

[NumLevels, NumPos, NumStates] = trintreeshape(TrinTree)

Arguments

TrinTree

Recombining price or interest-rate trinomial tree.

Description

[NumLevels, NumPos, NumStates] = trintreeshape(TrinTree) returns information on a recombining trinomial tree's shape.

NumLevels is the number of time levels of the tree.

NumPos is a 1-by-NUMLEVELS vector containing the length of the state vectors in each level.

NumStates is a 1-by-NUMLEVELS vector containing the number of state vectors in each level.

Examples

Create a Hull-White tree by loading the example file.

load deriv.mat; 

With treeviewer you can see the general shape of the HW interest-rate tree.

treeviewer(HWTree)

With this tree

[NumLevels, NumPos, NumStates] = trintreeshape(HWTree) 

returns

NumLevels  =   
     4

NumPos     =   
     1     1     1     1

NumStates =
     1     3     5     5

See Also

mktrintree | trintreepath

  


Free Interactive Computational Finance CD

View demos and recorded presentations led by industry experts.

Now On Demand
Network with industry peers and learn the latest applications of the leading software product for computational finance.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS