Closed WardBrian closed 9 months ago
Their speculation was correct and the alternative is even easier.
I don't think its being a "low quality" RNG was ever an issue.
I don't think its being a "low quality" RNG was ever an issue.
Are you saying it is not worth changing at this point?
Sorry for being unclear---please change to solve the issues.
I just meant that the quality of the random numbers has never been an issue for us. The seed and other things are definitely an issue.
Summary:
The currently pRNG used by Stan has a few issues which have come up over the past year:
While tracking down the first, I opened https://github.com/boostorg/random/issues/92 which led to the following comments:
The recommendation was to use
boost::mixmax
instead. This does not offer fast discard, but we may not need it:Description:
There are a few places where the swap would need to happen:
src/stan/services/util/create_rng.hpp
- I think it would also be reasonable to create our own typedef for astan::rng_t
which we could then use in the remaining changessrc/stan/model/model_base.hpp
andsrc/stan/model/model_base_crtp.hpp
'swrite_array
methodscreate_rng
, so they would need to be updated with the newstan::rng_t
typeI did most of these changes in a now out-of-date branch after #3167: https://github.com/stan-dev/stan/compare/develop...experiment/mixmax-rng. There is also a corresponding stanc3 branch (very simple): https://github.com/stan-dev/stanc3/compare/master...experiment/mixmax-rng
Besides these relatively small changes, the primary barrier is the tests. A lot of our unit tests in this repo fix a seed and compare against hard-coded results. All of these would need updating and validating.
Current Version:
v2.34.0