treeshape

Shape of recombining binomial tree

Syntax

[NumLevels, NumPos, IsPriceTree] = treeshape(Tree)

Arguments

Tree

Recombining binomial tree.

Description

[NumLevels, NumPos, IsPriceTree] = treeshape(Tree) returns information on a recombining binomial 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.

IsPriceTree is a Boolean determining if a final horizontal branch is present in the tree.

Examples

Create a BDT tree by loading the example file.

load deriv.mat; 

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

treeviewer(BDTTree)

With this tree

[NumLevels, NumPos, IsPriceTree] = treeshape(BDTTree.FwdTree) 

returns

NumLevels  =   
     4

NumPos     =   
     1     1     1     1

IsPriceTree =
     0

See Also

|

Was this topic helpful?