help-octave
[Top][All Lists]
Advanced

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

Re: Same sequence of random number generators than under Matlab?


From: Adam Dershowitz
Subject: Re: Same sequence of random number generators than under Matlab?
Date: Sun, 03 Jun 2012 09:20:59 -0700

Another option is to write some code to generate your own pseudo random sequence then use the same code on both.
There are plenty of algorithms out there if you look around.

--Adam

Doug Stewart <address@hidden> wrote:



On Sun, Jun 3, 2012 at 10:03 AM, Mathieu Dubois <address@hidden> wrote:
Hello,

I want to comapre the output of the Self-Organinzin Map algorithm under Matlab and Octave.

The algorithm is stochastic because, as in most training algorithm, the data are presented inrandom order.
In order to compare as precisely as possible the Matlab and Octave version it seems necessary to have the same sequence of random numbers.

Is there a way to do that?

I have tried the following:
rand('twister', 10);
s = rand(10, 1);
disp(s);
disp(mean(s));
disp(var(s));

The sequences are different (but the statistics are close).

Mathieu


_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave


I believe that the only way to do this is to generate a sequence of random numbers with one system (octave) and then store these to a file. Then use this file of numbers for both systems, this will give you exactly the same numbers for your test.

--
DAS

https://linuxcounter.net/user/206392.html

reply via email to

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