X_t is a d-dimensional geometric Brownian process and Y_t = \min_i X_t^{(i)}. My objective is to simulate paths of Y_t at t=\Delta, 2\Delta, ..., M\Delta.
There are significant differences in E(Y_t) estimates from QMC/Sobol & MC using Distributions.jl. E(Y_t) should decrease with t, however this is not the case with QMC result regardless of the sample size. I thought it was Julia specific, however, I see similar differences using Python/scipy-stats.qmc as well.
What could be the issue with the QMC approach? I would greatly appreciate suggestions, comments. Thanks!
using Distributions, QuasiMonteCarlo, StatsFuns, LinearAlgebra
function mvn_qmc(ÎĽ, ÎŁ, samples)
d = length(ÎĽ)
L = cholesky(ÎŁ).L
p = ceil(Int, log2(samples))
z = QuasiMonteCarlo.sample(2^p,d,
SobolSample(R = OwenScramble(base = 2, pad = 32)))[:,1:samples]
z .= norminvcdf.(z)
return ÎĽ .+ L * z
end
function min_paths_qmc(ÎĽ, ÎŁ, paths, pathlen)
Δ = 1.0/pathlen
r = mvn_qmc((μ .- 0.5*diag(Σ))*Δ, Σ*Δ, paths*pathlen)
r = reshape(r, :, pathlen, paths)
cumsum!(r, r, dims=2)
w = reshape(minimum(r, dims=1), pathlen, paths)
return w
end
function min_paths_mc(ÎĽ, ÎŁ, paths, pathlen)
Δ = 1.0/pathlen
d = MvNormal((μ .- 0.5*diag(Σ))*Δ, Σ*Δ)
r = reshape(rand(d, paths * pathlen), :, pathlen, paths)
cumsum!(r, r, dims=2)
w = reshape(minimum(r, dims=1), pathlen, paths)
return w
end
ÎĽ = [0.05, 0.06, 0.04]
ÎŁ = [0.1 0.01 0.02; 0.01 0.1 0.01; 0.02 0.01 0.1]
pathlen = 6
rng = 5000:10000:50000
qmc = zeros(pathlen, length(rng))
mc = zeros(pathlen, length(rng))
for (i,paths) in enumerate(rng)
qmc_samples = min_paths_qmc(ÎĽ, ÎŁ, paths, pathlen)
mc_samples = min_paths_mc(ÎĽ, ÎŁ, paths, pathlen)
qmc[:,i] .= mean(qmc_samples, dims=2)
mc[:,i] .= mean(mc_samples, dims=2)
end
QMC result:
6Ă—5 Matrix{Float64}:
-0.0693403 -0.0686555 -0.130352 -0.142068 -0.142267
-0.122929 -0.109585 -0.0936552 -0.0863832 -0.10844
-0.112686 -0.0968324 -0.159948 -0.153843 -0.16357
-0.142484 -0.117048 -0.112606 -0.0969064 -0.110946
-0.113757 -0.101172 -0.174056 -0.175542 -0.174227
-0.133638 -0.121298 -0.117966 -0.121578 -0.123275
MC Result:
6Ă—5 Matrix{Float64}:
-0.104534 -0.100965 -0.10238 -0.101322 -0.102051
-0.147406 -0.143225 -0.143192 -0.14371 -0.14456
-0.176493 -0.177197 -0.176859 -0.175868 -0.177008
-0.20365 -0.203276 -0.202989 -0.203152 -0.205002
-0.226064 -0.226917 -0.227966 -0.227 -0.228706
-0.249139 -0.249241 -0.249541 -0.248267 -0.251252