Saturday, October 6, 2018

How many monte carlo runs do I need for pricing a Call?


I have to price several calls using Monte Carlo. Obviously, there is a huge tradeoff between the number of runs and the fair price of the call option. I know I can check how the approximation changes has I decrease the number of simulations, but I was wondering whether there is a ballpark value.


At the moment I am running 1000 simulations. But perhaps 500 is enough?



Answer



It really, really, really depends on your parameters, i.e. $r$, $\sigma$, $K$, $T$, $S_0$. For example, here are some results from implementing the stopping criteria I explain in my answer here. These are the number of iterations requires in order for there to be an approximate 0.95 probability that the MC call price differs from the exact call price by less than 0.01 (one penny, e.g.):


$r = 0.02$, $\sigma = 0.2$, $K = 10$, $T = 1$, $S_0 = 10$: 72,382 iterations


$r = 0.02$, $\sigma = 0.2$, $K = 10$, $T = 10$, $S_0 = 10$: 1,391,379 iterations


$r = 0.02$, $\sigma = 0.5$, $K = 10$, $T = 1$, $S_0 = 10$: 625,365 iterations


Here's my MATLAB implementation of the stopping criteria, if you'd like try for yourself:



%%% Estimates the price of a European call option using MC.
% Continues MC estimation until we reach a 0.05 probability that
% MC call price differs by more than "tol" units from exact
% call price.

function C = CallPricePointEstimate()
%%% BS parameters - Try varying these to see how number of iters (n)
% changes %%%
K = 10;
S = 10;

r = 0.02;
T = 1;
sigma = 0.5;

%%% MC parameters %%%
% number of stock prices to generate, may need more, which are
% generated in the MC loop below if idx > N_MC
N_MC = 1000000;
tol = 0.01; % price within $tol
bound = 5; % something larger than tol

n = 1; % current iteration number

%%% generate normal RVs and price paths %%%
Z = normrnd((r-sigma^2/2)*T, sigma*sqrt(T), N_MC, 1);
ST = S*exp(Z);

%%% init MC accumulators %%%
sampleMean = 0;
sampleVar = 0;
oldMean = 0;


idx = 1; % will reset to 1 if idx > N_MC
%%% MC loop %%%
while ((bound > tol) || (n < 30))
% if idx > N_MC, need to generate more normals
if (idx > N_MC)
Z = normrnd((r-sigma^2/2)*T, sigma*sqrt(T), N_MC, 1);
ST = S*exp(Z);
idx = 1;
end

payoff = exp(-r*T)*max((ST(idx) - K),0);

% update mean and var
sampleMean = oldMean + (payoff - oldMean)/n;
if (n>1)
sampleVar = (1-(1/(n-1)))*sampleVar + n*(sampleMean - oldMean)^2;
end
oldMean = sampleMean;

bound = 1.96*sqrt(sampleVar/n); %%% updated this line %%%

n = n+1;
idx = idx+1;
end

%%% Display num samples, statistics and vfy bound = tol %%%
n
sampleMean;
sampleVar;
bound;


C = sampleMean; % call price

%%% exact BS price using BS formula %%%
d1 = 1/(sigma*sqrt(T)) * (log(S/K) + (r + sigma^2/2)*T);
d2 = d1 - sigma*sqrt(T);
exact = S*normcdf(d1) - K*exp(-r*T)*normcdf(d2)

Update: I realized an error in my code: where bound updated, sampleVar/sqrt(n) should be sqrt(sampleVar/n). This results in faster convergence for given parameters. The number of iterations required has been updated.


No comments:

Post a Comment

technique - How credible is wikipedia?

I understand that this question relates more to wikipedia than it does writing but... If I was going to use wikipedia for a source for a res...