Library: | finance |
See also: | bitree IBTcrr IBTbc IBTsdisplot IBTlocsigma IBTvolaplot IBTnicemat IBTresort |
Quantlet: | IBTdk | |
Description: | starting program to calculate the stock price on the nodes in the implied tree, the transition probability tree and the Arrow-Debreu tree using Derman and Kani's method. |
Usage: | z = IBTdk(S, r, lev, expiration, volafunc) | |
Input: | ||
S | scalar: the underlying asset price | |
r | scalar: riskless interest rate | |
lev | scalar: the number of time steps | |
expiration | scalar: time to expiration of the stock | |
volafunc | text string: name of procedure where the function is used to define how the Black Scholes implied volatilities change with time to expiration and strike price | |
Output: | ||
z.Tree | Matrix: (lev+1)*(lev+1), the first j elements at jth column are corresponding to the stock prices of the nodes at jth level in the implied tree | |
z.prob | Matrix: (lev)*(lev), the first j elements at jth column are corresponding to the transition probability of the nodes at (j-1)th level in the implied tree only can be obtained up to (lev)th level | |
z.lb | Matrix: (lev+1)*(lev+1), the first j elements at jth column are corresponding to the Arrow-Debreu price of the nodes at jth level in the implied tree |
library("finance") proc(sigma)=volafunc(K, S, time) sigma=0.1+(S-K)/S/10*0.5 endp r=0.03 ; riskless annual interest rate S=100 ; the underlying asset price lev=2 ; the number of time steps expiration=2 ; time to expiration ibtree=IBTdk(S,r, lev, expiration, "volafunc") ibtree
Output is a implied binomial tree for the price process of the underlying, a tree of transition probabilities and a tree of Arrow-Debreu prices Contents of ibtree.Tree [1,] 100 90.479 79.292 [2,] 0 110.52 100 [3,] 0 0 120.31 Contents of ibtree.prob [1,] 0.62694 0.67327 [2,] 0 0.68381 Contents of ibtree.lb [1,] 1 0.36204 0.11479 [2,] 0 0.60841 0.42323 [3,] 0 0 0.40374