Expand description
Low-discrepancy (quasi-random) sequences: Sobol and Halton.
Quasi-random points fill the unit cube far more evenly than pseudo-random ones, so averages
over them converge like (log N)^d / N instead of N^{−1/2}. They are deterministic; for
error estimates, apply independent random shifts (randomized quasi-Monte Carlo).
See the book entry Quasi-random sequences.
Structs§
- Halton
Sequence - The Halton sequence: coordinate
kis the radical inverse in the k-th prime base. Simple and extensible to any number of points; uniformity degrades in high dimensions (large bases), where Sobol is preferable. Supports up to 100 dimensions. Starts at index 1 (skipping the origin). - Sobol
Sequence - The Sobol sequence in up to 21201 dimensions (Joe-Kuo direction numbers), generated in Gray-code
order (Antonov and Saleev), one XOR per coordinate per point. The first point is the origin;
every block of
2^kconsecutive points starting at a multiple of2^kis a(t, k, d)-net.
Functions§
- radical_
inverse - The van der Corput radical inverse of
nin baseb: the base-b digits ofnmirrored about the radix point. - random_
shift - Applies a Cranley-Patterson rotation
x ← (x + u) mod 1with a uniform random shiftuper coordinate. Independent shifts give unbiased, independent replicates of a quasi-Monte Carlo estimate, whose spread estimates its error.