Difference between Matlab and Octave in random seeding
pbellec
pbellec at bic.mni.mcgill.ca
Sat Mar 8 08:18:38 CST 2008
John W. Eaton wrote:
>
> On 7-Mar-2008, pbellec wrote:
>
> | Well, then it would certainly be better to have rand('state',S) reset
> the
> | state of all RNGs as was suggested by Michael.
>
> I don't see why. I don't see anything that says the generators must
> be based on the same algorithm, so it might not even be possible for
> them to share the same state.
>
> jwe
> _______________________________________________
> Bug-octave mailing list
> Bug-octave at octave.org
> https://www.cae.wisc.edu/mailman/listinfo/bug-octave
>
>
I get your point. However, in matlab, help messages for rand* functions are
confusing. The help of rand says something as "You can query the state of
the random number generator using...", while the help of randn says "The
sequence of numbers generated is determined by the state of the
generator...". This can give the false idea that there is such a thing as a
single underlying "random number generator" whose state would impact both
randn and rand. My comment would simply be to make sure that the help of
octave is a bit more explicit than the help of matlab regarding the state of
generators, e.g.:
"You can query the state of the UNIFORM random number generator using..."
and
"The sequence of numbers generated is determined by the state of the NORMAL
generator..."
and maybe add a warning :
"Please note that the states of the uniform, normal, exponential and gamma
random number generators are independent."
--
View this message in context: http://www.nabble.com/Difference-between-Matlab-and-Octave-in-random-seeding-tp15508096p15912898.html
Sent from the Octave - Bugs mailing list archive at Nabble.com.
More information about the Bug-octave
mailing list