Shape of recombining binomial tree
[NumLevels,NumPos,IsPriceTree] = treeshape(Tree)
example
[NumLevels,NumPos,IsPriceTree] = treeshape(Tree) returns information on a recombining binomial tree's shape.
NumLevels
NumPos
IsPriceTree
Tree
collapse all
This example shows how to obtain information on a recombining binomial tree's shape.
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
treeviewer(BDTTree)
Use treeshape to display the shape of the binomial tree.
treeshape
[NumLevels, NumPos, IsPriceTree] = treeshape(BDTTree.FwdTree)
NumLevels = 4
NumPos = 1×4 1 1 1 1
IsPriceTree = logical 0
Recombining binomial tree, specified as a struct that is created using one of the following functions:
hjmtree
bdttree
hwtree
bktree
cirtree
Data Types: struct
struct
Number of time levels of tree, returned as a numeric.
Length of the state vectors in each level, returned as a 1-by-NUMLEVELS vector.
1
NUMLEVELS
Indicates if final horizontal branch is present in the tree, returned as a Boolean.
mktree | treepath
mktree
treepath
You have a modified version of this example. Do you want to open this example with your edits?