TrinomialTree - Maple Help

Finance

 TrinomialTree
 construct a recombining trinomial tree

 Calling Sequence TrinomialTree(G, S, ${P}_{u}$, ${P}_{d}$, ${P}_{m}$, opts) TrinomialTree(T, S, ${P}_{u}$, ${P}_{d}$, ${P}_{m}$, opts) TrinomialTree(T, N, ${S}_{0}$, ${S}_{u}$, ${P}_{u}$, ${S}_{d}$, ${P}_{d}$, ${P}_{m}$, opts)

Parameters

 G - time grid data structure; time grid S - Array or list; state space of the discretized process ${P}_{u}$ - non-negative constant or operator; probability of moving to the upper descendant in the tree ${P}_{d}$ - non-negative constant or operator; probability of moving to the lower descendant in the tree ${P}_{m}$ - (optional) non-negative constant or operator; probability of moving to the middle descendant in the tree T - positive; stopping time N - posint; number of times steps ${S}_{0}$ - positive constant; initial value ${S}_{u}$ - positive constant; upward movement ${S}_{d}$ - positive constant; downward movement opts - (optional) equation(s) of the form option = value where option is mutable; specify options for the TrinomialTree command

Options

 • mutable = truefalse -- This option specifies whether the tree should be mutable or not. The default is true.

Description

 • The TrinomialTree(G, S, ${P}_{u},{P}_{d},{P}_{m}$, opts) calling sequence constructs a recombining trinomial tree approximating a certain stochastic process. This can be a GeometricBrownianMotion or a mean-reverting process such as OrnsteinUhlenbeckProcess or GaussMarkovProcess. The constructed tree will be based on the discretizations of the time and the state spaces given by G and S.
 • Assume that the time grid G consists of $N$ points ${T}_{1}$, ${T}_{1}$, ..., ${T}_{N}$. Then the resulting trinomial tree will have $N$ levels, each level representing possible states of the discretized process at time ${T}_{i}$, $i=1..N$. The parameter S contains all possible states of the discretized process. The number of elements of S should be equal to $2N-1$, and the elements of S must be sorted in descending order.
 • At level $i$, $i=1..N$ the tree has $i$ nodes, ${S}_{i,1}$, ..., ${S}_{i,i}$. Each node ${S}_{i,j}$ has three descendants at level $i+1$, ${S}_{i+1,j}$ (the upper descendant), ${S}_{i+1,j+1}$ (the middle descendant), and ${S}_{i+1,j+2}$ (the lower descendant). The initial state of the underlying process will be equal to ${S}_{N}$. The states of the underlying at the level $i$ are ${S}_{N-i}$, ..., ${S}_{N-1}$, ${S}_{N}$, ${S}_{N+1}$, ..., ${S}_{N+i}$.
 • The transition probabilities (i.e. the probability of going from ${S}_{i,j}$ to ${S}_{i+1,j}$, the probability of going from ${S}_{i,j}$ to ${S}_{i+1,j+1}$, and the probability of going from ${S}_{i,j}$ to ${S}_{i+1,j+2}$) are defined by ${P}_{u}$, ${P}_{d}$ and ${P}_{m}$. The parameter ${P}_{m}$ is optional. By default, the middle probability is calculated so that the total sum of all three probabilities is equal to $1$, that is, ${P}_{m}$ is set to $1-{P}_{d}-{P}_{u}$.
 • The parameters ${P}_{u}$, ${P}_{d}$, and ${P}_{m}$ can be either non-negative real constants or one-parameter operators. If ${P}_{u}$, ${P}_{d}$, or ${P}_{m}$ is given in the operator form the corresponding transition probability at level $i$ will be calculated as ${P}_{u}\left(\mathrm{dt}\right)$, ${P}_{d}\left(\mathrm{dt}\right)$, or ${P}_{m}\left(\mathrm{dt}\right)$ respectively, where $\mathrm{dt}={T}_{i+1}-{T}_{i}$.
 • The TrinomialTree(T, S, ${P}_{u},{P}_{d},{P}_{m}$, opts) calling sequence is similar except that in this case a uniform time grid with step size $\frac{T}{N}$ is used instead of G. In this case $N$ will be deduced from the size of the state array S.
 • Finally, TrinomialTree(T, N, ${S}_{0},{S}_{u},{P}_{u},{S}_{d},{P}_{d},{P}_{m}$, opts) calling sequence will construct a trinomial tree based on a uniform time grid with step size $\frac{T}{N}$. Each tree node ${S}_{i,j}$ will have two descendants ${S}_{i+1,j}={S}_{i,j}{S}_{u}$ (the upper descendant) and ${S}_{i+1,j+1}={S}_{i,j}{S}_{d}$ (the lower descendant). The transition probabilities will be calculated the same way as above.
 • The resulting data structure can be further manipulated using the Finance[SetUnderlying] and Finance[SetProbabilities] commands.

Examples

 > $\mathrm{with}\left(\mathrm{Finance}\right):$
 > $S≔\left[7.9,7.5,7.1,6.5,5.,3.7,3.3,2.95,2.8\right]$
 ${S}{≔}\left[{7.9}{,}{7.5}{,}{7.1}{,}{6.5}{,}{5.}{,}{3.7}{,}{3.3}{,}{2.95}{,}{2.8}\right]$ (1)
 > $T≔\mathrm{TrinomialTree}\left(3,S,0.3,0.7\right):$

Here are three different views of the same tree. The first one uses the standard scale, the second one uses the logarithmic scale, and the third one uses the exponential scale.

 > $\mathrm{TreePlot}\left(T,\mathrm{thickness}=2,\mathrm{axes}=\mathrm{BOXED},\mathrm{gridlines}=\mathrm{true}\right)$
 > $\mathrm{TreePlot}\left(T,\mathrm{thickness}=2,\mathrm{axes}=\mathrm{BOXED},\mathrm{gridlines}=\mathrm{true},\mathrm{color}=\mathrm{red}..\mathrm{blue},\mathrm{scale}=\mathrm{logarithmic}\right)$
 > $\mathrm{TreePlot}\left(T,\mathrm{thickness}=2,\mathrm{axes}=\mathrm{BOXED},\mathrm{gridlines}=\mathrm{true},\mathrm{color}=\mathrm{red}..\mathrm{blue},\mathrm{scale}=\mathrm{exponential}\right)$

Inspect the tree.

 > $\mathrm{GetUnderlying}\left(T,5,1\right)$
 ${7.900000000}$ (2)
 > $\mathrm{GetProbabilities}\left(T,3,1\right)$
 $\left[{0.3000000000}{,}{0.}{,}{0.7000000000}\right]$ (3)

Change the value of the underlying at the uppermost node on level 5 and compare the two trees.

 > $\mathrm{P1}≔\mathrm{TreePlot}\left(T,\mathrm{thickness}=2,\mathrm{axes}=\mathrm{BOXED},\mathrm{gridlines}=\mathrm{true}\right):$
 > $\mathrm{SetUnderlying}\left(T,5,1,8.5\right)$
 > $\mathrm{P2}≔\mathrm{TreePlot}\left(T,\mathrm{thickness}=2,\mathrm{axes}=\mathrm{BOXED},\mathrm{color}=\mathrm{red},\mathrm{gridlines}=\mathrm{true}\right):$
 > $\mathrm{plots}\left[\mathrm{display}\right]\left(\mathrm{P1},\mathrm{P2}\right)$

Here is the same example as before but using a non-homogeneous time grid.

 > $G≔\mathrm{TimeGrid}\left(\left[0,1.5,2.0,2.5,3.0\right]\right)$
 ${G}{≔}{\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (4)
 > $S≔\left[7.9,7.5,7.1,6.5,5.,3.7,3.3,2.95,2.8\right]$
 ${S}{≔}\left[{7.9}{,}{7.5}{,}{7.1}{,}{6.5}{,}{5.}{,}{3.7}{,}{3.3}{,}{2.95}{,}{2.8}\right]$ (5)
 > $T≔\mathrm{TrinomialTree}\left(G,S,0.3,0.7\right):$

Here are three different views of the same tree. The first one uses the standard scale, the second one uses the logarithmic scale, and the third one uses the exponential scale.

 > $\mathrm{TreePlot}\left(T,\mathrm{thickness}=2,\mathrm{axes}=\mathrm{BOXED},\mathrm{gridlines}=\mathrm{true}\right)$
 > $\mathrm{TreePlot}\left(T,\mathrm{thickness}=2,\mathrm{axes}=\mathrm{BOXED},\mathrm{gridlines}=\mathrm{true},\mathrm{color}=\mathrm{red}..\mathrm{blue},\mathrm{scale}=\mathrm{logarithmic}\right)$
 > $\mathrm{TreePlot}\left(T,\mathrm{thickness}=2,\mathrm{axes}=\mathrm{BOXED},\mathrm{gridlines}=\mathrm{true},\mathrm{color}=\mathrm{red}..\mathrm{blue},\mathrm{scale}=\mathrm{exponential}\right)$

Inspect the tree.

 > $\mathrm{GetUnderlying}\left(T,5,1\right)$
 ${7.900000000}$ (6)
 > $\mathrm{GetProbabilities}\left(T,3,1\right)$
 $\left[{0.3000000000}{,}{0.}{,}{0.7000000000}\right]$ (7)

Change the value of the underlying at the uppermost node on level 5 and compare the two trees.

 > $\mathrm{P1}≔\mathrm{TreePlot}\left(T,\mathrm{thickness}=2,\mathrm{axes}=\mathrm{BOXED},\mathrm{gridlines}=\mathrm{true}\right):$
 > $\mathrm{SetUnderlying}\left(T,5,1,8.5\right)$
 > $\mathrm{P2}≔\mathrm{TreePlot}\left(T,\mathrm{thickness}=2,\mathrm{axes}=\mathrm{BOXED},\mathrm{color}=\mathrm{red},\mathrm{gridlines}=\mathrm{true}\right):$
 > $\mathrm{plots}\left[\mathrm{display}\right]\left(\mathrm{P1},\mathrm{P2}\right)$

In this example you will use the third construction.

 > $\mathrm{Su}≔1.1$
 ${\mathrm{Su}}{≔}{1.1}$ (8)
 > $\mathrm{Sd}≔0.95$
 ${\mathrm{Sd}}{≔}{0.95}$ (9)
 > $T≔\mathrm{TrinomialTree}\left(3,20,100,\mathrm{Su},0.3,\mathrm{Sd},0.7\right):$

Here are two different views of the same tree. The first one uses the standard scale, the second one uses the logarithmic scale.

 > $\mathrm{TreePlot}\left(T,\mathrm{thickness}=2,\mathrm{axes}=\mathrm{BOXED},\mathrm{gridlines}=\mathrm{true}\right)$
 > $\mathrm{TreePlot}\left(T,\mathrm{thickness}=2,\mathrm{axes}=\mathrm{BOXED},\mathrm{gridlines}=\mathrm{true},\mathrm{color}=\mathrm{red}..\mathrm{blue},\mathrm{scale}=\mathrm{logarithmic}\right)$

Inspect the tree.

 > $\mathrm{GetUnderlying}\left(T,5,1\right)$
 ${146.4100000}$ (10)
 > $\mathrm{GetProbabilities}\left(T,3,1\right)$
 $\left[{0.3000000000}{,}{0.}{,}{0.7000000000}\right]$ (11)

Change the value of the underlying at the uppermost node on level 5 and compare the two trees.

 > $\mathrm{P1}≔\mathrm{TreePlot}\left(T,\mathrm{thickness}=2,\mathrm{axes}=\mathrm{BOXED},\mathrm{gridlines}=\mathrm{true}\right):$
 > $\mathbf{for}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}i\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{to}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}20\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{SetUnderlying}\left(T,i,i,100{0.9}^{i-1}\right)\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}$
 > $\mathrm{P2}≔\mathrm{TreePlot}\left(T,\mathrm{thickness}=2,\mathrm{axes}=\mathrm{BOXED},\mathrm{color}=\mathrm{red},\mathrm{gridlines}=\mathrm{true}\right):$
 > $\mathrm{plots}\left[\mathrm{display}\right]\left(\mathrm{P1},\mathrm{P2}\right)$

References

 Brigo, D., Mercurio, F., Interest Rate Models: Theory and Practice, New York: Springer-Verlag, 2001.
 Glasserman, P., Monte Carlo Methods in Financial Engineering, New York: Springer-Verlag, 2004.
 Hull, J., Options, Futures, and Other Derivatives, 5th. edition. Upper Saddle River, New Jersey: Prentice Hall, 2003.
 Hull, J., and White, A., Numerical Procedures for Implementing Term Structure Models I: Single-Factor Models, Journal of Derivatives, 1994, 7-16.
 Hull, J., and White, A., Using Hull-White Interest Rate Trees, Journal of Derivatives, 1996, 26-36.

Compatibility

 • The Finance[TrinomialTree] command was introduced in Maple 15.