| Financial Derivatives Toolbox |
 |
mkbush
Create bushy tree
Syntax
[Tree, NumStates] = mkbush(NumLevels, NumChild, NumPos, Trim,
NodeVal)
Arguments
NumLevels
|
Number of time levels of the tree.
|
NumChild
|
1 by number of levels (NUMLEVELS) vector with number of branches (children) of the nodes in each level.
|
NumPos
|
1-by-NUMLEVELS vector containing the length of the state vectors in each time level.
|
Trim
|
Scalar 0 or 1. If Trim = 1, NumPos decreases by 1 when moving from one time level to the next. Otherwise, if Trim = 0 (Default), NumPos does not decrease.
|
NodeVal
|
Initial value at each node of the tree. Default = NaN.
|
Description
[Tree, NumStates] = mkbush(NumLevels, NumChild, NumPos, Trim,
NodeVal)
creates a bushy tree Tree with initial values NodeVal at each node. NumStates is a 1-by-NUMLEVELS vector containing the number of state vectors in each level.
Examples
Create a tree with four time levels, two branches per node, and a vector of three elements in each node with each element initialized to NaN.
See Also
bushpath, bushshape
| isafin | | mktree |  |