comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: How good is Randomu?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: How good is Randomu? [message #57962 is a reply to message #57931] Fri, 04 January 2008 10:24 Go to previous messageGo to previous message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
I'm not a statistician, but as far as I can tell ran1 from NRC and thus
randomu have a period of ~10^9. This is very short and surprises me...
I guess that is why you can buy the IDL Analyst add on. More info on
ran1 (and thus randomu) is here:

http://www.nrbook.com/a/bookcpdf/c7-1.pdf


MATLAB's default generator is based on "Marsaglia's ziggurat algorithm"
with a period of 2^64. The paper and example C code are here:

http://www.jstatsoft.org/v05/i08

Whatever generator you choose, you'll going to want to code it up as a
DLM or be *very* patient. I think you'll run into a real bottleneck
generating all those random numbers in IDL. Looking at the ziggurat
code, it would be pretty easy to code it up as a DLM. I recommend Ronn
Kling's "Calling C/C++ from IDL" www.kilvarock.com.

-Rick


john.copley@nist.gov wrote:
> Many thanks to those of you who responded to my posting entitled "
> Bizarre (?) behavior of randomu". Your comments have been very useful.
>
> I now have a different question. How good is Randomu? I am developing
> some code to calculate multiple neutron scattering intensities and
> typically in any given run I would expect to invoke randomu (or some
> other IDL procedure that generates uniformly distributed pseudo-random
> numbers between 0 and 1) several hundred to several thousand times,
> each time obtaining of order 1 million numbers, in other words
> generating 10^9 or more random numbers in any given run. Is randomu up
> to the task, or do I need something better?
>
> If I need something better what should I use? I have come across
> exotica such as the "MT19937 generator of Makoto Matsumoto and Takuji
> Nishimura [which] is a variant of the twisted generalized feedback
> shift-register algorithm" and "has a Mersenne prime period of 2^19937
> - 1 (about 10^6000) and is equi-distributed in 623 dimensions" but
> that sounds like overkill. On the other hand the so-called Wichmann-
> Hill algorithm looks interesting and it is supposedly very easy to
> code.
>
> Thoughts, anyone?
> Many thanks
> John
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: FILE_SEARCH bug ?
Next Topic: Re: How to clean the memory?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 20:21:01 PDT 2025

Total time taken to generate the page: 3.20114 seconds