Low-discrepancy sequence explained

In mathematics, a low-discrepancy sequence is a sequence with the property that for all values of N, its subsequence x1, ..., xN has a low discrepancy.

Roughly speaking, the discrepancy of a sequence is low if the proportion of points in the sequence falling into an arbitrary set B is close to proportional to the measure of B, as would happen on average (but not for particular samples) in the case of an equidistributed sequence. Specific definitions of discrepancy differ regarding the choice of B (hyperspheres, hypercubes, etc.) and how the discrepancy for every B is computed (usually normalized) and combined (usually by taking the worst value).

Low-discrepancy sequences are also called quasirandom sequences, due to their common use as a replacement of uniformly distributed random numbers.The "quasi" modifier is used to denote more clearly that the values of a low-discrepancy sequence are neither random nor pseudorandom, but such sequences share some properties of random variables and in certain applications such as the quasi-Monte Carlo method their lower discrepancy is an important advantage.

Applications

Quasirandom numbers have an advantage over pure random numbers in that they cover the domain of interest quickly and evenly.

Two useful applications are in finding the characteristic function of a probability density function, and in finding the derivative function of a deterministic function with a small amount of noise. Quasirandom numbers allow higher-order moments to be calculated to high accuracy very quickly.

Applications that don't involve sorting would be in finding the mean, standard deviation, skewness and kurtosis of a statistical distribution, and in finding the integral and global maxima and minima of difficult deterministic functions. Quasirandom numbers can also be used for providing starting points for deterministic algorithms that only work locally, such as Newton–Raphson iteration.

Quasirandom numbers can also be combined with search algorithms. With a search algorithm, quasirandom numbers can be used to find the mode, median, confidence intervals and cumulative distribution of a statistical distribution, and all local minima and all solutions of deterministic functions.

Low-discrepancy sequences in numerical integration

Various methods of numerical integration can be phrased as approximating the integral of a function f in some interval, e.g. [0,1], as the average of the function evaluated at a set in that interval:

1
\int
0

f(u)du

1
N
N
\sum
i=1

f(xi).

If the points are chosen as xi = i/N, this is the rectangle rule.If the points are chosen to be randomly (or pseudorandomly) distributed, this is the Monte Carlo method.If the points are chosen as elements of a low-discrepancy sequence, this is the quasi-Monte Carlo method.A remarkable result, the Koksma–Hlawka inequality (stated below), shows that the error of such a method can be bounded by the product of two terms, one of which depends only on f, and the other one is the discrepancy of the set .

It is convenient to construct the set in such a way that if a set with N+1 elements is constructed, the previous N elements need not be recomputed.The rectangle rule uses points set which have low discrepancy, but in general the elements must be recomputed if N is increased.Elements need not be recomputed in the random Monte Carlo method if N is increased,but the point sets do not have minimal discrepancy.By using low-discrepancy sequences we aim for low discrepancy and no need for recomputations, but actually low-discrepancy sequences can only be incrementally good on discrepancy if we allow no recomputation.

Definition of discrepancy

The discrepancy of a set P = is defined, using Niederreiter's notation, as

DN(P)=\supB\in\left|

A(B;P)
N

-λs(B)\right|

whereλs is the s-dimensional Lebesgue measure,A(B;P) is the number of points in P that fall into B,and J is the set of s-dimensional intervals or boxes of the form

s
\prod
i=1

[ai,bi)=\{x\inRs:ai\lexi<bi\}

where

0\leai<bi\le1

.

The star-discrepancy D*N(P) is defined similarly, except that the supremum is taken over the set J* of rectangular boxes of the form

s
\prod
i=1

[0,ui)

where ui is in the half-open interval [0, 1).

The two are related by

*
D
N

\leDN\le2s

*
D
N

.

Note: With these definitions, discrepancy represents the worst-case or maximum point density deviation of a uniform set. However, also other error measures are meaningful, leading to other definitions and variation measures. For instance, L2 discrepancy or modified centered L2 discrepancy are also used intensively to compare the quality of uniform point sets. Both are much easier to calculate for large N and s.

The Koksma–Hlawka inequality

Let Īs be the s-dimensional unit cube,Īs = [0, 1] × ... × [0, 1].Let f have bounded variation V(f) on Īs in the sense of Hardy and Krause.Then for any x1, ..., xNin Is =[0, 1) × ... ×[0, 1),

\left|

1
N
N
\sum
i=1

f(xi) -

\int
\barIs

f(u)du\right| \leV(f)

*
D
N

(x1,\ldots,xN).

The KoksmaHlawka inequality is sharp in the following sense: For any point set in Is and any

\varepsilon>0

, there is a function f with bounded variation and V(f) = 1 such that

\left|

1
N
N
\sum
i=1

f(xi) -

\int
\barIs

f(u)du

*
\right|>D
N

(x1,\ldots,xN)-\varepsilon.

Therefore, the quality of a numerical integration rule depends only on the discrepancy D*N(x1,...,xN).

The formula of Hlawka–Zaremba

Let

D=\{1,2,\ldots,d\}

. For

\emptysetu\subseteqD

wewrite

dxu:=\prodj\indxj

and denote by

(xu,1)

the point obtained from x by replacing thecoordinates not in u by

1

. Then
1
N
N
\sum
i=1

f(xi) -

\int
\barIs

f(u)du= \sum\emptyset(-1)|u|

\int
[0,1]|u|
\operatorname{disc}(x
u,1)\partial|u|
\partialxu

f(xu,1)dxu,

where

\operatorname{disc}(z)=

1
N
N
\sum
i=1
d
\prod
j=1
1
[0,zj)

(xi,j)-

d
\prod
j=1

zi

is the discrepancy function.

The L2 version of the Koksma–Hlawka inequality

Applying the Cauchy–Schwarz inequality for integrals and sums to the Hlawka–Zaremba identity, we obtain an

L2

version of the Koksma–Hlawka inequality:
\left|1
N
N
\sum
i=1

f(xi) -

\int
\barIs

f(u)du\right|\le \|f\|d\operatorname{disc}d(\{ti\}),

where

\operatorname{disc}d(\{ti\})=\left(\sum\emptyset

\int
[0,1]|u|
2
\operatorname{disc}(x
u,1)

1/2
dx
u\right)

and

\|f\|d=\left(\sumu\subseteq

\int\left|
[0,1]|u|
\partial|u|
\partialxu
2
f(x
u,1)\right|
1/2
dx
u\right)

.

L2

discrepancy has a high practical importance because fast explicit calculations are possible for a given point set. This way it is easy to create point set optimizers using

L2

discrepancy as criteria.

The Erdős–Turán–Koksma inequality

It is computationally hard to find the exact value of the discrepancy of large point sets. The ErdősTuránKoksma inequality provides an upper bound.

Let x1,...,xN be points in Is and H be an arbitrary positive integer. Then

*
D
N

(x1,\ldots,x

N)\leq \left(3
2
s \left(2
H+1
\right)
+ \sum
0<\|h\|infty\leqH
1\left|
r(h)
1
N
N
\sum
n=1
2\pii\langleh,xn\rangle
e

\right| \right)

where

smax\{1,|h
r(h)=\prod
i|\}for

h=(h1,\ldots,h

s.
s)\in\Z

The main conjectures

Conjecture 1. There is a constant cs depending only on the dimension s, such that

*
D
N

(x1,\ldots,xN)\geq

c
s(lnN)s-1
N

for any finite point set .

Conjecture 2. There is a constant c's depending only on s, such that

*
D
N

(x1,\ldots,xN)\geq

c'
s(lnN)s
N

for infinite number of N for any infinite sequence x1,x2,x3,....

These conjectures are equivalent. They have been proved for s ≤ 2 by W. M. Schmidt. In higher dimensions, the corresponding problem is still open. The best-known lower bounds are due to Michael Lacey and collaborators.

Lower bounds

Let s = 1. Then

*(x
D
1,\ldots,x
N)\geq1
2N

for any finite point set .

Let s = 2. W. M. Schmidt proved that for any finite point set,

*(x
D
1,\ldots,x

N)\geqC

logN
N

where

C=maxa\geq3

1
16
a-2
aloga

=0.023335....

For arbitrary dimensions s > 1, K. F. Roth proved that

*(x
D
1,\ldots,x
N)\geq1
24s
1
s-1
2
((s-1)log2)
s-1
2
logN
N

for any finite point set . Jozef Beck [1] established a double log improvement of this result in three dimensions. This was improved by D. Bilyk and M. T. Lacey to a power of a single logarithm. The best known bound for s > 2 is dueD. Bilyk and M. T. Lacey and A. Vagharshakyan.[2] For s > 2 there is a t > 0 so that

*(x
D
1,\ldots,x

N)\geqt

s-1+t
2
logN
N

for any finite point set .

Construction of low-discrepancy sequences

Because any distribution of random numbers can be mapped onto a uniform distribution, and quasirandom numbers are mapped in the same way, this article only concerns generation of quasirandom numbers on a multidimensional uniform distribution.

There are constructions of sequences known such that

*
D
N

(x1,\ldots,xN)\leqC

(lnN)s
N

.

where C is a certain constant, depending on the sequence. After Conjecture 2, these sequences are believed to have the best possible order of convergence. Examples below are the van der Corput sequence, the Halton sequences, and the Sobol’ sequences. One general limitation is that construction methods can usually only guarantee the order of convergence. Practically, low discrepancy can be only achieved if N is large enough, and for large given s this minimum N can be very large. This means running a Monte-Carlo analysis with e.g. s=20 variables and N=1000 points from a low-discrepancy sequence generator may offer only a very minor accuracy improvement .

Random numbers

Sequences of quasirandom numbers can be generated from random numbers by imposing a negative correlation on those random numbers. One way to do this is to start with a set of random numbers

ri

on

[0,0.5)

and construct quasirandom numbers

si

which are uniform on

[0,1)

using:

si=ri

for

i

odd and

si=0.5+ri

for

i

even.

A second way to do it with the starting random numbers is to construct a random walk with offset 0.5 as in:

si=si-1+0.5+ri\pmod1.

That is, take the previous quasirandom number, add 0.5 and the random number, and take the result modulo 1.

For more than one dimension, Latin squares of the appropriate dimension can be used to provide offsets to ensure that the whole domain is covered evenly.

Additive recurrence

For any irrational

\alpha

, the sequence

sn=\{s0+n\alpha\}

has discrepancy tending to

1/N

. Note that the sequence can be defined recursively by

sn+1=(sn+\alpha)\bmod1.

A good value of

\alpha

gives lower discrepancy than a sequence of independent uniform random numbers.

The discrepancy can be bounded by the approximation exponent of

\alpha

. If the approximation exponent is

\mu

, then for any

\varepsilon>0

, the following bound holds:

DN((sn))=O\varepsilon(N-1/(\mu-1)+\varepsilon).

By the Thue–Siegel–Roth theorem, the approximation exponent of any irrational algebraic number is 2, giving a bound of

N-1+\varepsilon

above.

The recurrence relation above is similar to the recurrence relation used by a linear congruential generator, a poor-quality pseudorandom number generator:[3]

ri=(ari-1+c)\bmodm

For the low discrepancy additive recurrence above, a and m are chosen to be 1. Note, however, that this will not generate independent random numbers, so should not be used for purposes requiring independence.

The value of

c

with lowest discrepancy is the fractional part of the golden ratio:[4]

c=

\sqrt{5
-1}{2}

=\varphi-10.618034.

Another value that is nearly as good is the fractional part of the silver ratio, which is the fractional part of the square root of 2:

c=\sqrt{2}-10.414214.

In more than one dimension, separate quasirandom numbers are needed for each dimension. A convenient set of values that are used, is the square roots of primes from two up, all taken modulo 1:

c=\sqrt{2},\sqrt{3},\sqrt{5},\sqrt{7},\sqrt{11},\ldots

However, a set of values based on the generalised golden ratio has been shown to produce more evenly distributed points. [5]

The list of pseudorandom number generators lists methods for generating independent pseudorandom numbers.Note: In few dimensions, recursive recurrence leads to uniform sets of good quality, but for larger s (like s>8) other point set generators can offer much lower discrepancies.

van der Corput sequence

See main article: article and van der Corput sequence.

Let

L-1
n=\sum
k=0
k
d
k(n)b

be the b-ary representation of the positive integer n ≥ 1, i.e. 0 ≤ dk(n) < b. Set

gb(n)=\sum

L-1
k=0
-k-1
d
k(n)b

.

Then there is a constant C depending only on b such that (gb(n))n ≥ 1satisfies

*
D
N(g

b(1),...,gb(N))\leqC

logN
N

,

where D*N is the star discrepancy.

Halton sequence

See main article: article and Halton sequence.

The Halton sequence is a natural generalization of the van der Corput sequence to higher dimensions. Let s be an arbitrary dimension and b1, ..., bs be arbitrary coprime integers greater than 1. Define

x(n)=(g
b1
(n),...,g
bs

(n)).

Then there is a constant C depending only on b1, ..., bs, such that sequence n≥1 is a s-dimensional sequence with

*
DC'
N(x(1),...,x(N))\leq
(logN)s
N

.

Hammersley set

Let b1,...,bs−1 be coprime positive integers greater than 1. For given s and N, the s-dimensional Hammersley set of size N is defined by[6]

x(n)=\left(g
b1
(n),...,g(n),
bs-1
n
N

\right)

for n = 1, ..., N. Then

*
DC
N(x(1),...,x(N))\leq
(logN)s-1
N

where C is a constant depending only on b1, ..., bs-1.Note: The formulas show that the Hammersley set is actually the Halton sequence, but we get one more dimension for free by adding a linear sweep. This is only possible if N is known upfront. A linear set is also the set with lowest possible one-dimensional discrepancy in general. Unfortunately, for higher dimensions, no such "discrepancy record sets" are known. For s = 2, most low-discrepancy point set generators deliver at least near-optimum discrepancies.

Sobol’ sequence

See main article: article and Sobol sequence.

The Antonov–Saleev variant of the Sobol’ sequence generates numbers between zero and one directly as binary fractions of length

w

, from a set of

w

special binary fractions,

Vi,i=1,2,...,w

called direction numbers. The bits of the Gray code of

i

,

G(i)

, are used to select direction numbers. To get the Sobol’ sequence value

si

take the exclusive or of the binary value of the Gray code of

i

with the appropriate direction number. The number of dimensions required affects the choice of

Vi

.

Poisson disk sampling

See main article: article. Poisson disk sampling is popular in video games to rapidly place objects in a way that appears random-lookingbut guarantees that every two points are separated by at least the specified minimum distance.[7] This does not guarantee low discrepancy (as e. g. Sobol’), but at least a significantly lower discrepancy than pure random sampling. The goal of these sampling patterns is based on frequency analysis rather than discrepancy, a type of so-called "blue noise" patterns.

Graphical examples

The points plotted below are the first 100, 1000, and 10000 elements in a sequence of the Sobol' type.For comparison, 10000 elements of a sequence of pseudorandom points are also shown.The low-discrepancy sequence was generated by TOMS algorithm 659.[8] An implementation of the algorithm in Fortran is available from Netlib.

See also

References

External links

Notes and References

  1. A two-dimensional van Aardenne-Ehrenfest theorem in irregularities of distribution. Compositio Mathematica. 72 . 3. 1989. 269–339. 125940424. Beck. József. 1032337 . 0691.10041.
  2. 10.1016/j.jfa.2007.09.010. On the Small Ball Inequality in all dimensions . 2008 . Bilyk . Dmitriy . Lacey . Michael T. . Vagharshakyan . Armen . Journal of Functional Analysis . 254 . 9 . 2470–2502 . 14234006 . free . 0705.4619 .
  3. Book: Knuth, Donald E. . . 2 . Chapter 3 – Random Numbers.
  4. Web site: Malte . Skarupke. Fibonacci Hashing: The Optimization that the World Forgot. 16 June 2018 . One property of the Golden Ratio is that you can use it to subdivide any range roughly evenly ... if you don’t know ahead of time how many steps you’re going to take.
  5. Web site: Martin . Roberts. 2018 . The Unreasonable Effectiveness of Quasirandom Sequences.
  6. Book: Monte Carlo Methods. Hammersley. J. M.. Handscomb. D. C.. 1964. 10.1007/978-94-009-5819-7. 978-94-009-5821-0 .
  7. Herman Tulleken. Poisson Disk Sampling . Dev.Mag . 21 . March 2008. Herman . Tulleken . 21–25 .
  8. 10.1145/42288.214372. Algorithm 659 . 1988 . Bratley . Paul . Fox . Bennett L. . ACM Transactions on Mathematical Software . 14 . 88–100 . 17325779 . free .