nag_rand_quasi_lognormal (g05yk) generates a quasi-random sequence from a log-normal 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_lognormal (g05yk) generates a quasi-random sequence from a log-normal distribution by first generating a uniform quasi-random sequence which is then transformed into a log-normal sequence using the exponential of 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:
- 1:
– double array
-
Specifies, for each dimension, the mean of the underlying Normal distribution.
Constraint:
, for .
- 2:
– double array
-
Specifies, for each dimension, the standard deviation of the underlying Normal distribution.
Constraint:
, for .
- 3:
– int64int32nag_int scalar
-
The number of quasi-random numbers required.
Constraint:
and .
- 4:
– int64int32nag_int array
-
Contains information on the current state of the sequence.
None.
Not applicable.
None.
This example calls
nag_rand_quasi_init (g05yl) to initialize the generator and then
nag_rand_quasi_lognormal (g05yk) to produce a sequence of five four-dimensional quasi-random numbers variates.
function g05yk_example
fprintf('g05yk 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] = g05yk( ...
xmean, std, n, iref);
disp('Variates');
disp(quasi);