Path: news.mathworks.com!not-for-mail
From: Peter Perkins <Peter.PerkinsRemoveThis@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: recovering the jth state of the random number generator
Date: Tue, 09 Sep 2008 10:30:40 -0400
Organization: The MathWorks, Inc.
Lines: 16
Message-ID: <ga61ag$1lt$1@fred.mathworks.com>
References: <g9sh0d$pra$1@fred.mathworks.com> <MCkwk.148759$nD.29247@pd7urf1no> <g9une6$lfl$1@fred.mathworks.com>
NNTP-Posting-Host: perkinsp.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: fred.mathworks.com 1220970640 1725 172.31.57.88 (9 Sep 2008 14:30:40 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 9 Sep 2008 14:30:40 +0000 (UTC)
User-Agent: Thunderbird 2.0.0.16 (Windows/20080708)
In-Reply-To: <g9une6$lfl$1@fred.mathworks.com>
Xref: news.mathworks.com comp.soft-sys.matlab:489378



Tudor wrote:

> How about if i 'seed' the rand function at each iteration ?:
> 
> for i = 1:90000
> 
> rand ('state', i);
> randmonoisematrix = rand (45, 45);
> 
> end

Tudor, I recommend not doing that.  Some people try to do that each time they generate a single value, and that's definitely a bad idea, because the statistical properties of the generator are completely destroyed.  Reseeding each time you generate a 45x45 matrix isn't quite as bad, but still ...

What you're looking for is often called substreams.

If you have access to the MATLAB prerelease, I recommend looking at that.