View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Jerry W. Lewis Jerry W. Lewis is offline
external usenet poster
 
Posts: 837
Default Random number generation

The Excel 2003 algorithm was published in Applied Statistics in 1982.
At the time it was state of the art, passing all standard tests for
randomness and providing a far longer period than any other congruential
generator that could be implemented in small word size.

In the 1990's, tests for random number generators became much more
stringent. Mersene Twister provides a far longer period and better
joint independence among sets of random numbers.

Jerry

OnceTall wrote:

Thank you Jerry and Tom.

Tom, I took a quick look at the poptools addin site. It says it is
free for non-commercial use. It's not impossible that I would sell my
sheet, so I don't want to go that route.

Jerry, I am still working my way through your links! I had looked at
the Mersenne Twister page before, but the implementations have so many
lines of code that I fear it will slow down my sims to a crawl. I
downloaded the NtRand freeware some time ago, but it looked to me that
it pops a bunch of random numbers into a table in Excel (30,000 at a
time?), and then I would have to cycle through the table and then
refresh it with another 30,000. That's not out of the question, but I
thought going back and forth into Excel from VBA would be slow. I was
hoping for something that I could use in VBA similar to the way RND is
used.

The link to Ian Smith's simple implementation in VBA of the "2003
algorithm" looks promising. It looks simple enough to be fast. Why
is it inferior to the Mersenne Twister? Is there a problem with the
degree of randomness? If so, how bad is it? (I'm guessing that's a
hard thing to quantify.)

btw, I'm only looking for a uniform distribution. (I don't need
normally distributed numbers).

Thanks again for the responses.

OnceTall