[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #42557] rand seed for twister algorithm differ
From: |
anonymous |
Subject: |
[Octave-bug-tracker] [bug #42557] rand seed for twister algorithm differs from Matlab |
Date: |
Thu, 19 Nov 2015 14:04:17 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko |
Follow-up Comment #5, bug #42557 (project octave):
This doesn't seem to hold for randn, tried with
Octave 4.0.0:
>> randn('twister', twister_seed(5489));
>> randn(1,5)
ans =
1.362259 0.071959 0.203598 -0.096973 1.324298
Matlab R2015a:
>> rng(5489, 'twister');
>> randn(1,5)
ans =
0.5377 1.8339 -2.2588 0.8622 0.3188
Also tried flipping the last state vector value as decribed (in both Matlab
and Octave), randn still produces different streams.
Matlab also seems to use the Ziggurat method, so can't figure out where the
difference is.
>> RandStream.getGlobalStream
ans =
mt19937ar random stream (current global stream)
Seed: 5489
NormalTransform: Ziggurat
Oddly enough, Matlab always seems to produce the same randn sequence no matter
what the seed number is, i.e. rng(0, 'twister') and rng(5489, 'twister')
generate the same 625 state vector when queried with s = rng
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?42557>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #42557] rand seed for twister algorithm differs from Matlab,
anonymous <=