MRTEST

Section: User Commands (1)
Updated: 5/28/93
Index Return to Main Contents
 

NAME

mrtest, mrtestv - test-driver for the mrandom() routines  

SYNOPSIS

mrtest [ nnn ] [ -dnnnn ] [ -S[n[,n ... ]] ] [ -mnnnnn ] [ -Mnn ] [ -q ] [ -t ] [ -e ] [ -f ] [ -v ] [ -p ]  

DESCRIPTION

mrtest generates random integers, using any one of several possible random number generation (RNG) algorithms, then tests these integers for ``randomness''.

 

OPTIONS

nnn
sets the number of random generates to be tested. Default is 10.
-dnnnn
discards nnnn generates between tested values. Default is 0.
-S[n[,n[,n[,n[,n]]]]] initializes an RNG, as follows:
The first parameter sets the RNG algorithm, default 1, as
0.
an additive linear scheme (for testing only);
1.
4.3bsd random;
2.
Knuth/Bentley prand();
3.
L'Ecuyer's portable combined multiplicative RNG;
4.
4.3bsd nrandom48;
5.
4.3bsd rand;
6.
Press and Teukolsky's ran0;
7.
Press and Teukolsky's ran1;
8.
Press and Teukolsky's ran2; and
9.
Maraglia's Ultra.
The second parameter sets the first RNG seed, default 1.
The third parameter sets the second RNG seed, default 1. Note that most RNG algorithms will ignore this value.
The fourth parameter sets the number of times to cycle the RNG before starting the tests, mod 1 billion. Default is 0.
The fifth parameter of -S sets the number of times to cycle the RNG before starting the tests, div 1 billion. Default is 0.
-mnnnnn
or -Mnn sets the range of the RNG to be nnnnn or 2^(nn), respectively. At most one of these two options should be selected. Default is -m100.
-q
or -quiet turns off the (default) printing of each random integer, as it is generated.
-t
eliminates most RNG tests, for timing measurements.
-e
echos the command line. Useful in scripts.
-f
or -p selects one of two non-default methods, other than mrandom(), for generating random integers. The -f option uses (int)(frandom()*m), which is slightly faster, but also slightly biased. The -p uses xrandom()%m to generate integers, a poor method for many RNGs.
-v
uses the vectorized interface, mrandomrv().

Note: the last three options are unavailable in the version of the code, mrtestv, compiled with -DVECTORIZED. In mrtestv, the mrandomrv() call is always used.

The script file supplied with the software distribution contains a number of csh-level calls to mrtest, illustrating its use as well as demonstrating various problems with the 4.3bsd random number generators rand() and nrand48().

 

AUTHOR

Clark Thomborson, cthombor@ub.d.umn.edu

 

DIAGNOSTICS

If error-checking code in init_rng, restart_rng, or save_rng discovers a problem, an error message is printed on the stderr stream.

 

SEE ALSO

random(3), rand(3C), drand48(3), mrandom(3)

 

BUGS

The estimated standard deviations are merely estimates, and not very accurate ones at that, especially on the upper tail. A better X-squared analysis routine would help.

 

THEORY

For more information on the X-squared analysis implemented in this code, see "Tools for Randomized Experimentation" by Clark Thomborson, to appear in the Proceedings of the 25th Symposium on the Interface: Computing Science and Statistics, 1993.


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
AUTHOR
DIAGNOSTICS
SEE ALSO
BUGS
THEORY

This document was created by man2html, using the manual pages.
Time: 10:55:03 GMT, December 12, 2024