swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WARNING on Numerical Recipes in C -- and RNG's in general


From: Rick Riolo
Subject: Re: WARNING on Numerical Recipes in C -- and RNG's in general
Date: Mon, 12 Jul 1999 06:31:22 -0400 (EDT)

I don't know about the specific example Doug mentions, but the
problem may be deeper than just a problem with a RNG specified
in NRC.   Check out

Monte Carlo Simulations: Hidden Errors from 'Good' Random Number
Generators.
  Ferrenberg, Alan M., Landau, D.P., and Wong, Y.Joanna.
  Physical Review Letters 69(23).   Dec 1992.
  See also News and Views in Nature Vol 372, 1 Dec 1994.

In this paper they show how they got bad results with 
well known, well tested "good" RNG's and got better results
with RNGs with know statistical weaknesses!
(They knew good from bad because for low dimensionality they
could calculate analytically the expected results.)

So...I take the moral of the story to be:
  Be sure there is not some unfortunate interaction
  between the dynamics of your model and the dynamics
  of your RNG (no matter how "good" or well tested
  the RNG is supposed to be).

- r

Rick Riolo                           address@hidden
Center for Study of Complex Systems (CSCS)
4477 Randall Lab                
University of Michigan         Ann Arbor MI 48109-1120
Phone: 734 763 3323                  Fax: 734 763 9267
http://www.pscs.umich.edu/PEOPLE/rlr-home.html

On Fri, 9 Jul 1999, donalson wrote:

> Date: Fri, 09 Jul 1999 16:13:17 -0700
> From: donalson <address@hidden>
> Reply-To: address@hidden
> To: address@hidden
> Subject: WARNING on Numerical Recipes in C
> 
> I have come upon two instances where there were major errors caused by using
> Numerical Recipies.  The first occurance was when a post-doc in mathmatical
> ecology
> was getting strange results from from the same simulation but using different
> loop structures.
> After a fair amount of discussion I suggested that he try another generator,
> even something
> as simple as RAND() to see what happened.  Because the generator he was using
> was from
> such a respected source, he was very resistent but eventually agreed to try
> it.  The
> problem went away.
> 
> Last month an almost idential situation happened, this time with a
> physics/mathmatical ecology
> doctoral student.  Given that there was no apparent reason for the simualtion
> behavior, I suggested
> she try, (for test purposes only) RAND().  One again, the anomalies
> disappeared.
> 
> There are obviously potentially serious problems with some of the RNG
> algorithms in
> Numerical Recipies, I don't know where they stem from nor which generators
> were
> involved.  I do know that both individuals involved are very competent
> programmers
> and mathematicians, so the likelyhood of programming error on their part is
> very low.
> 
> Moral of the story, run a good set of tests (Swen has provided references for
> a bunch
> of them in the swarm docs) before you depend on a generator from this
> reference.
> 
> D3
> 
> --
> *********************************************************************
> * Doug Donalson                 Office: (805) 893-2962
> * Ecology, Evolution,           Home:   (805) 961-4447
> * and Marine Biology            email address@hidden
> * UC Santa Barbara
> * Santa Barbara Ca. 93106
> *********************************************************************
> *
> *   The most exciting phrase to hear in science, the one that
> *   heralds new discoveries, is not "EUREKA" (I have found it) but
> *   "That's funny ...?"
> *
> *       Isaac Asimov
> *
> *********************************************************************
> 
> 
> 
>                   ==================================
>    Swarm-Support is for discussion of the technical details of the day
>    to day usage of Swarm.  For list administration needs (esp.
>    [un]subscribing), please send a message to <address@hidden>
>    with "help" in the body of the message.
> 
> 


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]