nag_random_continuous_uniform (g05cac) returns a pseudorandom number taken from a uniform distribution between 0 and 1.
nag_random_continuous_uniform (g05cac) returns the next pseudorandom number from the basic uniform (0,1) generator.
The basic generator uses a multiplicative congruential algorithm
The integer
${b}_{i+1}$ is divided by
${2}^{59}$ to yield a real value
$y$, which is guaranteed to satisfy
The value of
${b}_{i}$ is saved internally in the code. The initial value
${b}_{0}$ is set by default to
$123456789\times \left({2}^{32}+1\right)$, but the sequence may be re-initialized by a call to
nag_random_init_repeatable (g05cbc) for a repeatable sequence, or
nag_random_init_nonrepeatable (g05ccc) for a non-repeatable sequence.
None.
None.
Not applicable.
Its performance has been analysed by the Spectral Test (see Section 3.3.4 of
Knuth (1981)), yielding the following results in the notation of Knuth.
An informal interpretation of the quantities
${\nu}_{n}$ is that consecutive
$n$-tuples are statistically uncorrelated to an accuracy of
$1/{\nu}_{n}$. This is a theoretical result; in practice the degree of randomness is usually much greater than the above figures might support. More details are given in
Knuth (1981), and in the references cited therein.
Note that the achievable statistical independence drops rapidly as the number of dimensions increases. This is a property of all multiplicative congruential generators and is the reason why very long periods are needed even for samples of only a few random numbers.
The example program prints the first five pseudorandom numbers from a uniform distribution between 0 and 1, generated by nag_random_continuous_uniform (g05cac) after initialization by
nag_random_init_repeatable (g05cbc).
None.