Date: Thu, 11 Jul 1996 14:48:11 +0100
Reply-To: John Whittington <johnw@MAG-NET.CO.UK>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: John Whittington <johnw@MAG-NET.CO.UK>
Subject: Re: Changing seed in macro.
On Thu, 11 Jul 1996, Hans-Peter Piepho <piepho@WIZ.UNI-KASSEL.DE> wrote:
>What the original poster needs, is a way to store the value of seed after
>the first call and feed that figure into the random number generator at the
>next call, etc..
Han-Peter, I may be wrong, but my understanding of the original question was
that a series of 100 'runs' (one imagines some sort of simulation) were to
be undertaken, with a different random seed for each run - but that it was
desired to be able to re-run the whole exercise (i.e. all 100 'runs') to
produce identical results (i.e. all 100 seeds the same as before).
This being the case, one would obviously need to generate 100 different
seeds - either in a reproducible fashion or, at least, with storage of those
100 seeds for re-use. The simplest approach, as previously suggested, would
seem to be to use a random generator function (e.g. UNIFORM) to produce the
100 seeds for the 'main' random number generation. Then, provided the seed
for the UNIFORM (or whatever) generation remained unchanged, the same series
of 100 seeds for the other random function would be the same every time the
programme was run.
.. or maybe I am misunderstanding the problem which was posed!
As a passing comment, I have learned by bitter experience that using
'unknown' seeds (e.g. time-related) is a disasterous procedure. No matter
how unlikely one thinks that one will 'never' want to run the program again,
unexpected reasons for wanting to do this often arise. Hence, if run-time
generation of seeds is utilised, it really is highly advisable to ascertain
and store the value of the seed which was used - i.e. don't let the random
generator function just 'chose its seed' based on the clock, but rather
assign a value to a variable (based on the clock or whatever), then use this
variable as the SEED *and* store the value of that variable somewhere.
John
-----------------------------------------------------------
Dr John Whittington, Voice: +44 1296 730225
Mediscience Services Fax: +44 1296 738893
Twyford Manor, Twyford, E-mail: johnw@mag-net.co.uk
Buckingham MK18 4EL, UK CompuServe: 100517,3677
-----------------------------------------------------------
|