Jump to content

Halton sequence: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Line 26: Line 26:
: ({{frac|2}}, {{frac|3}}), ({{frac|4}}, {{frac|2|3}}), ({{frac|3|4}}, {{frac|9}}), ({{frac|8}}, {{frac|4|9}}), ({{frac|5|8}}, {{frac|7|9}}), ({{frac|3|8}}, {{frac|2|9}}), ({{frac|7|8}}, {{frac|5|9}}), ({{frac|16}}, {{frac|8|9}}), ({{frac|9|16}}, {{frac|27}}).
: ({{frac|2}}, {{frac|3}}), ({{frac|4}}, {{frac|2|3}}), ({{frac|3|4}}, {{frac|9}}), ({{frac|8}}, {{frac|4|9}}), ({{frac|5|8}}, {{frac|7|9}}), ({{frac|3|8}}, {{frac|2|9}}), ({{frac|7|8}}, {{frac|5|9}}), ({{frac|16}}, {{frac|8|9}}), ({{frac|9|16}}, {{frac|27}}).


Even though standard Halton sequences perform very well in low dimensions, correlation problems have been noted between sequences generated from higher primes. For example if we started with the primes 17 and 19, the first 16 pairs of points: ({{frac|17}}, {{frac|19}}), ({{frac|2|17}}, {{frac|2|19}}), ({{frac|3|17}}, {{frac|3|19}}) ... ({{frac|16|17}}, {{frac|16|19}}) have perfect [[linear correlation]]. To avoid this, it is common to drop the first 20 entries, or some other predetermined number depending on the primes chosen. In order to deal with this problem, various other methods have been proposed; one of the most prominent solutions is the scrambled Halton sequence, which uses permutations of the coefficients used in the construction of the standard sequence.
Even though standard Halton sequences perform very well in low dimensions, correlation problems have been noted between sequences generated from higher primes. For example if we started with the primes 17 and 19, the first 16 pairs of points: ({{frac|17}}, {{frac|19}}), ({{frac|2|17}}, {{frac|2|19}}), ({{frac|3|17}}, {{frac|3|19}}) ... ({{frac|16|17}}, {{frac|16|19}}) have perfect [[linear correlation]]. To avoid this, it is common to drop the first 20 entries, or some other predetermined number depending on the primes chosen. In order to deal with this problem, various other methods have been proposed; one of the most prominent solutions is the scrambled Halton sequence, which uses permutations of the coefficients used in the construction of the standard sequence. Another solution is using leaped Halton, just skipping points. If you use e.g. only each 409th point (also other prime numbers not used in the Halton core sequence are possible), then you can achieve significant improvements.


== Implementation in pseudocode ==
== Implementation in pseudocode ==

Revision as of 09:16, 2 June 2016

256 points from a pseudorandom number source (top) compared with the first 256 points from the 2,3 Halton sequence (below). The Halton sequence covers the space more evenly. (red=1,..,10, blue=11,..,100, green=101,..,256)

In statistics, Halton sequences are sequences used to generate points in space for numerical methods such as Monte Carlo simulations. Although these sequences are deterministic, they are of low discrepancy, that is, appear to be random for many purposes. They were first introduced in 1960 and are an example of a quasi-random number sequence. They generalise the one-dimensional van der Corput sequences, consult that article for a precise definition.

Example of Halton sequence used to generate points in (0, 1) × (0, 1) in R2

Illustration of the first 8 points of the 2,3 Halton sequence

The Halton sequence is constructed according to a deterministic method that uses coprime numbers as its bases. As a simple example, let's take one dimension of the Halton sequence to be based on 2 and the other on 3. To generate the sequence for 2, we start by dividing the interval (0,1) in half, then in fourths, eighths, etc., which generates

12, 14, 34, 18, 58, 38, 78, 116, 916,...

and to generate the sequence for 3, we divide the interval (0,1) in thirds, then ninths, twenty-sevenths, etc., which generates

13, 23, 19, 49, 79, 29, 59, 89, 127,...

When we pair them up, we get a sequence of points in a unit square:

(12, 13), (14, 23), (34, 19), (18, 49), (58, 79), (38, 29), (78, 59), (116, 89), (916, 127).

Even though standard Halton sequences perform very well in low dimensions, correlation problems have been noted between sequences generated from higher primes. For example if we started with the primes 17 and 19, the first 16 pairs of points: (117, 119), (217, 219), (317, 319) ... (1617, 1619) have perfect linear correlation. To avoid this, it is common to drop the first 20 entries, or some other predetermined number depending on the primes chosen. In order to deal with this problem, various other methods have been proposed; one of the most prominent solutions is the scrambled Halton sequence, which uses permutations of the coefficients used in the construction of the standard sequence. Another solution is using leaped Halton, just skipping points. If you use e.g. only each 409th point (also other prime numbers not used in the Halton core sequence are possible), then you can achieve significant improvements.

Implementation in pseudocode

   FUNCTION (index, base)
   BEGIN
       result = 0;
       f = 1;
       i = index;
       WHILE (i > 0) 
       BEGIN
           f = f / base;
           result = result + f * (i % base);
           i = FLOOR(i / base);
       END
       RETURN result;
   END

See also

References

  • Kuipers, L.; Niederreiter, H. (2005), Uniform distribution of sequences, Dover Publications, p. 129, ISBN 0-486-45019-8
  • Niederreiter, Harald (1992), Random number generation and quasi-Monte Carlo methods, SIAM, p. 29, ISBN 0-89871-295-5.
  • Halton, J. (1964), Algorithm 247: Radical-inverse quasi-random point sequence, ACM, p. 701, doi:10.1145/355588.365104.