nag_rand_quasi_normal (g05yj) generates a quasi-random sequence from a Normal (Gaussian) distribution. It must be preceded by a call to one of the initialization functions
nag_rand_quasi_init (g05yl) or
nag_rand_quasi_init_scrambled (g05yn).
nag_rand_quasi_normal (g05yj) 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_rand_quasi_init_scrambled (g05yn) was used then the underlying uniform sequence is first scrambled prior to being transformed (see
Description in
nag_rand_quasi_init_scrambled (g05yn) 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:
None.
Not applicable.
None.
This example calls
nag_rand_quasi_init (g05yl) to initialize the generator and then
nag_rand_quasi_normal (g05yj) to generate a sequence of five four-dimensional variates.
function g05yj_example
fprintf('g05yj example results\n\n');
iskip = int64(1000);
idim = int64(4);
genid = int64(1);
[iref, ifail] = g05yl( ...
genid,idim,iskip);
n = int64(5);
xmean = [1; 2; 3; 4];
std = [1; 1; 1; 1];
[quasi, iref, ifail] = g05yj( ...
xmean, std, n, iref);
disp('Variates');
disp(quasi);