[R] runif (and other generator) "precision" / man pages

John C Nash nashjc at uottawa.ca
Sat Jan 3 16:54:04 CET 2009


I'm inclined to agree with the view that the "precision" of a generator 
should be highlighted better in the manual pages. When I do

?runif

I don't see a mention, but ?.Random.seed DOES give the info, as Duncan 
points out, and it is suggested to look there.

A 1-liner with each random number generator

"CAUTION: random number generators use different mechanisms and provide 
different properties of output that may not match your expectations, 
e.g., precision and periodicity. Do read details (... reference here ... 
) if they may be important to you."

could be helpful to folk who are not familiar with the subject.

An important underlying issue with RNGs is that "precision" -- really 
size of the underlying integer process -- can be highly relevant if we 
use them to build multivariate "random" vectors. This is apparently not 
"well known". I've once had a paper turned down by a respected journal 
because the referees thought "more than 32 bits was idiotic". The same 
journal published some similar work 15 years later because "existing 
generators were only 32 bits". Sigh. At least it wasn't our generator, 
which is actually a 10^30 period decimal one, implemented on quite an 
array of systems / languages, and we had a program generator to build 
Fortran, BASIC, Pascal and C "versions" for particular platforms.

JN




More information about the R-help mailing list