/* multipic.prg does final implied vol graph for multinomial. Pulls results from multinm2, multinm3. Basically graphbnd from those programs, with lots of art work. sig2 etc and commented out graph do monthly hedging, since delted from paper. If you want to see them run multinm first with monthly horizon. */ convt = 0; /*load sig2,cupg2,clog2,cmidg2,sgrid2,upimpv2,loimpv2,midimpv2;*/ load sig,cupg,clog,cmidg,sgrid,upimpv,loimpv,midimpv; horiz = 3; /* horizon in months */ K = 100; /* strike price */ rf = ln(1.05); /* log risk free rate */ Rf1 = exp(rf/52); /* one week gross rate */ /* MAKE SURE all the above conforms with multinm3, multinm2 that createdit all*/ lowarb = plus(sgrid-k/(exp(horiz/12*rf))); /* sig = (12*(sumc(rprob.*rgrid^2)-sumc(rprob.*rgrid)^2))^0.5; we loaded it instead */ graphjc; _pcolor = 15; @ title("Implied volatility bounds -- Weekly hedging"); @ xlabel("Stock price"); ylabel("Implied volatility, %"); _plegstr = "Upper bound\000Lower bound\000v = 0"; _plegctl = 1|5|100|3; _plctrl = 1; _psymsiz = 3; _plwidth = 2; xtics(60,160,10,2); ytics(0,30,5,0); _pstype = 6|3|1; px=sgrid*ones(1,3); py = 100*(upimpv~loimpv~midimpv); _ptek = "multiw.tkf"; xy(px,py); if convt; dos pqgrun multiw.tkf -c=2 -cf=multiw.pic; endif; /* title("Implied volatility bounds -- Monthly hedging"); px = sgrid2*ones(1,3); py = 100*(upimpv2~loimpv2~midimpv2); _ptek = "multim.tkf"; xy(px,py); if convt; dos pqgrun multim.tkf -c=2 -cf=multim.pic; endif; */ proc(1) = plus(x); retp (x .* (x .>=0)); endp;