Skip to content
Prev 42337 / 398500 Next

floor of n observations in number generators

I couldnt find a previous posting on this in the archives, maybe it has
already been mentioned.

If you use a calculation to generate n observations in random number
generators and you don't round to the nearest integer you may be
generating n-1 numbers not n numbers as you thought depending on the
storage precision of the calculation. 

e.g.
[1] 99  # Should be 100
[1] 99.99999999999997
[1] FALSE

Random number generation generates the floor of n observations, this
feature occurs on R-1.8.1 on linux Redhat8, and winXP (also on Unix
SPlus 3.4) 
for probably all of the random number generators.

e.g.
[1] 99
[1] 99
[1] 99
[1] 99
[1] 99


marcus

Marcus Davy
Bioinformatics


______________________________________________________
The contents of this e-mail are privileged and/or confidenti...{{dropped}}