SOBOL
The Sobol Quasirandom Sequence


SOBOL is a FORTRAN90 library which computes elements of the Sobol quasirandom sequence, by Bennett Fox.

A quasirandom or low discrepancy sequence, such as the Faure, Halton, Hammersley, Niederreiter or Sobol sequences, is "less random" than a pseudorandom number sequence, but more useful for such tasks as approximation of integrals in higher dimensions, and in global optimization. This is because low discrepancy sequences tend to sample space "more uniformly" than random numbers. Algorithms that use such sequences may have superior convergence.

SOBOL is an adaptation of the INSOBL and GOSOBL routines in ACM TOMS Algorithm 647 and ACM TOMS Algorithm 659. The original code can only compute the "next" element of the sequence. The revised code allows the user to specify the index of any desired element.

At the request of a user, the library now contains two versions of the algorithm, one using the default integer and real precision, and one using the higher precision obtainable by requesting "(KIND=8)". The two sets of code are distinguished by names that begin with I4_ and I8_. I am aware that using the KIND attribute with an explicit value is not the correct way of asking for higher precision, but it's natural, and the correct way looks a little too awkward and obscure to me today. I am aware that many variables in the higher precision code need not themselves be calculated in higher precision. I'd just like to see if and how the higher precision code runs at all.

A remark by Joe and Kuo shows how to extend the algorithm from the original maximum spatial dimension of 40 up to a maximum spatial dimension of 1111. These changes have been implemented in the C++ and FORTRAN90 versions of the program.

The original, true, correct versions of ACM TOMS Algorithm 647 and ACM TOMS Algorithm 659 are available in the TOMS subdirectory of the NETLIB web site. The version displayed here has been converted to FORTRAN90, and other internal changes have been made to suit me.

Licensing:

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

Languages:

SOBOL is available in a C++ version and a FORTRAN90 version and a MATLAB version and a Python version

Related Data and Programs:

CVT, a FORTRAN90 library which computes elements of a Centroidal Voronoi Tessellation.

FAURE, a FORTRAN90 library which computes elements of a Faure quasirandom sequence.

HALTON, a FORTRAN90 library which computes elements of a Halton Quasi Monte Carlo (QMC) sequence, using a simple interface.

HAMMERSLEY, a FORTRAN90 library which computes elements of a Hammersley Quasi Monte Carlo (QMC) sequence, using a simple interface.

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.

IEEE_UNIFORM_SAMPLE, a FORTRAN90 library which tries to uniformly sample the discrete set of values that represent the legal IEEE real numbers;

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.

LATTICE_RULE, a FORTRAN90 library which approximates multidimensional integrals using lattice rules.

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_DATASET, a FORTRAN90 program which computes a Sobol quasirandom sequence and writes it to a file.

TOMS647, a FORTRAN90 library which is a version of ACM TOMS algorithm 647, for evaluating Faure, Halton and Sobol sequences.

TOMS659, a FORTRAN77 library which evaluates Sobol sequences.

UNIFORM, a FORTRAN90 library which computes elements of a uniform pseudorandom sequence.

VAN_DER_CORPUT, a FORTRAN90 library which computes elements of a van der Corput quasirandom sequence.

Author:

Original FORTRAN77 version by Bennett Fox; FORTRAN90 version by John Burkardt.

Reference:

  1. IA Antonov, VM Saleev,
    An Economic Method of Computing LP Tau-Sequences,
    USSR Computational Mathematics and Mathematical Physics,
    Volume 19, 1980, pages 252-256.
  2. Paul Bratley, Bennett Fox,
    Algorithm 659: Implementing Sobol's Quasirandom Sequence Generator,
    ACM Transactions on Mathematical Software,
    Volume 14, Number 1, March 1988, pages 88-100.
  3. Paul Bratley, Bennett Fox, Harald Niederreiter,
    Implementation and Tests of Low Discrepancy Sequences,
    ACM Transactions on Modeling and Computer Simulation,
    Volume 2, Number 3, July 1992, pages 195-213.
  4. Paul Bratley, Bennett Fox, Linus Schrage,
    A Guide to Simulation,
    Second Edition,
    Springer, 1987,
    ISBN: 0387964673,
    LC: QA76.9.C65.B73.
  5. Bennett Fox,
    Algorithm 647: Implementation and Relative Efficiency of Quasirandom Sequence Generators,
    ACM Transactions on Mathematical Software,
    Volume 12, Number 4, December 1986, pages 362-376.
  6. Stephen Joe, Frances Kuo,
    Remark on Algorithm 659: Implementing Sobol's Quasirandom Sequence Generator,
    ACM Transactions on Mathematical Software,
    Volume 29, Number 1, March 2003, pages 49-57.
  7. Harald Niederreiter,
    Random Number Generation and quasi-Monte Carlo Methods,
    SIAM, 1992,
    ISBN13: 978-0-898712-95-7,
    LC: QA298.N54.
  8. William Press, Brian Flannery, Saul Teukolsky, William Vetterling,
    Numerical Recipes in FORTRAN: The Art of Scientific Computing,
    Second Edition,
    Cambridge University Press, 1992,
    ISBN: 0-521-43064-X,
    LC: QA297.N866.
  9. Ilya Sobol,
    Uniformly Distributed Sequences with an Additional Uniform Property,
    USSR Computational Mathematics and Mathematical Physics,
    Volume 16, 1977, pages 236-242.
  10. Ilya Sobol, YL Levitan,
    The Production of Points Uniformly Distributed in a Multidimensional Cube (in Russian),
    Preprint IPM Akademii Nauk SSSR,
    Number 40, Moscow 1976.

Source Code:

SOBOL is the current version of the program, which is restricted to a maximum spatial dimension of 1111.

Examples and Tests:

SOBOL_PRB tests the code.

List of Routines:

You can go up one level to the FORTRAN90 source codes.


Last revised on 03 July 2006.