<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000099" bgcolor="#FFFFFF">
    <br>
    <div class="moz-cite-prefix">On 21-07-14 19:01, Markus Neteler
      wrote:<br>
    </div>
    <blockquote
cite="mid:CALFmHhtxW2+u74Zc0Hh2aka93CrPz4QayPddfwvN7wB81DtnbA@mail.gmail.com"
      type="cite">
      <pre wrap="">On Sun, Jul 6, 2014 at 12:25 AM, Glynn Clements
<a class="moz-txt-link-rfc2396E" href="mailto:glynn@gclements.plus.com"><glynn@gclements.plus.com></a> wrote:
</pre>
      <blockquote type="cite">
        <blockquote type="cite">
          <pre wrap="">Glynn Clements <a class="moz-txt-link-rfc2396E" href="mailto:glynn@gclements.plus.com"><glynn@gclements.plus.com></a> wrote:
</pre>
        </blockquote>
      </blockquote>
      <pre wrap="">...
</pre>
      <blockquote type="cite">
        <pre wrap="">In ticket #2272, I attached a portable implementation of lrand48(). If
desired, we could add this to libgis and use that in preference to any
implementation-specific PRNG.
</pre>
      </blockquote>
      <pre wrap="">
This would be excellent.

</pre>
      <blockquote type="cite">
        <blockquote type="cite">
          <blockquote type="cite">
            <pre wrap="">If you want a different result each time, set GRASS_RND_SEED to a
different value each time, e.g.
</pre>
          </blockquote>
        </blockquote>
      </blockquote>
      <pre wrap="">
IMHO this is not intuitive at all. I would suggest to invert the
behaviour for GRASS 7:
- per default generate random numbers which differ,
- if the user needs reproducability, then have a env var to enable that.

</pre>
      <blockquote type="cite">
        <pre wrap="">The main thing is that I believe that
reproducibility should be the default.
</pre>
      </blockquote>
      <pre wrap="">
I humbly disagree. This is not what the user expects. It is also the
opposite of how for example R behaves:

R
</pre>
      <blockquote type="cite">
        <pre wrap="">runif(1)
</pre>
      </blockquote>
      <pre wrap="">[1] 0.5624295
</pre>
      <blockquote type="cite">
        <pre wrap="">runif(1)
</pre>
      </blockquote>
      <pre wrap="">[1] 0.1683853

<a class="moz-txt-link-freetext" href="http://en.wikibooks.org/wiki/R_Programming/Random_Number_Generation#Seed">http://en.wikibooks.org/wiki/R_Programming/Random_Number_Generation#Seed</a>
" If you want to perform an exact replication of your program, you
have to specify the seed using the function set.seed()."

</pre>
      <blockquote type="cite">
        <pre wrap="">If people have to take explicit
action to introduce randomness,
</pre>
      </blockquote>
      <pre wrap="">
The problem is that most will not even realize the current behaviour of rand().

</pre>
    </blockquote>
    <blockquote
cite="mid:CALFmHhtxW2+u74Zc0Hh2aka93CrPz4QayPddfwvN7wB81DtnbA@mail.gmail.com"
      type="cite">
      <blockquote type="cite">
        <pre wrap="">they're more likely to consider the
issues involved. If randomised seeds are the default, the lack of
reproducibility may not be considered until it is too late.
</pre>
      </blockquote>
      <pre wrap="">
The R community (and some users here) think the opposite... when you
ask for rand() then you expect a random number. </pre>
    </blockquote>
    And not only the R community I am sure. In all statistical packages
    I have ever worked with  one can see the same behaviour, a random
    number is random (i.e., each time a different seed), unless the seed
    is explicitly defined by the user. And it seems to be the default
    behaviour by python/numpy:<br>
    <br>
    >>> import numpy as np<br>
    >>> np.random.random()<br>
    0.8351426142559701<br>
    >>> np.random.random()<br>
    0.4813823441998394<br>
    >>> np.random.random()<br>
    0.7279314267025369<br>
    <br>
    <blockquote
cite="mid:CALFmHhtxW2+u74Zc0Hh2aka93CrPz4QayPddfwvN7wB81DtnbA@mail.gmail.com"
      type="cite">
      <pre wrap="">Just to avoid this:
<a class="moz-txt-link-freetext" href="https://xkcd.com/221/">https://xkcd.com/221/</a>

Markus
</pre>
    </blockquote>
    <br>
  </body>
</html>