Thread Subject: Increase randomness of matlab

Subject: Increase randomness of matlab

From: sun

Date: 10 Jul, 2009 12:39:29

Message: 1 of 4

Dear matlab gurus,

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.

Thank you in advance.

Subject: Increase randomness of matlab

From: Rune Allnor

Date: 10 Jul, 2009 12:48:30

Message: 2 of 4

On 10 Jul, 14:39, "sun" <s...@gmail.com> wrote:

> I am not sure if this question is relevant. Are there any programming tips
> to increase the randomness of matlab?

Check the documentation of RAND and RANDN for methods
to choose random number generators.

Rune

Subject: Increase randomness of matlab

From: tpl@eng.cam.ac.uk (Tim Love)

Date: 10 Jul, 2009 12:53:37

Message: 3 of 4

"sun" <sun@gmail.com> writes:

>Dear matlab gurus,

>I am not sure if this question is relevant. Are there any programming tips
>to increase the randomness of matlab?
I'm not sure what you mean, but in any case you need to read the
documentation carefully. The Statistics toolbox and Matlab Central have
further facilites, or you can raid more general computing literature.
 

Subject: Increase randomness of matlab

From: Peter Perkins

Date: 10 Jul, 2009 13:38:30

Message: 4 of 4

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.

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com