|
sun wrote:
> I am not sure if this question is relevant. Are there any programming tips
> to increase the randomness of matlab?
>
> Probably the fault lies with me. I am seeing simulated results that made me
> suspect the true independence of the random events. But just to be sure to
> allay my suspicion.
This isn't much to go on. What's the context?
On the simplest level,
>> help rand
[snip]
The sequence of numbers produced by RAND is determined by the internal
state of the uniform pseudorandom number generator that underlies RAND,
RANDI, and RANDN. Control that default random number stream using its
properties and methods. See RANDSTREAM for details about the default
stream.
Resetting the default stream to the same fixed state allows computations
to be repeated. Setting the stream to different states leads to unique
computations, however, it does not improve any statistical properties.
Since MATLAB uses the same state each time it starts up, RAND, RANDN, and
RANDI will generate the same sequence of numbers in each session unless
the state is changed.
On a more complicated level, you might start here:
<http://blogs.mathworks.com/loren/2008/11/13/new-ways-with-random-numbers-part-ii>
Hope this helps.
|