R: The default method for generating from a discrete uniform distribution has been changed

#1

Not really about RStan, but R. For those who don’t read release notes, note that R 3.6.0 has changed the behavior of discrete uniform random number generation which may affect reproducability of results. From https://stat.ethz.ch/pipermail/r-announce/2019/000641.html

* The default method for generating from a discrete uniform
  distribution (used in sample(), for instance) has been changed.
  This addresses the fact, pointed out by Ottoboni and Stark, that
  the previous method made sample() noticeably non-uniform on large
  populations.  See PR#17494 for a discussion.  The previous method
  can be requested using RNGkind() or RNGversion() if necessary for
  reproduction of old results.  Thanks to Duncan Murdoch for
  contributing the patch and Gabe Becker for further assistance.

  The output of RNGkind() has been changed to also return the
  'kind' used by sample().

Ottoboni and Stark refers to this arxiv paper

4 Likes