G05YLF (PDF version)
G05 Chapter Contents
G05 Chapter Introduction
NAG Library Manual

NAG Library Routine Document


Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

+ Contents

    1  Purpose
    7  Accuracy
    9  Example

1  Purpose

G05YLF initializes a quasi-random generator prior to calling G05YJF, G05YKF or G05YMF.

2  Specification


3  Description

G05YLF selects a quasi-random number generator through the input value of GENID and initializes the IREF communication array for use by the routines G05YJF, G05YKF or G05YMF.
One of three types of quasi-random generator may be chosen, allowing the low-discrepancy sequences proposed by Sobol, Faure or Niederreiter to be generated.
Two sets of Sobol sequences are supplied, the first, is based on the work of Joe and Kuo (2008). The second, referred to in the documentation as "Sobol (A659)", is based on Algorithm 659 of Bratley and Fox (1988) with the extension to 1111 dimensions proposed by Joe and Kuo (2003). Both sets of Sobol sequences should satisfy the so-called Property A, up to 1111 dimensions, but the first set should have better two-dimensional projections than those produced using Algorithm 659.

4  References

Bratley P and Fox B L (1988) Algorithm 659: implementing Sobol's quasirandom sequence generator ACM Trans. Math. Software 14(1) 88–100
Fox B L (1986) Algorithm 647: implementation and relative efficiency of quasirandom sequence generators ACM Trans. Math. Software 12(4) 362–376
Joe S and Kuo F Y (2003) Remark on Algorithm 659: implementing Sobol's quasirandom sequence generator ACM Trans. Math. Software (TOMS) 29 49–57
Joe S and Kuo F Y (2008) Constructing Sobol sequences with better two-dimensional projections SIAM J. Sci. Comput. 30 2635–2654

5  Parameters

1:     GENID – INTEGERInput
On entry: must identify the quasi-random generator to use.
Sobol generator.
Sobol (A659) generator.
Niederreiter generator.
Faure generator.
Constraint: GENID=1, 2, 3 or 4.
2:     IDIM – INTEGERInput
On entry: the number of dimensions required.
  • if GENID=1, 1IDIM10000;
  • if GENID=2, 1IDIM1111;
  • if GENID=3, 1IDIM318;
  • if GENID=4, 1IDIM40.
3:     IREF(LIREF) – INTEGER arrayCommunication Array
On exit: contains initialization information for use by the generator routines G05YJF, G05YKF and G05YMF. IREF must not be altered in any way between initialization and calls of the generator routines.
4:     LIREF – INTEGERInput
On entry: the dimension of the array IREF as declared in the (sub)program from which G05YLF is called.
  • if GENID=1, 2 or 3, LIREF32×IDIM+7;
  • if GENID=4, LIREF407.
5:     ISKIP – INTEGERInput
On entry: the number of terms of the sequence to skip on initialization for the Sobol and Niederreiter generators. If GENID=4, ISKIP is ignored.
Constraint: if GENID=1, 2 or 3, 0ISKIP230.
6:     IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to 0, -1​ or ​1. If you are unfamiliar with this parameter you should refer to Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value -1​ or ​1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is 0. When the value -1​ or ​1 is used it is essential to test the value of IFAIL on exit.
On exit: IFAIL=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6  Error Indicators and Warnings

If on entry IFAIL=0 or -1, explanatory error messages are output on the current error message unit (as defined by X04AAF).
Errors or warnings detected by the routine:
On entry,GENID<1,
On entry,IDIM<1,
orIDIM is too large.
On entry, LIREF is too small.
The value of ISKIP<0 or ISKIP is too large.

7  Accuracy

Not applicable.

8  Further Comments

The primitive polynomials and direction numbers used for the Sobol generator (GENID=1) were calculated by Joe and Kuo (2008) using the search critera D6.

9  Example

See Section 9 in G05YMF.

G05YLF (PDF version)
G05 Chapter Contents
G05 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2012