AMBER Archive (2009)

Subject: Re: [AMBER] use of random seed in multiple runs

From: Robert Duke (rduke_at_email.unc.edu)
Date: Fri Jun 05 2009 - 10:45:09 CDT


Well, that is true for a lot of prng's, and when I made the suggestion to
that effect, it was based on an article I read on prng's that predated the
publication of ranmar. For the ranmar generator we use, folks claim that
any seed is as good as any other seed (as long as > 0), and that the
sequences generated for sequential seeds are uncorrelated. Perhaps this is
true; I have seen published claims to this effect but have not seen the
definitive proof, but I have not read everything written on the subject
either. But Marsaglia probably knows about as much about the black art of
random number generation as anyone I would guess. So while there is
certainly no harm in picking seeds from large primes, you are probably okay
doing otherwise. The seed we use as a default sort of looks like it could
be prime, but actually isn't, (71277, which has one prime factor of 3 - I
did not completely factor it).
Regards - Bob
----- Original Message -----
From: "Naser Alijabbari" <na3m_at_virginia.edu>
To: "AMBER Mailing List" <amber_at_ambermd.org>
Sent: Friday, June 05, 2009 11:30 AM
Subject: Re: [AMBER] use of random seed in multiple runs

> Previously have read a discussion the archives that large prime numbers
> are
> better seeds ( http://archive.ambermd.org/200903/0336.html). Does anyone
> have any experience with using large prime numbers, and how large is large
> enough (for example ig=103577 vs ig =99999989 which the limit of ig
> variable). Don't prng do better using prime numbers?
>
> On Fri, Jun 5, 2009 at 10:45 AM, Robert Duke <rduke_at_email.unc.edu> wrote:
>
>> Hi Gustavo,
>> Oh, and if you say, even if the random number distribution generated with
>> a
>> -1 seed is statistically good, there remains the problem that with pmemd,
>> if
>> you stick in -1 as ig each run, you are correlating the heck out of your
>> runs, which we know is very bad. SO folks absolutely should NOT use ig
>> = -1
>> with pmemd through amber 10 unless they apply the informal patch I put up
>> on
>> the amber reflector yesterday. Everyone should note that random number
>> generation in sander and pmemd is intended to be, and is identical, aside
>> from this -1 seeding thing that was a new feature added to sander 10 that
>> I
>> unfortunately missed when working on pmemd 10. Also note, if you use -1
>> for
>> earlier versions of sander (<10), you are asking for trouble also. We
>> should really have implemented this very differently, with a different
>> flag
>> for time-based generation of the seed, and should have been checking for
>> out-of-range values of ig...
>> Regards - Bob
>> ----- Original Message ----- From: "Gustavo Seabra" <
>> gustavo.seabra_at_gmail.com>
>> To: "AMBER Mailing List" <amber_at_ambermd.org>
>> Sent: Friday, June 05, 2009 9:28 AM
>> Subject: Re: [AMBER] use of random seed in multiple runs
>>
>>
>> On Thu, Jun 4, 2009 at 10:31 AM, Robert Duke<rduke_at_email.unc.edu> wrote:
>>
>>> Well, I would not recommend doing that. It looks to me like there is
>>> nothing to stop one from doing this in the code, but the random number
>>> initialization code clearly states the seed should be > 0. I would have
>>> to
>>> dink with it to see what really happens when you do this.
>>> [...]
>>>
>>
>> Bob, please correct me if I'm wrong here but, looking at the
>> random.fpp file in pmemd/src dir, it lloks like the seed provided by
>> the amber input is used to generate two internal seeds, is1 and is2:
>>
>> =======================================================
>> data is1max, is2max /31328, 30081/
>>
>> ! Construct two internal seeds from single unbound Amber seed:
>> !
>> ! is1 and is2 are quotient and remainder of iseed/IS2MAX. We add
>> ! one to keep zero and one results from both mapping to one.
>> ! max and min functions keep is1 and is2 in required bounds.
>>
>> is1 = max((iseed / is2max) + 1, 1)
>> is1 = min(is1, is1max)
>>
>> is2 = max(1, mod(iseed, is2max) + 1)
>> is2 = min(is2, is2max)
>> ========================================================
>>
>> So, if you enter a seed of "-1", both is1 and is2 will end up being 1.
>> There's nothing "illegal" about that, but then you are again always
>> running your calculation with the same seeds.
>>
>> Gustavo.
>>
>> _______________________________________________
>> AMBER mailing list
>> AMBER_at_ambermd.org
>> http://lists.ambermd.org/mailman/listinfo/amber
>>
>>
>>
>> _______________________________________________
>> AMBER mailing list
>> AMBER_at_ambermd.org
>> http://lists.ambermd.org/mailman/listinfo/amber
>>
> _______________________________________________
> AMBER mailing list
> AMBER_at_ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber
>

_______________________________________________
AMBER mailing list
AMBER_at_ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber