стр. 22 |

80 3 Implied Trinomial Trees

Table 3.7: Contents of impltree.Oprobs

0 0

0.83772 110.5

2 119.94

2 112.18

2 105.56

0.83772 103.97

2 112.18

2 105.56

2 98.944

0.83772 97.461

2 105.56

2 98.944

2 91.247

Table 3.8: Contents of impltree.Time

0

0.83772

2

it must be included whenever you want to show the state price density. text is

an optional parameter which can be used only when the state space of the ITT

should be plotted. It says whether the tree nodes should be described (text

is a nonzero) or not (text = 0). And similarly prtext determines whether

the arrows connecting the state space should be described with corresponding

transition probabilities. In default, the state space denotes any node which

violated the forward condition with a red rhombus and overwritten probabilities

are shown with magenta lines. For instance, the following commands produce

plot of the state price density of the implied trinomial tree from Figure ??(b).

The state price density is depicted in Figure 3.16.

STFitt04.xpl

3.5 Computing Implied Trinomial Trees 81

3.5.2 Advanced features

We have mentioned a constant c in Section 3.4.2. Derman, Kani and Chriss

(1996) suggest to set this constant, used for solving the non-linear equation

system (3.18), to represent the at-the-money or some other typical value of

local volatility. In default it is set to 0.1 in the quantlet ITT, but the parameter

skewconst allows to set it for each time step on a diп¬Ђerent value.

In order to allow the user to compose the plot of any trinomial tree (it does

not matter if it is a tree of state space, transition probabilities or something

else) with other graphical objects into one graph, there are quantlets returning

the tree as a graphical object. Moreover these quantlets allow the user to enjoy

other features by plotting the trees. Let us start with the quantlet grITTspd:

dat = grITTspd (ttree,ad,r,time)

Here ttree, ad and time are the output parameters Ttree, AD and Time respec-

tively, which were returned by the quantlet ITT; r is then the corresponding

compound interest rate. The output parameter dat is the estimated state price

density as a graphical object. The density curve will be estimated using quant-

let regest with quartic kernel and bandwidth of 20% of the range of the last

level in ttree.

Next, we introduce a quantlet used in general for any component of a trinomial

tree:

4

3

probability*E-3

2

1

0

0 200 400 600 800

underlying price

Figure 3.16: Estimation of the State Price Density from an ITT.

82 3 Implied Trinomial Trees

nodes = grITTcrr (onetree{,time{,col{,scale{,prec}}}})

Here onetree is any matrix output of the quantlet ITT: Ttree, P, Q, AD or

LocVol. time is an optional parameter, in default it is equidistant time axe,

but it can be also equal to the output parameter Time of ITT. Parameter col is

(2x1) vector, which specify the colours in the tree. The п¬Ѓrst row is the color of

the mesh and the second row the colour of its description. scale is a boolean

determining if the tree should be scaled by the values given in onetree or if

a particular constant-volatility trinomial tree should be plotted and the values

of onetree will be used only for description.

This is, for instance, used in the quantlet plotITT for plotting the transition

probabilities whose values have nothing common with the vertical spacing in

the tree. prec is a scalar specifying the precision of the description. The output

parameter nodes is a graphical object again.

The last graphical tool is the quantlet grITTstsp:

{nodes,probs,axe,on,op} = grITTstsp (itree{,text{,col{,prec}}})

Variable itree is the output of ITT again, text and prec have the same mean-

ing as before, but the parameter col has now п¬Ѓve rows. They correspond in

the following order to the colour of the tree mesh, of the nodes description, of

the probabilities description, of the overwritten nodes, and lastly, of the colour

of overwritten probabilities. Here we have п¬Ѓve output parameters вЂ“ all of them

are composed graphical objects corresponding in sequence to the tree nodes, to

the description of the probabilities, to the time axe, to the overwritten nodes

and to the overwritten probabilities. For instance, Figure 3.15 was produced

by the following commands (the ITT impltree has been already computed

before):

STFitt02.xpl

Note that if there were no overwrites in the nodes or probabilities, on or op are

equal to NaN and it is not possible to show them.

3.5 Computing Implied Trinomial Trees 83

123.50

113.08 114.61

105.22 106.34 113.60

100.00 100.00 100.01 106.82

95.04 94.04 100.46

88.43 87.27

80.97

If one wants to get a text output (the graphical output may be too вЂќwildвЂќ

and its description unreadable), it is possible to write the result in the XploRe

output window as a string:

ITTnicemat (title,onetree,prec)

Here title is a string with desired title of the matrix, onetree is any output

стр. 22 |