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

Home » Public Forums » archive » RANDOMU bug (and HTML help)
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: RANDOMU bug (and HTML help) [message #14422 is a reply to message #14330] Mon, 22 February 1999 00:00 Go to previous messageGo to previous message
ajschmitt is currently offline  ajschmitt
Messages: 2
Registered: February 1999
Junior Member
In article <21FEB199900213357@stars.gsfc.nasa.gov>,
landsman@stars.gsfc.nasa.gov (Wayne Landsman) wrote:
> Versions 5.1.1 and 5.2 of IDL have a bug in the RANDOMU (and RANDOMN) function
> such that the SEED variable is initialized to the same value at the start of
> each session, rather than being intialized by the system clock (see example
> below). I believe that so long as one as one stays within one IDL session
> that this causes no problems, but if one is, say, combining Monte Carlo
> simulations from different IDL sessions, then the results will be decidedly
> unrandom.
>
> RSI knows about this problem and say that they are giving it very high
> priority for a fix.
>
This is not the worst of it. For some of us, it is important to be able
to have the same seed so that the same "random" sequence is produced.
However, RSI quietly changed the manner in which the SEED variable
interacts with the RANDOM functions between version 5.0 & 5.1.

Consider the following behavior from IDL v 5..0.3:
IDL> seed = 2 & print, randomu(seed, 3)
0.342299 0.402381 0.307838
...doing this multiple times will always give the same result.

However, in IDL v.5..1 & later,. using this several times in a row
produces different results each time.:
IDL> seed = 2 & print, randomu(seed, 3)
0.0594004 0.982075 0.358593
IDL> seed = 2 & print, randomu(seed, 3)
0.831999 0.303037 0.506712

...etcetera. It turns out that you now have to specify a NEGATIVE seed
in order for it to have any influence on the generated sequence:

seed = -2 & print, randomu(seed, 3)
0.342299 0.402381 0.307838
seed = -2 & print, randomu(seed, 3)
0.342299 0.402381 0.307838

I assume that RSI knows about this (since it's documented in the new online
help file), but they didn't see fit to mention it in the release notes
accompanying version 5.1. Whatever reason they may have had for changing
this behavior (which has been working the previous way since IDL version 1.0
at least 14 years ago) I cannot fathom. (Is there some reason someone would
bother to set the seed only to have it be ignored by the random functions???)

This new "feature" caused one of my coworkers to waste more than a day
of his time tracking down the poorly documented change. Needless to say,
we are not very satisfied with RSI about this.

-Andy Schmitt

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL Insight bug when plotting horizontal lines?
Next Topic: Re: beginners plotting question

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

Current Time: Sat Oct 11 05:06:15 PDT 2025

Total time taken to generate the page: 0.64503 seconds