NAG Library Routine Document
G05YLF
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.
1 Purpose
2 Specification
INTEGER
GENID, IDIM, IREF(LIREF), LIREF, ISKIP, IFAIL
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
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:
, , or .
- 2: IDIM – INTEGERInput
On entry: the number of dimensions required.
Constraints:
- if , ;
- if , ;
- if , ;
- if , .
- 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.
Constraints:
- if , or , ;
- if , .
- 5: ISKIP – INTEGERInput
On entry: the number of terms of the sequence to skip on initialization for the Sobol and Niederreiter generators. If
,
ISKIP is ignored.
Constraint:
if , or , .
- 6: IFAIL – INTEGERInput/Output
-
On entry:
IFAIL must be set to
,
. 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
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is
.
When the value is used it is essential to test the value of IFAIL on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
6 Error Indicators and Warnings
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
Errors or warnings detected by the routine:
On entry, ,
or .
On entry, ,
On entry,
LIREF is too small.
The value of
or
ISKIP is too large.
7 Accuracy
Not applicable.
The primitive polynomials and direction numbers used for the Sobol generator (
) were calculated by
Joe and Kuo (2008) using the search critera
.
9 Example