[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #57564] Implementation of rng
From: |
Guillaume |
Subject: |
[Octave-bug-tracker] [bug #57564] Implementation of rng |
Date: |
Thu, 9 Jan 2020 10:03:34 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0 |
Follow-up Comment #1, bug #57564 (project octave):
* see also bug #54342 and bug #42557 for rand-related bug reports.
* meaning of seed 0 in Matlab:
https://uk.mathworks.com/matlabcentral/answers/28216-how-to-duplicate-rand-twister-0-in-current-matlab#answer_36510
* numpy can generate the same sequence of numbers for rand than Matlab:
https://stackoverflow.com/questions/3722138/is-it-possible-to-reproduce-randn-of-matlab-with-numpy?rq=1
https://github.com/numpy/numpy/blob/master/numpy/random/src/mt19937/mt19937.c
so the same could be achieved with Octave. For randn, Matlab seems to be using
one or more rand values, which means that it is likely implementing the
Ziggurat algorithm (and not the Marsaglia polar method or the Box–Muller
transform).
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?57564>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/