Quasi-Monte Carlo (Low-Discrepancy Sequences)
Motivation: why this matters in quant finance
Monte Carlo pricing converges at rate . To halve the standard error you need four times the samples. For complex products with slow-running pricing functions (American options with Longstaff-Schwartz, path-dependent exotics, portfolio risk with thousands of paths), this is painful — a accuracy improvement costs compute.
This note explains what low-discrepancy means, states the Koksma-Hlawka bound, and gives the two most-used constructions (Halton and Sobol) with their practical trade-offs.
The informal idea
Monte Carlo samples IID uniform. The integral estimator is
Error: . The CLT is the source of the rate.
The effect: for smooth integrands, QMC errors decay like instead of . For and , that's roughly vs — the log factor takes away some of the gain in high dimensions, but QMC still dominates for up to maybe or so in practice.
Formal definitions
Discrepancy
In plain English: the worst-case discrepancy between "fraction of points in box " and "volume of ," over all boxes anchored at the origin.
Koksma-Hlawka inequality
For a function of bounded variation (in the Hardy-Krause sense),
Two caveats:
- is often infinite for realistic pricing functions (e.g., has a kink). Bounded variation holds for smooth integrands, and near-smooth ones (with mild kinks) perform well in practice.
- Koksma-Hlawka is a worst-case bound. The average behaviour can be substantially better or (rarely) worse.
Halton sequence
The -dimensional Halton sequence uses the radical-inverse function in base : write and let . The first few terms of the base-2 radical inverse are
The Halton sequence is
Sobol sequence
The details are technical (primitive polynomials over , recursive direction-number construction), but the operational picture is:
- Each dimension's values are generated by XORing the direction-numbers of the bits of .
- Good direction numbers (Joe-Kuo 2008 being the gold-standard choice) extend Sobol's practical utility to .
- Sobol sequences are the default in every serious numerical library (SciPy's
qmc.Sobol, QuantLib, MATLAB'ssobolset).
Key properties
- Dimension dependence. In dimension , the factor grows rapidly. For , is already astronomical. But the effective dimension of most financial integrands is small — most of the variance is captured by the first few dimensions, and the remaining dimensions contribute little.
- Brownian bridge construction. For path-dependent options, using Brownian bridge to generate paths places the most important Brownian increments in the low-index Sobol dimensions. This often reduces effective dimension dramatically.
- Randomisation. Pure QMC gives a deterministic answer with no error estimate. Scrambled Sobol or randomised Halton add a random shift/scramble, preserving the low-discrepancy property but allowing standard-error estimation via independent replicates.
- Non-uniform sampling. QMC generates points in . Convert to standard normal via , which preserves low discrepancy (modulo the boundary behaviour of ).
Worked example — pricing a European call with QMC
Black-Scholes European call pricing under the risk-neutral measure reduces to a one-dimensional integral. For a geometric-average Asian option with monitoring dates, the integral is -dimensional.
Pseudocode:
import numpy as np
from scipy.stats import qmc, norm
def sobol_mc_call(S0, K, r, sigma, T, n_steps, n_paths, seed=0):
dt = T / n_steps
engine = qmc.Sobol(d=n_steps, scramble=True, seed=seed)
u = engine.random(n=n_paths)
z = norm.ppf(u)
log_paths = np.cumsum(
(r - 0.5 * sigma**2) * dt + sigma * np.sqrt(dt) * z,
axis=1,
)
S = S0 * np.exp(log_paths)
payoff = np.maximum(S.mean(axis=1) - K, 0.0)
return np.exp(-r * T) * payoff.mean()qmc.Sobol with np.random.default_rng for pure MC. For , , pricing a geometric Asian on :- Pure MC standard error (estimated via 20 independent runs): approximately on a price of .
- Scrambled Sobol standard error: approximately on the same price.
About a reduction in standard error at the same sample size — equivalent to fewer samples to reach the same accuracy.
Common confusions and pitfalls
- QMC errors are not Gaussian. A single QMC run gives a deterministic number. To get a standard-error-like quantity, use randomised QMC (scrambled Sobol) with multiple independent replicates. Taking the -CI of pure QMC "replicates" that are just different starting offsets is a common mistake.
- Skipping the initial Sobol points. Classical advice was to skip the first Sobol points for some . With modern direction numbers (Joe-Kuo), this is unnecessary and may even slightly hurt. Current practice: don't skip.
- Effective dimension matters. A naive Sobol sequence for a 250-step Asian may barely beat Monte Carlo. With Brownian bridge sampling, effective dimension can drop to and the speedup becomes dramatic.
- Box-Muller transforms degrade Sobol. For Gaussian sampling, always use inverse-CDF (), not Box-Muller. Box-Muller pairs two independent uniforms in a non-monotone way that destroys the Sobol structure.
- Koksma-Hlawka requires bounded variation. Discontinuous payoffs (digital options, barrier options) technically violate the assumption. In practice QMC usually still helps, but gains are smaller and smooth replications (e.g., a narrow sigmoid for a digital) recover them.
Where this goes next
- Monte Carlo Pricing — the baseline technique QMC replaces.
- Monte Carlo Variance Reduction: Antithetic Variates — an orthogonal way to reduce variance; combines with QMC.
- Monte Carlo Variance Reduction: Importance Sampling — works well alongside Sobol.