Luigi,
Several of the greeks from a tree can be calculated from the current tree in memory. The Delta and Gamma are calculated using numerical differencing of the next two time steps. Theta requires the suggetion you provided below. If you also calculated the delta and gamma off your time shifted tree, you are calculating the d theta-ddelta and d theta-dgamma or second order derivatives. Vega and rho require also require a new tree calculation and a numerical differenceing using sigma+h or rate+h where h is a small increment but all other parameters are constant. Good Luck Joe 1. Re: Binomial Engines - Greeks (Luigi Ballabio) A man is not the center of his universe, rather those he loves are. So his focus should always be on them for they will provide him with love and happiness all of his life - Anonymous
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1¢/min. |
Here is an R implementation of the Pelseer/Vorst method for computing
greeks on the tree as in the paper "The Binomial Model and the Greeks." /Journal of Derivatives/, Spring 1994, 45-49 Best, Kris greek.binomial<- function(imod=1, TypeFlag="ce", S=100, X=110, r=0.05, q=0, tyr=1, sigma=0.3, nstep=100) { # greek.binomial(imod=1,TypeFlag= "pa", S = 50, X = 50, tyr=5/12, r = 0.1, q = 0, sigma = 0.4, nstep = 50) # the extended CRR tree with node extensions!. if (imod == 2) nstep <- nstep + nstep%%2 mstep<-nstep+2 TypeFlag = TypeFlag[1] z = NA if (TypeFlag == "ce" || TypeFlag == "ca") z <- +1 if (TypeFlag == "pe" || TypeFlag == "pa") z <- -1 if (is.na(z)) stop("TypeFlag misspecified: ce|ca|pe|pa") dtval = tyr/nstep udpvec <- BinTreeParams(imod, S, X, r, q, tyr, sigma, nstep) u <- udpvec[1] d <- udpvec[2] p <- udpvec[3] Df = exp(-r * dtval) OptionValue = z * (S * u^(0:mstep) * d^(mstep:0) - X) OptionValue = (abs(OptionValue) + OptionValue)/2 if (TypeFlag == "ce" || TypeFlag == "pe") { for (j in seq(from = mstep - 1, to = 2, by = -1)) for (i in 0:j) { { OptionValue[i + 1] = (p * OptionValue[i + 2] + (1 - p) * OptionValue[i + 1]) * Df } } } if (TypeFlag == "ca" || TypeFlag == "pa") { for (j in seq(from = mstep - 1, to = 2, by = -1)) for (i in 0:j) OptionValue[i + 1] = max((z * (S * u^i * d^(abs(i - j)) - X)), (p * OptionValue[i + 2] + (1 - p) * OptionValue[i + 1]) * Df) } #cat(OptionValue[1]," ", OptionValue[3]," ",OptionValue[2],"\n") greek.binomial<-(OptionValue[1]-OptionValue[3])/(S*u^2-S*d^2) } |
Free forum by Nabble | Edit this page |