Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

 Library: finance See also: grITTcrr grITTstsp grITTspd ITTad ITTcrr ITTnewnodes ITTnicemat ITTterm ITTtermder plotITT IBTdk bitree nmnewton

 Quantlet: ITT Description: main function for the Derman/Kani/Chriss method of implied trinomial trees (ITT). It computes the nodes of the ITT, the probability matrices, the Arrow-Debreu prices and the local volatility matrix.

Reference(s):
Derman, E., Kani, I. and Chriss, N. (1996). Implied Trinomial Trees of the Volatility Smile. Journal of Derivatives, 4, pp. 7-22. Komorad, K. (2002). Implied Trinomial Trees and Their Implementation with XploRe.

 Usage: {Ttree,P,Q,AD,LocVol,Onodes,Oprobs,Time}=ITT(S,r,div,time,volafunc{,skewconst}) or {Ttree,P,Q,AD,LocVol,Onodes,Oprobs,Time}=ITT(volafunc) Input: S scalar; spot price of the underlying r scalar; interest rate from interval (0,1) div scalar; the dividend rate from interval (0,1) time t x 1 vector; time points (in years) when the levels of the tree occurred (they are supposed to increase). volafunc string; if there is only a slow variation in the implied volatilities, volafunc has only one row containing the name of the volatility function. This function has three input parameters: (S, K, tau), where S is the spot price of the underlying, K denotes the exercise price and tau the time to maturity on each level. If the volatility varies significantly with strike or time to expiration, volafunc can have up to 3 rows: the first row contains the name of the volatility function for the term structure: term(t). The second row represents the name of the first derivative of this volatility function: term'(t). Both of these two functions have only one parameter time and it is necessary that they can use vectors. The third row corresponds to the name of the function for the skew structure: skew(t). If there is no term structure, but significant skew structure, insert volafunc[1]="". skewconst optional vector; the skew constant c (see the reference), default is 0.1 Output: Ttree matrix; the Implied Trinomial Tree (the root is found in the upper left corner; elements which do not belong to the tree are NaN's) P matrix; the up transition probabilities Q matrix; the down transition probabilities AD matrix; the Arrow-Debreu prices for the computed tree LocVol matrix; the local volatilities Onodes matrix; the overwritten nodes of the Implied Trinomial Tree, not overwritten elements represented as NaN's. If there are no overwritten nodes Onodes = NaN (only scalar). Oprobs ((1+4*k) x 2) matrix; coordinates of the nodes where overwritten probabilities occurred. The first row is only auxiliary, but after that each of the following four rows corresponds to one overwritten probability. The first element of this quartet represents the parental node, the three other elements are daughter nodes. If there are no overwritten probabilities Oprobs = NaN (only scalar). Time vector; useful only when there is a significant term structure - only in this case it differs from the input parameter time.

Note:
(1) Option prices are computed from the ideal (not overwritten) tree.

(2) Interactive menus will be invoked if "volafunc" is the only parameter.

Example:
```library("finance")
proc(sigma)=volafunc(S,K,time)
sigma=0.15 +(K-S)/10 * 0.005
endp
S = 100	        	; current index level
r = 0.1			; interest rate
div = 0.05         	; dividend yield
time = 0|0.5|1		; 2 half-year periods
t=ITT(S, r, div, time, "volafunc")
t.Ttree

```
Result:
```Contents of Ttree

[1,]      100   116.18   134.99
[2,]     +NAN      100   116.18
[3,]     +NAN   86.071      100
[4,]     +NAN     +NAN   86.071
[5,]     +NAN     +NAN   74.082
```
Example:
```library("finance")
proc(sigma)=volafunc(S,K,time)
sigma=0.15 +(K-S)/10 * 0.005
endp
t=ITT("volafunc")

```
Result:
```several interactive menus are invoked to let the user
type the input values
```
Example:
```library("finance")
library("nummath")
; now define the term volatility function and its first derivative
proc(fx)=t1(t)
T=3
q=0.3
k=-q/(T+2)
fx = sqrt(k*t+q)
endp
proc(fder)=t1der(t)
T=3
q=0.3
k=-q/(T+2)
fder = k / 2 / sqrt(k*t+q)
endp
; define the skew volatility function
proc(sigma)=skew(S)
K=100	; exercise price
sigma =(S/(3*K+S))^2
endp
; and compute
S = 100	        	; current index level
r = 0.1			; compounded riskless interest rate
div = 0.05         	; dividend yield
time = 0|1|2|3		; time vector
volaf = "t1"|"t1der"|"skew"
t=ITT(S, r, div, time, volaf)
plotITT(t,1)
t.LocVol

```
Result:
```--------------------------------
Warning!
================================
probabilities of 6 node(s)
had to be overwritten in order
to avoid the arbitrage
--------------------------------

Contents of LocVol
[1,]  0.044084  0.043385  0.038446
[2,]     +NAN  0.031908  0.02952
[3,]     +NAN  0.032168  0.027637
[4,]     +NAN     +NAN  0.031259
[5,]     +NAN     +NAN  0.042086
```