Re: randn & state
num wrote:
I have run 2 sets of 10000 realizations on different machines. Both
sets have the same analysis code. However, after the analysis is
completed, I got the same results. I thought that Matlab uses random
seeds (state) by default.
The help for RAND is pretty clear about this. The current version says,
The sequence of numbers produced by RAND is determined by the internal
state of the generator. Setting the generator to the same fixed state
allows computations to be repeated. Setting the generator to different
states leads to unique computations, however, it does not improve any
statistical properties. Since MATLAB resets the state at start-up, RAND
will generate the same sequence of numbers in each session unless the
state is changed.
and previous versions say something very similar.
Hope this helps.
- Peter Perkins
The MathWorks, Inc.
.
Relevant Pages
- Re: rand function question
... format long; rand ... Setting the generator to the same fixed state ... states leads to unique computations, however, it does not improve any ... Since MATLAB resets the state at start-up, ... (comp.soft-sys.matlab) - Re: Weird problem with fmincon on 2008b
... I am simulating a data generating process hence the use of randn. ... Everything goes well until I open up a second instance of Matlab 2008b (in ... Start one session of MATLAB and perform some operations involving RAND, ... pseudorandom number generator in the two sessions are not in the same state. ... (comp.soft-sys.matlab) - Re: Matlabs random number generator is suspicious... what to do?
... Are they ways that I can make Matlab's random number generator better? ... The cause of this as of yet unknown problem has to ... the default generator in MATLAB. ... different scaling method might make all the difference. ... (comp.soft-sys.matlab) - Re: strong nonrandom pattern in rand
... points you to a mex file on MATLAB Central, ... The current versions Matlab contain an internal Mersenne Twister and ... explicit request for 'twister' or 'seed', ... borrow generator is used. ... (comp.soft-sys.matlab) - Re: Matlabs random number generator is suspicious... what to do?
... results, and did not bother to reinitialize the random number generator, you ... Just because MATLAB by default ... Carlo simulations perform. ... The cause of this as of yet unknown problem has to ... (comp.soft-sys.matlab) |
|