Monte Carlo (MC) methods approximate the true mean (expectation)
for some discrete distribution
Classic Monte Carlo methods choose IID (independent and identically distributed) samples $\boldsymbol{x}0,\dots,\boldsymbol{x}{n-1} \overset{\mathrm{IID}}{\sim} \mathcal{U}[0,1]^d$ and have error
Often practitioners would like to run their (Quasi-)Monte Carlo method until the error
QMCPy is organized into the four main components below. Details for each of these classes are available in the linked guides and API docs.
These generate IID or LD points
-
Lattices with
- extensible constructions
- random shifts
-
Digital Nets in base
$b=2$ with- extensible constructions
- digital shifts
- linear matrix scrambling
- nested uniform scrambling (also called Owen scrambling)
- higher order constructions via digital interlacing
-
Halton point sets with
- extensible constructions
- digital shifts
- permutation scrambling
- linear matrix scrambling
- nested uniform scrambling
These define QMCPy will automatically choose an appropriate transform
-
Uniform
$\boldsymbol{T} \sim \mathcal{U}[\boldsymbol{l},\boldsymbol{u}]$ with elementwise$\boldsymbol{l} \leq \boldsymbol{u}$ for which$\boldsymbol{\psi}(\boldsymbol{x}) = \boldsymbol{l}+(\boldsymbol{u}-\boldsymbol{l}) \odot \boldsymbol{x}$ with$\odot$ the Hadamard (elementwise) product. -
Gaussian
$\boldsymbol{T} \sim \mathcal{N}(\boldsymbol{m},\mathsf{\Sigma})$ for which$\boldsymbol{\psi}(\boldsymbol{x}) = \boldsymbol{m}+\mathsf{A}\Phi^{-1}(\boldsymbol{x})$ where$\Phi^{-1}$ is the inverse CDF of the standard Gaussian distribution applied elementwise and the covariance$\mathsf{\Sigma} = \mathsf{A} \mathsf{A}^T$ may be decomposed using either- the Cholesky decomposition or
- the eigendecomposition.
-
Brownian Motion observed with an initial value
$B_0$ , drift$\gamma$ , and diffusion$\sigma^2$ at times$\boldsymbol{t} := (t_1,\dots,t_d)^T$ satisfying$0 \leq t_1 < t_2 < \dots < t_d$ is a Gaussian with mean and covariance
-
Independent Marginals have
$\boldsymbol{T} = (T_1,\dots,T_d)^T$ with$T_1,\dots,T_d$ independent. We support (continuous) marginal distributions fromscipy.stats.
These define QMCPy will use to define
-
User Defined Integrands, where the user provides a function handle for
$g$ - Financial Options, including the European option, Asian option, and Barrier option
-
UM-BridgeFunctions. From their docs,UM-Bridgeis a universal interface that makes any numerical model accessible from any programming language or higher-level software through the use of containerized environments.UM-Bridgealso enables simulations to scale to supercomputers or the cloud with minimal effort.
These deploy (Quasi-)Monte Carlo methods under error tolerance and budgetary constraints by utilizing adaptive sampling schemes and efficient error estimation procedures. Common stopping criteria include
-
Quasi-Monte Carlo via tracking the decay of coefficients in an orthogonal basis expansion. These methods are guaranteed for cones of functions whose coefficients decay in a regular manner. Efficient procedures exist to estimate coefficients when
- pairing lattices with the Fourier expansion or
- pairing digital nets with the Walsh expansion.
-
Quasi-Monte Carlo via efficient Bayesian cubature methods which assume
$f$ is a draw from a Gaussian process so the posterior expectation has an analytic expression. While classic Bayesian cubature would require$\mathcal{O}(n^2)$ storage and$\mathcal{O}(n^3)$ computations, when matching certain LD sequences to special kernels the Gram matrices become nicely structured to permit Bayesian cubature with only$\mathcal{O}(n)$ storage and$\mathcal{O}(n \log n)$ computations. Specifically,- pairing lattices with shift-invariant kernels gives circulant Gram matrices which are diagonalizable by the Fast Fourier Transform (FFT), and
- pairing digital nets with digitally-shift-invariant kernels gives Gram matrices which are diagonalizable by the Fast Walsh-Hadamard Transform (FWHT).
-
Quasi-Monte Carlo via multiple independent randomizations of an LD point set and Student's
$t$ confidence intervals. -
IID Monte Carlo via a two step procedure using the Central Limit Theorem (CLT). Error estimates are not guaranteed as CLT is asymptotic in
$n$ and the variance must be estimated. - IID Monte Carlo via a two step procedure using Berry-Esseen inequalities to account for finite sample sizes. Error estimates are guaranteed for functions with bounded Kurtosis.
- Multilevel IID Monte Carlo and Quasi-Monte Carlo which more efficiently integrate expensive functions by exploiting a telescoping sum over lower fidelity models.