octave-maintainers
[Top][All Lists]
Advanced

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

Random data in demos and reproducibility


From: John W. Eaton
Subject: Random data in demos and reproducibility
Date: Tue, 14 Dec 2010 13:43:33 -0500

On 14-Dec-2010, Rik wrote:

| When trying to compare plots between gnuplot, FLTK, and Matlab recently I
| had a difficult time because the data was different for each plot.  For a
| particular example, see the stairs demo at
| http://octave.sourceforge.net/compare_plots/.  Would it be advisable to
| either use a fixed set of data embedded in the demo or save, initialize,
| and restore the random seed in order to get identical plots?  If yes, is
| there a preference for which approach to take?

We don't have precisely the same random number generator in Octave as
is in Matlab, do we?  So setting the seed will not give you the same
random sequence in Octave and Matlab.  If we want plots that look the
same, I think we have to embed fixed data in the demos instead of
generating it with rand.

| For the documentation plots produced by the scripts in doc/interpreter/*.m
| I had already taken the approach of initializing the random seed.  In this
| case there was no danger of disturbing a user's random stream and so I
| didn't have to bother with saving/restoring state.

I think it should be fine to keep these generated with a fixed seed
since we aren't trying to compare them with plots generated by Matlab.

jwe


reply via email to

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