Library: | finance |
See also: | grITTspd grITTstsp ITT plotITT |
Quantlet: | grITTcrr | |
Description: | generates a trinomial tree built from the standard CRR tree and describes it with the given values. |
Usage: | nodes=grITTcrr(onetree{,time{,col{,scale{,prec}}}}) | |
Input: | ||
onetree | matrix; corresponds to any output matrix of ITT(.): Ttree, P, Q, AD or LocVol. | |
time | optional t x 1 vector; time points corresponding to onetree. Default is time with constant time step (equidistant time axe). | |
col | optional 2 x 1 vector; the first row represents the color of the mesh and the second the text color. Default is col=0|1. | |
scale | optional scalar; scale = 1 if the tree should be scaled by the values given in onetree. scale = 0 if a constant-volatility trinomial tree should be plotted and the values of onetree will be used only as descriptions (possible usage for P,Q,LocVol...), which is default. | |
prec | optional scalar; the precision of the description (default is 2) | |
Output: | ||
nodes | graphical object; the nodes of the tree with corresponding description |
library("finance") library("graphic") proc(sigma)=volafunc(S,K,time) sigma=0.15 +(S-K)/10 * 0.005 endp S = 100 ; current index level r = 0.1 ; compounded riskless interest rate div = 0.05 ; dividend yield time = 0|1|3|6 ; time vector col=1|0 ; blue mesh with black text prec=3 ; desired precision t=ITT(S, r, div, time, "volafunc") ; compute the tree tr=grITTcrr(t.AD,time,col,0,prec) ; Arrow-Debreu prices d=createdisplay(1,1) axesoff() show(d,1,1,tr) axeson()
A plot of the Arrow-Debreu prices is shown.