Professional Documents
Culture Documents
Ömür UĞUR
Ömür UĞUR (Middle East Technical University) Monte Carlo Methods for Options @ Yeditepe July 24, 2010 1 / 38
Outline
Ö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
Ö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
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 →∞
Ö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
µ = 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
N
1 X
lim X̄N = lim Xi = µ
N →∞ N →∞ N
i=1
Ö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 ,
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
Ö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
Ö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)
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)
Confidence Interval II
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
Ö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
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
Ö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
Outline
Ö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
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)
Ö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
Ö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 ] .
Xc = X + c (Y − ν), (14)
E [Xc ] = E [X] = θ
Ö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
Ö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
Ö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
Ö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
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
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)
Ö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
Ö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
Ö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
Ö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
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
Ö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
" 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
Ö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
Ö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
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)
Ö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