# Monte Carlo Option Pricing formula Classic List Threaded 7 messages Open this post in threaded view
|

## Monte Carlo Option Pricing formula

Open this post in threaded view
|

## Re: Monte Carlo Option Pricing formula

 Hi, Darko, Am 02.02.2012 07:44, schrieb Roupell, Darko: > Hi All, > > I am trying to cross check option implied employee option price that was derived using Monte Carlo simulation. Below is code and parameter used and after accounting for dividend yield ( 1.46%) the derived option price is 206.8843 using the code snippet provided. Approx 1 cent below 207.95 that is listed in company prospect using their Monte Carlo simulation and below parameters. > > As we all know number of iteration can also slightly impact the average price, but am I rightly concerned that my methodology may not be correct? Hm, I have not really looked at your programme so I cannot comment whether it is correct. But we are talking about a difference of about half a percentage point here. Which is not much. I just ran you script 20 times.  > summary(results)     Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    205.6   206.0   206.3   206.3   206.8   206.9 Admittedly, all results are all below the company's price, but nevertheless: they vary. There are details that they might have done differently. For instance, you do not compound (if I see correctly). What if you replaced riskFreeRate*timeToExpiry with (1+riskFreeRate)*timeToExpiry-1 But even if that gives you the price: from a practical point of view, the difference is small, really. (Much better would be to check what would happen if the div did not turn out as expected, if the vol were different, etc) Regards, Enrico > > Any feedback will be appreciated. > > > exercisePrice   = 0; > timeToExpiry    = 3;        #% in years > underlyingPrice = 490;      #% underlying in cents > expectedVol     = 0.5;      #% expected volatility > expectedDiv     = 0.0146;        #% expected dividend in cents > riskFreeRate    = 0.0425;   #% interest rate > itr = 500000              #% number of iterations > delS = 0*array(0,itr) > > for( i in (1:itr)) > { >      eps = rnorm(1)         #% random number generator >      dS = expectedDiv*underlyingPrice+underlyingPrice*(riskFreeRate*timeToExpiry) + (underlyingPrice*expectedVol*eps*sqrt(timeToExpiry)) >      mv = dS - exercisePrice; > >      delS[i] = max(mv,0); > } > > mean(delS) > > __________________________________________________ > Commonwealth Bank > Darko Roupell > Associate Quantitative Analyst > Institutional Banking&  Markets > Equities Research > Darling Park Tower 1 > Level 23, 201 Sussex Street > Sydney, NSW 2000 > P:  +61 2 9117 1254 > F:  +61 2 9118 1000 > M: +61 400 170 515 > E: [hidden email] [...] > _______________________________________________ > [hidden email] mailing list > https://stat.ethz.ch/mailman/listinfo/r-sig-finance> -- Subscriber-posting only. If you want to post, subscribe first. > -- Also note that this is not the r-help list where general R questions should go. > -- Enrico Schumann Lucerne, Switzerland http://nmof.net/_______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance-- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
Open this post in threaded view
|

## Re: Monte Carlo Option Pricing formula R code vs Matlab

Open this post in threaded view
|

## Re: Monte Carlo Option Pricing formula

 In reply to this post by darko Roupell, Darko <[hidden email]> [2012-02-01 22:45]: > >I am trying to cross check option implied employee option price that >was derived using Monte Carlo simulation. Below is code and parameter >used and after accounting for dividend yield ( 1.46%) the derived >option price is 206.8843 using the code snippet provided. Approx 1 >cent below 207.95 that is listed in company prospect using their >Monte Carlo simulation and below parameters. > >As we all know number of iteration can also slightly impact the >average price, but am I rightly concerned that my methodology may not >be correct? Hi Darko, Yes -- or at least different from the company's assumptions. Enrico has informally shown that there is a statistically significant difference in the two means. Conceptually, it may be important, but practically, the difference is insignificant. I have 3 other observations: first, your code uses a "for" loop which should be avoided in code that takes a significant amount of time to run in R, if possible. rnorm() can obviously be moved out of the loop and called once to generate the eps vector, but delS[i] = max(mv,0) can also be moved out of the loop, and then there's no need for a loop. To see the difference eliminating the loop makes, let's compare your code to a no-loop version: start = Sys.time() exercisePrice   = 0; timeToExpiry    = 3;        #% in years underlyingPrice = 490;      #% underlying in cents expectedVol     = 0.5;      #% expected volatility expectedDiv     = 0.0146;   #% expected dividend in cents riskFreeRate    = 0.0425;   #% interest rate itr = 500000                #% number of iterations delS = 0*array(0,itr) for( i in (1:itr)) {       eps = rnorm(1)          #% random number generator       dS = expectedDiv*underlyingPrice+underlyingPrice*(riskFreeRate*timeToExpiry) + (underlyingPrice*expectedVol*eps*sqrt(timeToExpiry))       mv = dS - exercisePrice;       delS[i] = max(mv,0); } mean(delS) #206.3257 Sys.time - start Time difference of 36.64036 secs BTW, you multiply the dividend by the stock price, which is inconsistent with your"expected dividend in cents" code comment. Plus, it's a percentage per year, right? If so, I think the first term in your dS expression should be: expectedDiv*underlyingPrice*timeToExpiry. I'm going to rewrite your code using short variable names; long names make the math itself more difficult for me to immediately see. start <- Sys.time() E   <- 0             #exercise price t   <- 3             #option life (years) S   <- 490           #stock price (cents) v   <- 0.5           #est. future annual volatility d   <- 0.0146        #dividend (code suggests this is a percentage of S) r   <- 0.0425        #annual interest rate N   <- 5000000 z   <- S*(d+r*t + rnorm(N, 0, v*sqrt(t))) sum(z[z > E])/N #206.203 Sys.time() - start Time difference of 0.5397904 secs The loop code takes 68 times as long to run. Second, why are you using a normal distribution? The usual rough approximation is to assume a lognormal distribution for stock prices, but that's flawed, too. Third, what is the annual interest rate? From your code, it appears to be the drift rate of the process driving the stock price, which has nothing to do with interest rates. A more realistic model will estimate the future drift rate, and using that plus the other parameters, will calculate a future value for the option. The present value is that future value discounted at the rate you choose (which is unlikely to be the riskless rate). The Black-Scholes-Merton derivation has confused many people on this point. HTH, -rex -- For every complex problem there is an answer that is clear, simple, and wrong. --H. L. Mencken _______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance-- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
Open this post in threaded view
|