0

I'm looking at using Sobol sequences as a variance reduction technique to speed up a simulation. However, the convergence of the QMC method seems very weak.

Does anyone know how or why this is the case? Is the advantage of QMC lost on these high dimensional cases? I get similar results for the Brownian bridge.

Code below attempts to simulate in Julia the following

$$ \mathbb{E} \int B_t dt $$

where $B_t$ is a standard Brownian motion. The true value is $\frac{1}{2}T^2$.

using PyPlot
import Distributions: Normal
import PyPlot: plt
using Sobol

function pseudo_path_variation(dt, T, M)
    # The pseudo random approach
    N = round(Int, T/dt);
    Z = zeros(N, M);
    d = Normal(0, 1.0);
    sum = 0.0;
    for  j in 1:M, i in 1:N-1
        Z[i+1, j] = Z[i, j] + sqrt(dt)*rand(d, 1)[1];
    end
    # Calculate sum
    return sumabs2(Z)*dt/M;
end

function quasi_path_variation(dt, T, M)
    # An attempt at the above using a N dimensional sobol sequence
    N = round(Int, T/dt);
    Z = zeros(N, M);
    d = Normal(0, 1.0);
    sum = 0.0;

    # The N dimensional sobol sequence
    s = SobolSeq(N);

    # Burn in the sequence
    for i in 1:10
        next(s);
    end

    for  j in 1:M
        B = next(s);
        for i in 1:N-1
            Z[i+1, j] = Z[i, j] + sqrt(dt)*quantile(d, B[i]);
        end
    end
    # Calculate sum
    return sumabs2(Z)*dt/M;
end

dt = 0.5;
T = 10;
M = 1000;

estims = zeros(M);
for N = 1:M-1
    estims[N+1] = quasi_path_variation(dt, T, N)
end

p = plot(linspace(0, M, M), estims);

estims = zeros(M);
for N = 1:M-1
    estims[N+1] = pseudo_path_variation(dt, T, N)
end

p = plot(linspace(0, M, M), estims);
pdevar
  • 323
  • 2
  • 3
  • 11
  • Also, I don't know why the mathjax isn't rendering... Sorry. – pdevar Jul 11 '16 at 09:27
  • Because this is a _programming_ Q/A site and not geared toward math, so the formatting is focused on code formatting, not math formatting. http://math.stackexchange.com will render the mathjax and is more appropriate for your question since it's more about the _technique_ that the _code_. – D Stanley Jul 11 '16 at 13:43
  • Note also that there's a [Quantitative Finance](http://quant.stackexchange.com/) SE site that may be even _more_ appropriate. – D Stanley Jul 11 '16 at 13:47
  • I suspect [CrossValidated](http://stats.stackexchange.com/) will have the most people familiar with implementing QMC. – Ahmed Fasih Jul 19 '16 at 20:27

1 Answers1

1

This is a comment, not an answer, but my SO score is not high enough for comments.
Timing with tic()..toc() - completed in 3 seconds.

tic()
dt = 0.5;
T = 10;
...
...
p = plot(linspace(0, M, M), estims);
toc()

elapsed time: 2.928828918 seconds
Rock Pereira
  • 471
  • 1
  • 4
  • 12