nag_quasi_rand_normal (g05yjc) generates a quasi-random sequence from a Normal (Gaussian) distribution. It must be preceded by a call to one of the initialization functions
nag_quasi_init (g05ylc) or
nag_quasi_init_scrambled (g05ync).
nag_quasi_rand_normal (g05yjc) generates a quasi-random sequence from a Normal distribution by first generating a uniform quasi-random sequence which is then transformed into a Normal sequence using the inverse of the Normal CDF. The type of uniform sequence used depends on the initialization function called and can include the low-discrepancy sequences proposed by Sobol, Faure or Niederreiter. If the initialization function
nag_quasi_init_scrambled (g05ync) was used then the underlying uniform sequence is first scrambled prior to being transformed (see
Section 3 in nag_quasi_init_scrambled (g05ync) for details).
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
Wichura (1988) Algorithm AS 241: the percentage points of the Normal distribution Appl. Statist. 37 477–484
Note: the following variables are used in the parameter descriptions:
- 1:
order – Nag_OrderTypeInput
-
On entry: the
order argument specifies the two-dimensional storage scheme being used, i.e., row-major ordering or column-major ordering. C language defined storage is specified by
. See
Section 3.2.1.3 in the Essential Introduction for a more detailed explanation of the use of this argument.
Constraint:
or Nag_ColMajor.
- 2:
xmean[] – const doubleInput
On entry: specifies, for each dimension, the mean of the
Normal distribution.
- 3:
std[] – const doubleInput
On entry: specifies, for each dimension, the standard deviation of the
Normal distribution.
Constraint:
, for .
- 4:
n – IntegerInput
-
On entry:
the number of quasi-random numbers required.
Constraint:
and
.
- 5:
quas[] – doubleOutput
-
Note: the dimension,
dim, of the array
quas
must be at least
- when ;
- when .
Where
appears in this document, it refers to the array element
- when ;
- when .
On exit: contains the
n quasi-random numbers of dimension
idim,
holds the
th value for the
th dimension.
- 6:
pdquas – IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
quas.
Constraints:
- if ,
;
- if , .
- 7:
iref[] – IntegerCommunication Array
On entry: contains information on the current state of the sequence.
On exit: contains updated information on the state of the sequence.
- 8:
fail – NagError *Input/Output
-
The NAG error argument (see
Section 3.6 in the Essential Introduction).
Not applicable.
None.
This example calls
nag_quasi_init (g05ylc) to initialize the generator and then nag_quasi_rand_normal (g05yjc) to generate a sequence of five four-dimensional variates.
None.