|
From: Daniel J S. <dan...@ie...> - 2006-05-12 02:25:07
|
Hans-Bernhard Br=F6ker wrote:
>> gnuplot doesn't accept "rand()" as a command. (Perhaps it should.) =20
>=20
>=20
> If at all, that command would be "set random [.. some options ...]"
[snip]
> Since we make no promises whatsoever about the rand() algorithm,
Well, it depends. Here is what the gnuplot code says:
This is a transcription from Pascal to Fortran of routine
Uniform_01 from the paper
L'Ecuyer, P. and Cote, S. "Implementing a Random Number Package
with Splitting Facilities." ACM Transactions on Mathematical
Software, 17:98-111 (1991)
Now, as a means of verifying, I would assume the original author tested o=
ut some numbers against what the routine was producing as programmed else=
where, or listed in the paper perhaps.
If the algorithm is as stated in the paper and checks out, why not make t=
he promise, within the limites of GNU/freeware promises, that is?
> to=20
> "have a seed of 123" is quite completely meaningless anyway, so I reall=
y=20
> can't see what's there to worry about.
Setting the seed of a random number generator is meaningless? Then why h=
ave the capability? The obvious use is to verify an algorithm or plot ag=
ainst some other result elsewhere. Researchers do that sort of thing qui=
te a bit, I would think. Cryptography perhaps being an example? Here's =
something going back to the days of Atari about setting the seed the same=
as your friends:
http://www.atarimagazines.com/creative/v9n5/178_Basic_cryptography_SBOEP.=
php
Say we wanted "all.dem" to produce the same exact plots no matter how it =
was run. We might reseed the PRNG at the beginning of the all.dem file.
I, for one, would be quite=20
> surprised by a PRNG that returned the seed I set as the next random=20
> number, instead of using it to replace the state that the previous call=
=20
> left the PRNG in.
No, the seed and what the PRNG return are two different things. My issue=
is that, yes, the gnuplot PRNG is replacing the state of the PRNG but th=
en it immediately generates a random number that *can't be used*. Is tha=
t how C64 and IBM BASIC worked? I.e.,
unused =3D rand(678)
does not set the seed to 678. It sets it to whatever the seed is that fo=
llows 678.
splot unused=3Drand(123), "data", invnorm(rand(0))
doesn't solve that issue.
> rand(123) is a *function*, not a command, and I'm=20
> going to have to insist that it stays that way.
That's fine. The syntax you suggest above would be preferred, i.e., "set=
seed 789765" or something.
Dan
|