Expand description
Tools for quasi-Monte Carlo sampling, following scipy.stats.qmc: Latin hypercube samples,
the discrepancy of a point set (how far it is from uniform), and scaling between the unit cube
and a box. The low-discrepancy sequences themselves, plain or scrambled, are
SobolSequence and
HaltonSequence.
See the book entry Quasi-random sequences.
Structs§
- Poisson
Disk - Poisson-disk sampling in a box (SciPy’s
qmc.PoissonDisk): random points no two of which are closer thanradius, by Bridson’s algorithm. A background grid with cells of sider/√dholds at most one point each, so the test for nearby points looks only at the surrounding cells; new points are drawn as candidates around a random active point and kept if no existing point is withinr.
Enums§
- Discrepancy
- A discrepancy measure (SciPy’s
method). All areL²discrepancies with closed forms that costO(n² d); each is the worst-case integration error, over a unit ball of functions, of the equal-weight rule on the points. - Hypersphere
- How
PoissonDiskdraws candidates around a centre (SciPy’shypersphere).
Functions§
- discrepancy
- The discrepancy of
pointsin[0, 1]^d(SciPy’sqmc.discrepancy): smaller is more uniform. - latin_
hypercube npoints of a Latin hypercube in[0, 1)^d(SciPy’sqmc.LatinHypercube): in every coordinate, each of thenintervals[i/n, (i+1)/n)holds exactly one point. Each coordinate takes an independent random permutation of the intervals; the point is placed uniformly in its cell, or at the cell’s centre whencentered(SciPy’sscramble=False).- scale
- Maps points from the unit cube to the box
[lower, upper](SciPy’sqmc.scale), or back whenreverse.