plot a binomial/trinomial tree - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Finance : Lattice Methods : Finance/TreePlot

Finance[TreePlot] - plot a binomial/trinomial tree

Calling Sequence

TreePlot(tree, opts, plotopts)

Parameters

tree

-

binomial or trinomial tree data structure; tree

opts

-

(optional) equation(s) of the form option = value where option is scale; specify options for the TreePlot command

plotopts

-

(optional) options to be passed to the plots[display] command

Description

• 

The TreePlot command plots the specified binomial/trinomial tree.

• 

The tree is displayed using the plots[display] command. All unprocessed arguments are interpreted as plot options and will be passed to the plots[display] command when the final plot data structure is generated.

Examples

withFinance:

Construct a Cox-Ross-Rubinstein binomial tree.

S0:=100

S0:=100

(1)

r:=0.05

r:=0.05

(2)

σ:=0.3

σ:=0.3

(3)

T:=3.0

T:=3.0

(4)

N:=20

N:=20

(5)

Su:=ⅇσTN

Su:=1.123208700

(6)

Sd:=ⅇσTN

Sd:=0.8903064939

(7)

Pu:=ⅇrTNSdSuSd

Pu:=0.5033086765

(8)

Tree:=BinomialTreeT,N,S0,Su,Pu,Sd

Tree:=moduleend module

(9)

TreePlotTree,thickness=2,axes=boxed,gridlines=true

TreePlotTree,thickness=2,axes=boxed,gridlines=true,scale=logarithmic

Here is a Jarrow-Rudd tree approximating the same process.

Su:=ⅇrσ22TN+σTN

Su:=1.124051423

(10)

Sd:=ⅇrσ22TNσTN

Sd:=0.8909744742

(11)

Pu:=0.5

Pu:=0.5

(12)

Tree2:=BinomialTreeT,N,S0,Su,Pu,Sd

Tree2:=moduleend module

(13)

TreePlotTree2,thickness=2,axes=boxed,gridlines=true

TreePlotTree2,thickness=2,axes=boxed,gridlines=true,scale=logarithmic

Here is a trinomial tree obtained by combining two steps of the Jarrow-Rudd tree.

Su:=ⅇrσ222TN+2σTN

Su:=1.263491601

(14)

Sd:=ⅇrσ222TN2σTN

Sd:=0.7938355137

(15)

Pu:=0.25

Pu:=0.25

(16)

Pd:=0.25

Pd:=0.25

(17)

Tree3:=TrinomialTreeT,N2,S0,Su,Pu,Sd,Pd

Tree3:=moduleend module

(18)

TreePlotTree3,thickness=2,axes=boxed,gridlines=true

TreePlotTree3,thickness=2,axes=boxed,gridlines=true,scale=logarithmic

plots[display]TreePlotTree2,color=red,TreePlotTree3,transparency=0.3,axes=boxed,thickness=2,gridlines

The following is a tree created for a Cox-Ingersoll-Ross short rate model.

The command to create the plot from the Plotting Guide is

M:=CoxIngersollRossModelZeroCurve0.03,0.05,0.5,0.002,0.1

M:=moduleend module

(19)

T:=ShortRateTreeM,3,15

T:=moduleend module

(20)

TreePlotT,axes=boxed,thickness=3,gridlines=true,color=cyan..blue

See Also

Finance[BinomialTree], Finance[BlackScholesBinomialTree], Finance[BlackScholesTrinomialTree], Finance[GetDescendants], Finance[GetProbabilities], Finance[GetUnderlying], Finance[ImpliedBinomialTree], Finance[ImpliedTrinomialTree], Finance[LatticeMethods], Finance[SetProbabilities], Finance[SetUnderlying], Finance[StochasticProcesses], Finance[TreePlot], Finance[TrinomialTree]


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam