VAN_DER_CORPUT_ADVANCED is a FORTRAN90 library which computes the van der Corput Quasi Monte Carlo (QMC) sequence, using a sophisticated interface.
VAN_DER_CORPUT_ADVANCED includes routines to make it easy to manipulate this computation, to compute the next N entries, to compute a particular entry, or to restart the sequence at a particular point.
The NDIM-dimensional Halton sequence is derived from the 1-dimensional van der Corput sequence by using a set of different (usually distinct prime) bases for each dimension, and the Hammersley sequence is derived in almost the same way.
The van der Corput sequence is often used to generate a "subrandom" sequence of points which have a better covering property than pseudorandom points.
The van der Corput sequence generates a sequence of points in [0,1] which (theoretically) never repeats. Except for SEED = 0, the elements of the van der Corput sequence are strictly between 0 and 1.
The van der Corput sequence writes an integer in a given base B, and then its digits are "reflected" about the decimal point. This maps the numbers from 1 to N into a set of numbers in [0,1], which are especially nicely distributed if N is one less than a power of the base.
Hammersley suggested generating a set of N nicely distributed points in two dimensions by setting the first component of the Ith point to I/N, and the second to the van der Corput value of I in base 2.
Halton suggested that in many cases, you might not know the number of points you were generating, so Hammersley's formulation was not ideal. Instead, he suggested that to generate a nicely distributed sequence of points in M dimensions, you simply choose the first M primes, P(1:M), and then for the J-th component of the I-th point in the sequence, you compute the van der Corput value of I in base P(J).
Thus, to generate a Halton sequence in a 2 dimensional space, it is typical practice to generate a pair of van der Corput sequences, the first with prime base 2, the second with prime base 3. Similarly, by using the first K primes, a suitable sequence in K-dimensional space can be generated.
The generation is quite simple. Given an integer SEED, the expansion of SEED in base BASE is generated. Then, essentially, the result R is generated by writing a decimal point followed by the digits of the expansion of SEED, in reverse order. This decimal value is actually still in base BASE, so it must be properly interpreted to generate a usable value.
Here is an example in base 2:
SEED (decimal) | SEED (binary) | VDC (binary) | VDC (decimal) |
---|---|---|---|
0 | 0 | .0 | 0.0 |
1 | 1 | .1 | 0.5 |
2 | 10 | .01 | 0.25 |
3 | 11 | .11 | 0.75 |
4 | 100 | .001 | 0.125 |
5 | 101 | .101 | 0.625 |
6 | 110 | .011 | 0.375 |
7 | 111 | .111 | 0.875 |
8 | 1000 | .0001 | 0.0625 |
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
VAN_DER_CORPUT_ADVANCED is available in a C++ version and a FORTRAN90 version and a MATLAB version.
CVT, a FORTRAN90 library which computes elements of a Centroidal Voronoi Tessellation.
FAURE, a FORTRAN90 library which computes elements of a Faure quasirandom sequence.
GRID, a FORTRAN90 library which computes elements of a grid dataset.
HALTON, a FORTRAN90 library which computes elements of a Halton quasirandom sequence.
HAMMERSLEY, a FORTRAN90 library which computes elements of a Hammersley quasirandom sequence.
HEX_GRID, a FORTRAN90 library which computes elements of a hexagonal grid dataset.
HEX_GRID_ANGLE, a FORTRAN90 library which computes elements of an angled hexagonal grid dataset.
IHS, a FORTRAN90 library which computes elements of an improved distributed Latin hypercube dataset.
LATIN_CENTER, a FORTRAN90 library which computes elements of a Latin Hypercube dataset, choosing center points.
LATIN_EDGE, a FORTRAN90 library which computes elements of a Latin Hypercube dataset, choosing edge points.
LATIN_RANDOM, a FORTRAN90 library which computes elements of a Latin Hypercube dataset, choosing points at random.
LCVT, a FORTRAN90 library which computes a latinized Centroidal Voronoi Tessellation.
NIEDERREITER2, a FORTRAN90 library which computes elements of a Niederreiter quasirandom sequence with base 2.
NORMAL, a FORTRAN90 library which computes elements of a sequence of pseudorandom normally distributed values.
SOBOL, a FORTRAN90 library which computes elements of a Sobol quasirandom sequence.
UNIFORM, a FORTRAN90 library which computes elements of a uniform pseudorandom sequence.
VAN_DER_CORPUT, a FORTRAN90 library which computes elements of a 1D van der Corput Quasi Monte Carlo (QMC) sequence using a simple interface.
VAN_DER_CORPUT, a dataset directory which contains examples of van der Corput sequences.
VAN_DER_CORPUT_DATASET, a FORTRAN90 program which creates a van der Corput dataset and writes it to a file.
You can go up one level to the FORTRAN90 source codes.