help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

rand("state")


From: Mike Miller
Subject: rand("state")
Date: Wed, 15 Feb 2006 12:32:22 -0600 (CST)

On my system, rand("state"), using Octave-Forge rand.oct, returns a row vector of 625 integers. (By the way, the "help rand" doc says that it is a column vector.) The interesting thing is that the integers seem to be uniformly distributed with a max of about 2^32, but the 625th integer seems to be different from the others with a mean somewhere around 300 or so. What is rand("state")(625) doing?

I'm interested in this because I want to do a simulation project with 100 seeds and I want to choose the seeds before I start so that the whole simulation of 100 replicates can be duplicated later. I was thinking that maybe this would make a good set of seeds for me:

stored_seeds = ceil( rand( 100, 625 ) * 2^32 );

I could then store the seeds in a file and import them as needed. Then I would do this at the beginning of a replicate:

rand ("state", stored_seeds( rep, : ) )

Where "rep" is a scalar holding the replicate number.

At this point, it all looks right to me except for the 625th integer in each seed.

Thanks in advance for any tips on this.

Mike



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]