Lecture 12
Lecture 12
1 / 20
Integration using MC
I So far we have focused on computing
Z 1
θ= ψ(x)dx .
0
2 / 20
Quasi Monte Carlo (QMC)
θ = Eψ(U) ,
3 / 20
Integration Lattices
Xi+1 = mod(aXi , m)
Ui+1 = Xi+1 /m
4 / 20
Lattices
0 0 0
0 0.5 1 0 0.5 1 0 0.5 1
0 0 0
0 0.5 1 0 0.5 1 0 0.5 1 5 / 20
A Simple QMC Example
6 / 20
1 2
1
cos(kxk)e − 2 kxk dx
R
Example: θ = 2π R2
%% S i m p l e QMC Example
n = 2ˆ8;
p h i = (1+ s q r t ( 5 ) ) / 2 ; % F i b o n a c c i l a t t i c e
v1 = [ 1 / ( n+1) ; p h i ] ;
U qmc = mod ( v1 ∗ [ 1 : n ] , 1 ) ;
t h e t a q m c = mean ( c o s ( s q r t (X.ˆ2+Y . ˆ 2 ) ) ) ;
t h e t a m c = mean ( c o s ( s q r t ( sum ( r a n d n ( 2 , n ) . ˆ 2 , 1 ) ) ) ) ;
7 / 20
Discrepancy
8 / 20
Low Discrepancy Sets
I For Ui ∼ uniform[0, 1)d it is known that
√
2nD(U1 , U2 , . . . , Un )
lim sup √ =1.
n→∞ log log n
I It is known that deterministic low-discrepancy
sets can have
log(n)d
D(u1 , u2 , . . . , un ) that is O n .
I Integration error when using a low-discrepancy set is
quantified with the Koksma-Hlawka inequality,
0.8 0.8
0.6 0.6
0.4 0.4
0.2 0.2
0 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
0.8 0.8
0.6 0.6
0.4 0.4
0.2 0.2
0 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
11 / 20
Example: Scrambled Sobol Set to Generate Correlated
Brownian Motion
%% QMC Sim Brownian Motion
T = 3/12;
dt = 1/365;
N = r o u n d (T/ d t ) ;
Rho = −.7;
dW = z e r o s (N, 2 ) ;
S b l = s o b o l s e t ( 2 , ’ S k i p ’ , 1 e3 , ’ Leap ’ , 1 e2 ) ;
p = s c r a m b l e ( Sbl , ’ MatousekAffineOwen ’ ) ;
p = n e t ( p , N) ’ ;
U1 = p ( 1 : N) ;
U2 = p ( (N+1) : end ) ;
dW( : , 1 ) = s q r t (−2∗ l o g ( U1 ) ) . ∗ c o s ( 2 ∗ p i ∗U2 ) ∗ s q r t ( d t ) ;
dW( : , 2 ) = s q r t (−2∗ l o g ( U1 ) ) . ∗ s i n ( 2 ∗ p i ∗U2 ) ∗ s q r t ( d t ) ;
12 / 20
Example: Heston Model Call Price
Heston Call Implied Volatility (T=3 months)
0.23
MC
QMC
RQMC
0.22 Quadrature
0.21
0.2
0.19
0.18
0.17
0.16
-0.15 -0.1 -0.05 0 0.05 0.1 0.15 0.2 0.25
Figure: Using QMC and RQMC to estimate Heston call price, and then
comparing implied vols.
13 / 20
Copulas
I Copulas are the CDFs of marginally uniform[0, 1) random
variables.
I For X ∈ Rd , with X ` denoting `th element.
I Let F` be the (marginal) CDF of X ` .
I We have X ` = F`−1 (U` ) where U` is a marginally uniform[0, 1)
random variable, and is the `th element of U ∈ [0, 1)d .
I The CDF of U is copula C .
I Gaussian copula:
s Z −1 Z Φ−1 (ud )
(2π)−d Φ (u1 ) 1 ∗ −1
C (u1 , . . . , ud ) = ··· e − 2 x ρ x dx ,
|ρ| −∞ −∞
LS −1
ϕ (v ) ∝ v
1/ν−1 −v
e ,
16 / 20
Example: Large Portfolio of Co-Dependent Insurance
Claims
I We can run this 100-dimensional example with Monte Carlo,
QMC and RQMC, and we’ll see generally comparable results.
I We can also run the example with a normal approximation to
the data, which requires some shrinkage of the covariance
matrice’s eigenvalues.
I The reduced error from QMC/RQMC does not pop out at you
in this example, or in most other examples.
I To see error reduction we will need to run many trials, save
the MC/QMC/RQMC estimators, and then compare statistics
of the aggregate distributions to see which method has the
least variation.
I We estimate θ = probability of at least 1 claim, M = the
expectation number of claims given at least 1, and the
expectation of the peaks-over-threshold distribution (POT)
given at least 1 claim.
17 / 20
Example: Large Portfolio of Co-Dependent Insurance
Claims
theta mc theta qmc
40 40
20 20
0 0
0.03 0.035 0.04 0.045 0.05 0.035 0.04 0.045
M mc M qmc
40 40
20 20
0 0
2 2.5 3 3.5 4 4.5 2.8 3 3.2 3.4 3.6 3.8
20 20
0 0
8 10 12 14 16 9 10 11 12
18 / 20
Example: Large Portfolio of Co-Dependent Insurance
Claims
Based on the 500 trials from on the previous slide, we have the
following statistics:
19 / 20
Summary
20 / 20