You are on page 1of 38

Monte Carlo Methods for Options

Ömür UĞUR

Institute of Applied Mathematics


Middle East Technical University, Ankara, Turkey

July 24, 2010

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 1 / 38
Outline

1 Monte Carlo Methods


Basics of Monte Carlo Integration
Option Pricing by Monte Carlo Simulation

2 Variance Reduction Techniques


Antithetic Variates
Control Variates

3 Exploring Matlab Codes


Monte Carlo Method for European Options
Variance Reduction Techniques

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 2 / 38
Monte Carlo Methods Basics of Monte Carlo Integration

Outline

1 Monte Carlo Methods


Basics of Monte Carlo Integration
Option Pricing by Monte Carlo Simulation

2 Variance Reduction Techniques


Antithetic Variates
Control Variates

3 Exploring Matlab Codes


Monte Carlo Method for European Options
Variance Reduction Techniques

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 3 / 38
Monte Carlo Methods Basics of Monte Carlo Integration

Monte Carlo Integration


Consider the problem of computing a multidimensional integral of the form
Z
I= g(x) dx,
A
n
where A ⊂ R is Lebesgue measurable. We may estimate I by randomly sampling
a sequence of points xi ∈ A, i = 1, 2, . . . , N , and building the estimator
N
vol(A) X
IbN = g(xi ),
N i=1

where vol(A) denotes the volume of the region A. Quite often we consider the
unit hypercube
A = [0, 1]n = [0, 1] × [0, 1] × · · · × [0, 1],
so that vol(A) = 1.
The strong law of large numbers implies that
lim IbN = I
N →∞

with probability one.


Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 4 / 38
Monte Carlo Methods Basics of Monte Carlo Integration

Monte Carlo Integration (cont.)


More generally, if X denotes a vector random variable with joint density function
f (x), x ∈ Rn , then the Monte Carlo integration may be used to estimate the
expected value Z
E [g(X)] = g(x)f (x) dx
Rn
of an arbitrary function g of X.

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 5 / 38
Monte Carlo Methods Basics of Monte Carlo Integration

Basics of Samples I
For a family of independent identically distributed (i.i.d.) random variables

{Xi }i=1 , the partial sum SN is defined by

N
X
SN = Xi = X1 + X2 + · · · + XN . (1)
i=1

Associated with SN is the sample mean X̄N which is another random variable
given by

N
1 1 X
X̄N = SN = Xi . (2)
N N i=1

This is an unbiased estimator of the parameter

µ = E [Xi ]

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 6 / 38
Monte Carlo Methods Basics of Monte Carlo Integration

Basics of Samples II
of the i.i.d. sample Xi . In other words, the expectation of X̄N is the same as µ,
since
  1
E X̄N = E [SN ] = E [Xi ] = µ, (3)
N

due to the i.i.d. sequence {Xi }i=1 .

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 7 / 38
Monte Carlo Methods Basics of Monte Carlo Integration

Strong Law of Large Numbers

Theorem (Strong Law of Large Numbers)



For a family of i.i.d. random variables {Xi }i=1 , suppose that the mean
µ = E [Xi ] exists. Then,

N
1 X
lim X̄N = lim Xi = µ
N →∞ N →∞ N
i=1

with probability one.

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 8 / 38
Monte Carlo Methods Basics of Monte Carlo Integration

Squared-Error I
Moreover, we may quantify the quality of the estimator X̄N by considering the
expectation of the squared-error as
   2  2
E (X̄N − µ)2 = E X̄N − E X̄N h i
  PN
= Var X̄N = N12 Var i=1 X i
PN (4)
1
= N 2 i=1 Var [X i ]
σ2
= N ,

where σ 2 = Var [Xi ] may be estimated by a sample variance, say σ̄N


2
.
2
Therefore, beside an unbiased sample mean X̄N , an unbiased sample variance σ̄N
may be given as

N N
!
2 1 X 2 N 1 X 2 2
σ̄N = Xi − X̄N = X − X̄N . (5)
N − 1 i=1 N −1 N i=1 i

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 9 / 38
Monte Carlo Methods Basics of Monte Carlo Integration

Squared-Error II
It is not difficult to show that
 2
E σ̄N = Var [Xi ] = σ 2

holds by using the second equality in (5).

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 10 / 38
Monte Carlo Methods Basics of Monte Carlo Integration

Central Limit Theorem

Theorem (Central Limit Theorem)



For a family of i.i.d. random variables {Xi }i=1 with finite mean µ and finite
variance σ 2 > 0, let
SN − N µ X̄N − µ
ZN = √ =p .
σ N σ 2 /N
Then, for x ∈ R,
Z x
1 2
/2
lim P {ZN ≤ x} = Φ(x) = √ e−ξ dξ,
N →∞ 2π −∞

where Φ is the standard normal distribution function.

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 11 / 38
Monte Carlo Methods Basics of Monte Carlo Integration

Confidence Interval I
Now, a (1 − α)th level of confidence interval for a random variable Z is defined by
the interval [−z1−α/2 , z1−α/2 ] such that the critical number z1−α/2 is found from
the equation

P −z1−α/2 ≤ Z ≤ z1−α/2 = 1 − α. (6)

If, further, the random variable Z is standard normally distributed, then

1 − α = Φ(z1−α/2 ) − Φ(−z1−α/2 ) = 2 Φ(z1−α/2 ) − 1.

In other words,
Φ(z1−α/2 ) = 1 − α/2. (7)
Therefore, using the inverse of the error function, erf−1 ,

z1−α/2 = Φ−1 (1 − α/2) = 2 erf−1 (1 − α). (8)

Commonly used critical numbers are


Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 12 / 38
Monte Carlo Methods Basics of Monte Carlo Integration

Confidence Interval II

z0.975 = Φ−1 (1 − 0.05/2) ≈ 1.96, for α = 0.05, (9)


z0.995 = Φ−1 (1 − 0.01/2) ≈ 2.58, for α = 0.01, (10)

for the (1 − α)th level of confidence interval for a standard normally distributed
random variable.
Thus, if the number of samples N is large enough, then the random variable

X̄N − µ
Z=p 2
σ̄N /N

can be considered to be approximately standard normally distributed by the


central limit theorem.

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 13 / 38
Monte Carlo Methods Basics of Monte Carlo Integration

Confidence Interval III


Therefore,
( )
X̄N − µ
1−α ≈ P −z1−α/2 ≤ p 2 ≤ z1−α/2
σ̄N /N
 q q 
= 2 2
P X̄N − z1−α/2 σ̄N /N ≤ µ ≤ X̄N + z1−α/2 σ̄N /N

implies that an approximate (1 − α)th level confidence interval for the parameter
µ = E [Xi ] may be computed from the sample mean X̄N and the sample variance
2
σ̄N as
 q q 
2 /N , X̄ + z
X̄N − z1−α/2 σ̄N 2 /N .
σ̄N (11)
N 1−α/2

This
palso implies
 that the rate of convergence of Monte Carlo method is of order
O 2
σ̄N /N .

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 14 / 38
Monte Carlo Methods Option Pricing by Monte Carlo Simulation

Outline

1 Monte Carlo Methods


Basics of Monte Carlo Integration
Option Pricing by Monte Carlo Simulation

2 Variance Reduction Techniques


Antithetic Variates
Control Variates

3 Exploring Matlab Codes


Monte Carlo Method for European Options
Variance Reduction Techniques

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 15 / 38
Monte Carlo Methods Option Pricing by Monte Carlo Simulation

Algorithm

Monte Carlo Simulation for European Options


for k = 1, 2, . . . , N do
if the option is path dependent then
simulate a path to get (ST )k % by numerical methods (for SDEs)
calculate the payoff, Vk
else
draw Zk ∼ N (0,n1)
 √ o
(ST )k = S0 exp r − 21 σ 2 T + σZk T
calculate the payoff, Vk
end if
end for
b (V ) = 1 PN Vk
E % estimate of risk-neutral expectation
N k=1
Vb = e−rT E b (V ) % approximate value of option

b (V ) ≈ V (S0 , 0) = e−rT EQ [V (ST , T )]


Vb = e−rT E
Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 16 / 38
Variance Reduction Techniques Antithetic Variates

Outline

1 Monte Carlo Methods


Basics of Monte Carlo Integration
Option Pricing by Monte Carlo Simulation

2 Variance Reduction Techniques


Antithetic Variates
Control Variates

3 Exploring Matlab Codes


Monte Carlo Method for European Options
Variance Reduction Techniques

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 17 / 38
Variance Reduction Techniques Antithetic Variates

Antithetic Variates I
Consider the idea of generating two sequences of independent identically
distributed samples,
 1 N   N 
Xi i=1 = X11 , X21 , . . . , XN
1
, Xi2 i=1
= X12 , X22 , . . . , XN
2
. (12)

These samples may separately be used in Monte Carlo simulations, and so may
the pair-averaged samples

1 
Xi = Xi1 + Xi2 , i = 1, 2, . . . , N, (13)
2
since these are also i.i.d..
Assuming a correlation between the samples as
 
Cov Xi1 , Xi2 < 0,

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 18 / 38
Variance Reduction Techniques Antithetic Variates

Antithetic Variates II
for each i = 1, 2, . . . , N . By using the identity
  n    o
Cov Xi1 , Xi2 ≤ 1 Var Xi1 + Var Xi2 ,
2
it follows that
1n      o
Var [Xi ] = Var Xi1 + Var Xi2 + 2 Cov Xi1 , Xi2
4
1    
≤ Var Xi1 + Var Xi2 .
2
Hence,
N
" #
  1 X
Var X̄N = Var Xi
N i=1
1 1     
= Var [Xi ] ≤ Var Xi1 + Var Xi2 .
N 2N
This is the idea of antithetic variates.
Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 19 / 38
Variance Reduction Techniques Antithetic Variates

Up-and-In Call, with antithetic variates


for i = 1, 2, . . . , M do
for j = 0, 1, . . . , N − 1 do
Zj ∼ N (0, 1) n
 √ o
Sj+1 = Sj exp r − 21 σ 2 ∆t + σZj ∆t % introduce
n  √ o
Sbj+1 = Sbj exp r − 12 σ 2 ∆t − σZj ∆t % correlation
end for
Sim = max Sj , Sbim = max Sbj
0≤j≤N 0≤j≤N
if Sim > B then
Vi1 = e−rT max{SN − K, 0}, else Vi1 = 0
end if
if Sbim > B then
Vi2 = e−rT max{SbN − K, 0}, else Vi2 = 0 % antithetic variates
end if
Vi = 21 (Vi1 + Vi2 ) % pair-averaged sample
end for
M M
1 X 1 X
V̄M = Vi , σ̄M2
= (Vi − V̄M )2
M i=1 M − 1 i=1
Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 20 / 38
Variance Reduction Techniques Antithetic Variates

Antithetic Variates for Up-and-In Call (Comparison)

Table: A comparison of the confidence intervals for plain Monte Carlo and the use of
Antithetic Variates
Monte-Carlo Monte-Carlo Ratio
M (Plain) (Antithetic Variates) (Widths)

102 [0.0754, 0.3857] [0.1392, 0.3709] 1.3387


103 [0.1740, 0.2656] [0.2055, 0.2716] 1.3843
104 [0.2372, 0.2696] [0.2356, 0.2570] 1.5150
105 [0.2411, 0.2511] [0.2417, 0.2485] 1.4799

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 21 / 38
Variance Reduction Techniques Control Variates

Outline

1 Monte Carlo Methods


Basics of Monte Carlo Integration
Option Pricing by Monte Carlo Simulation

2 Variance Reduction Techniques


Antithetic Variates
Control Variates

3 Exploring Matlab Codes


Monte Carlo Method for European Options
Variance Reduction Techniques

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 22 / 38
Variance Reduction Techniques Control Variates

Control Variates I
Suppose that we wish to estimate the parameter

θ = E [X]

and that there is another random variable Y (control variable) with a known

ν = E [Y ] .

We introducing the controlled estimator,

Xc = X + c (Y − ν), (14)

where c is a parameter that has to be chosen later.


The expectation and the variance are

E [Xc ] = E [X] = θ

Var [Xc ] = Var [X] + c2 Var [Y ] + 2c Cov [X, Y ] .

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 23 / 38
Variance Reduction Techniques Control Variates

Control Variates II
Hence,
Cov [X, Y ]
c∗ = − .
Var [Y ]
At this optimal case, when c = c∗ , the variance of the controlled estimator
becomes
Var [Xc∗ ] = Var [X] + (c∗ )2 Var [Y ] + 2c∗ Cov [X, Y ] , (15)
where Xc∗ ∗ ∗
= X + c (Y − ν). Inserting c into (15) and using the correlation
coefficient ρXY ,
Cov [X, Y ]
ρXY = p p ,
Var [X] Var [Y ]
we deduce that

Var [Xc∗ ]
= 1 − ρ2XY . (16)
Var [X]

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 24 / 38
Variance Reduction Techniques Control Variates

Control Variates III


Remarks
Var [Xc ] < Var [X] if and only if c lies between zero and 2c∗ , where c∗ may
be either negative or positive.
In practice, the optimal value of c must be estimated since the covariance
Cov [X, Y ], and possibly Var [Y ], are not known. Of course, a set of pilot
replications can be used to estimate Cov [X, Y ] as well as Var [Y ].

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 25 / 38
Exploring Matlab Codes Monte Carlo Method for European Options

Outline

1 Monte Carlo Methods


Basics of Monte Carlo Integration
Option Pricing by Monte Carlo Simulation

2 Variance Reduction Techniques


Antithetic Variates
Control Variates

3 Exploring Matlab Codes


Monte Carlo Method for European Options
Variance Reduction Techniques

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 26 / 38
Exploring Matlab Codes Monte Carlo Method for European Options

MC for a Vanilla Call Option


MonteCarlo Call.m
function [Price, CI] = MonteCarlo_Call(S0,K,r,sigma,T,NRepl)
% NRepl : number of replications (paths)

muT = (r - 0.5*sigma^2)*T; sigmaT = sigma * sqrt(T);


DiscPayoff = exp(-r*T) * max( 0, S0*exp(muT+sigmaT*randn(NRepl,1)) - K );
% Matlab command for the Mean and Standard Deviation and the Confidence Interval
%[Price, SDev, CI] = normfit(DiscPayoff);
Price = mean(DiscPayoff); width = 1.96*std(DiscPayoff)/sqrt(NRepl);
CI = [Price-width, Price+width];

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 27 / 38
Exploring Matlab Codes Monte Carlo Method for European Options

MC for a Vanilla Call Option (Script)


MC Call Eg.m
% test MC_Call
clear all, close all, randn(’state’,13);
S0 = 10; K = 9; sigma = 0.1; r = 0.06; T = 1; M = 17;

for i = 1:M
NRepl = 2^(i+4);
[P, CI] = MonteCarlo_Call(S0,K,r,sigma,T,NRepl);
Price(i) = P; confInterval(i,:) = CI;
end
format long; Price, confInterval
[C, Cdelta, P, Pdelta] = CallPut_Delta(S0,K,r,sigma,T);
plot([1:M], Price, ’o’), hold on
plot([0:M+1], ones(1,M+2)*C, ’r’)
for i=1:M
plot([i,i], confInterval(i,:), ’g--’ )
end
xlabel(’M (2^{M+4} Number of Samples)’,’FontSize’,12), ylabel(’V’,’FontSize’,12)
print -r900 -deps ’../figures/MC_Call_eg’

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 28 / 38
Exploring Matlab Codes Monte Carlo Method for European Options

MC for a Vanilla Call Option (Convergence)

1.9

1.8

1.7

1.6
V

1.5

1.4

1.3

1.2

1.1
0 2 4 6 8 10 12 14 16 18
M+4
M (2 Number of Samples)

Figure: Convergence of Monte Carlo approximations to European Call

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 29 / 38
Exploring Matlab Codes Monte Carlo Method for European Options

MC for Asian Arithmetic Average Option


Assume that the price St is observed at discrete times t = ti for i = 1, 2, . . . , N
with equidistant time interval ∆t := T /N , where T is the maturity. Hence,
ti = i ∆t for i = 0, 1, . . . , N . Then, the arithmetic mean, S̄t , becomes
N N
1 X 1X
S̄t = S ti = ∆t Sti .
N i=1 T i=1
Asian Arithmetic.m
% Euler-Maruyama: Asian option with Arithmetic Mean
clear all, close all, randn(’state’,13)
K = 1; r = 0.05; T = 1; N = 2^8; dt = T/N; M = 10000;
mu = r; S_0 = 1; sigma_0 = 0.8;
S = S_0*ones(M,1); Sigma = sigma_0*ones(M,1); sumOfS = S;
for j = 1:N
dW_1 = sqrt(dt)*randn(M,1); dW_2 = sqrt(dt)*randn(M,1); % independent of dW_1
% To be safe!
S = abs(S + dt*mu*S + sqrt(S).*Sigma.*dW_1);
Sigma = abs(Sigma + dt*(sigma_0 - Sigma) + sqrt(Sigma).*dW_2);
sumOfS = sumOfS + S;
end
meanOfX = sumOfS/(N+1); Price = exp(-r*T)*mean(max(0,meanOfX-K))

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 30 / 38
Exploring Matlab Codes Monte Carlo Method for European Options

MC for Spread Option (Correlated Assets)


SpreadOption MC.m
% At maturity the payoff from a call spread option is max(S1-S2-K,0)
% At maturity the payoff from a put spread option is max(K-S1+S2,0)
clear all, close all, randn(’state’, 13)

flag_CallPut = ’c’; S1 = 110; S2 = 100; K = 1; r = 0.06; sum=0;


mu1 = r; mu2 = r; sigma1 = .2; sigma2 = .3; rho = .5; T = 1; nPaths = 10000;
if flag_CallPut == ’c’
z = 1; % Will return call option value
else
z = -1; % Will return put option value
end
drift1 = (mu1 - sigma1^2 / 2) * T; drift2 = (mu2 - sigma2^2 / 2) * T;
sigma1Sqrdt = sigma1 * sqrt(T); sigma2Sqrdt = sigma2 * sqrt(T);
for i = 1:nPaths,
Z1 = randn; Z2 = rho * Z1 + randn * sqrt(1 - rho ^ 2);
St1 = S1 * exp(drift1 + sigma1Sqrdt * Z1);
St2 = S2 * exp(drift2 + sigma2Sqrdt * Z2);
sum = sum + max(z * (St1 - St2 - K), 0);
end
Price = exp(-r * T) * (sum / nPaths)

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 31 / 38
Exploring Matlab Codes Variance Reduction Techniques

Outline

1 Monte Carlo Methods


Basics of Monte Carlo Integration
Option Pricing by Monte Carlo Simulation

2 Variance Reduction Techniques


Antithetic Variates
Control Variates

3 Exploring Matlab Codes


Monte Carlo Method for European Options
Variance Reduction Techniques

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 32 / 38
Exploring Matlab Codes Variance Reduction Techniques

Arithmetic Average Asian Option


MC ArithmeticAsian.m
function [P,CI] = MC_ArithmeticAsian(S0,K,r,sigma,T,NSamples,NRepl)

Payoff = zeros(NRepl,1);
for i=1:NRepl
Path=AssetPaths_gBM(S0,r,sigma,T,NSamples,1);
Payoff(i) = max(0, mean(Path(2:(NSamples+1))) - K);
end
% for simplicity use
[P,approxsigma,CI] = normfit( exp(-r*T) * Payoff);
AssetPaths gBM.m
function SPaths = AssetPaths_gBM(S0,mu,sigma,T,NSteps,NRepl)
% Calculates the asset paths using the exact formula
% NSteps = number of time steps to be taken
% NRepl = number of paths to be simulated

dt = T/NSteps; mudt = (mu-0.5*sigma^2)*dt; sidt = sigma*sqrt(dt);


Increments = mudt + sidt*randn(NRepl, NSteps);
LogPaths = cumsum([log(S0)*ones(NRepl,1) , Increments] , 2);
SPaths = exp(LogPaths);

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 33 / 38
Exploring Matlab Codes Variance Reduction Techniques

Arithmetic Average Asian Option (Control Variable)

" N
# N
X X
E [Y ] = E S ti = E [Si∆t ]
i=0 i=0
N
X N
X i er(N +1)∆t − 1
= S0 eri∆t = S0 er∆t = S0 ,
i=0 i=0
er∆t − 1

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 34 / 38
Exploring Matlab Codes Variance Reduction Techniques

Arithmetic Average Asian Option (Control Variable, cont.)


MC ArithmeticAsian Control SumOfS.m
function [P,CI] = MC_ArithmeticAsian_Control_SumOfS(...
S0,K,r,sigma,T,NSamples,NRepl,NPilot)

% pilot replications to set control parameter


TryPath=AssetPaths_gBM(S0,r,sigma,T,NSamples,NPilot);
StockSum = sum(TryPath,2); PP = mean( TryPath(:,2:(NSamples+1)), 2 );
TryPayoff = exp(-r*T) * max(0, PP - K);
MatCov = cov(StockSum, TryPayoff); c = - MatCov(1,2) / var(StockSum);
dt = T / NSamples;
ExpSum = S0 * (1 - exp((NSamples + 1)*r*dt)) / (1 - exp(r*dt));
% MC run
ControlVars = zeros(NRepl,1);
for i=1:NRepl
StockPath = AssetPaths_gBM(S0,r,sigma,T,NSamples,1);
Payoff = exp(-r*T) * max(0, mean(StockPath(2:(NSamples+1))) - K);
ControlVars(i) = Payoff + c * (sum(StockPath) - ExpSum);
end
[P,approxSigma,CI] = normfit(ControlVars);

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 35 / 38
Exploring Matlab Codes Variance Reduction Techniques

Control Variates, Testing (Script)


test ControlVariate Sums
% test MC and Control Variate with Asset Sums
clear all, close all, rand(’state’, 13), randn(’state’, 13)
howMany = 5;
for k=2:howMany
[Pmc,CI] = MC_ArithmeticAsian(50,50,0.1,0.4,5/12,5,5*10^k);
[Pcv,CIcv] = MC_ArithmeticAsian_Control_SumOfS( ...
50,50,0.1,0.4,5/12,5,5*10^k,5*10^(k-1));
TC = [k, CI(1), CI(2), CIcv(1), CIcv(2), ...
( CI(2)-CI(1) ) / ( CIcv(2)-CIcv(1) ) ]
end

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 36 / 38
Exploring Matlab Codes Variance Reduction Techniques

Arithmetic Average Asian Option (Comparison)

Table: A comparison of the confidence intervals for plain Monte Carlo and the use of
Control Variates
Pilot Monte-Carlo Monte-Carlo Ratio
Replications Replications (Plain) (Control Variate) (Widths)

5 · 102 5 · 101 [3.1562, 4.1555] [3.8204, 4.2510] 2.3207


5 · 103 5 · 102 [3.7335, 4.0564] [3.9444, 4.0817] 2.3501
5 · 104 5 · 103 [3.9182, 4.0224] [3.9536, 3.9971] 2.3991
5 · 105 5 · 104 [3.9467, 3.9796] [3.9574, 3.9710] 2.4117

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 37 / 38
Exploring Matlab Codes Variance Reduction Techniques

Thanks!...

Thanks!...

Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 38 / 38

You might also like