|
NAG[g05cac] NAG[nag_random_continuous_uniform] - Pseudo-random real numbers, uniform distribution over (0,1)
|
|
Calling Sequence
g05cac()
nag_random_continuous_uniform(. . .)
Parameters
|
|
Description
|
|
|
Purpose
|
|
nag_random_continuous_uniform (g05cac) returns a pseudo-random number taken from a uniform distribution between 0 and 1.
|
|
Description
|
|
nag_random_continuous_uniform (g05cac) returns the next pseudo-random number from the basic uniform (0,1) generator.
The basic generator uses a multiplicative congruential algorithm
The integer is divided by to yield a real value , which is guaranteed to satisfy
The value of is saved internally in the code. The initial value is set by default to , but the sequence may be re-initialized by a call to g05cbc (nag_random_init_repeatable) for a repeatable sequence, or g05ccc (nag_random_init_nonrepeatable) for a non-repeatable sequence.
|
|
Error Indicators and Warnings
|
|
|
|
Further Comments
|
|
The period of the basic generator is .
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.
The right-hand column gives an upper bound for the values of attainable by any multiplicative congruential generator working modulo .
An informal interpretation of the quantities is that consecutive -tuples are statistically uncorrelated to an accuracy of . 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.
|
|
|
Examples
|
|
>
|
NAG:-g05cbc(0):
NAG:-g05cac();
|
|
|
Download Help Document
Was this information helpful?