naginterfaces.library.rand.quasi_init(genid, idim, iskip)[source]

quasi_init initializes a quasi-random generator prior to calling quasi_uniform(), quasi_normal() or quasi_lognormal().

For full information please refer to the NAG Library document for g05yl


Must identify the quasi-random generator to use.

Sobol generator.

Sobol (A659) generator.

Niederreiter generator.

Faure generator.


The number of dimensions required.


The number of terms of the sequence to skip on initialization for the Sobol and Niederreiter generators. If , is ignored.

commdict, communication object

Communication structure.

(errno )

On entry, .

Constraint: , , or .

(errno )

On entry, .

Constraint: .

(errno )

On entry, or is too large: , maximum value is .


quasi_init selects a quasi-random number generator through the input value of and initializes the [‘iref’] communication array for use by the functions quasi_uniform(), quasi_normal() or quasi_lognormal().

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.


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