| Contents | Index |
[NumLevels, NumPos, IsPriceTree] =
treeshape(Tree)
Tree | Recombining binomial tree. |
[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.
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
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 |