Skip to content
Prev 5846 / 398506 Next

Needed: Understading runif() output :-)

On Thu, 25 May 2000, Kjetil Kjernsmo wrote:

            
Yes, they are all quantized (all to ca 2^-31 or 2^-32).  Reason: that's
all we can assume for integer arithmetic. That is perfectly
sufficient for a *stable* procedure for using them. As I said before, I
don't think the algorithm you have for making use of them is adequate.  
Now, you haven't actually told us how you are generating numbers from your
distribution (and you haven't actually defined the distribution precisely
enough so that I could program it), but I guess you are using inversion.  
Don't: it is not adequate for your purposes.  You want to make use of
several random numbers if you want behaviour in the far tail.
Alternatively, you could plug in a generator that had a lower quantization.

The moral is a familiar one: computer results are almost always
approximate, and you always have to watch out for the effects of the
approximations.