bugGNU Octave - Bugs: bug #33682, rand results are not repeatable

 
 

bug #33682: rand results are not repeatable

Submitted by:  None
Submitted on:  Thu 30 Jun 2011 08:06:27 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: Wont FixAssigned to: David Bateman <dbateman>
Originator Name: avigozOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.2.3
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 01 Jul 2011 08:39:42 PM UTC, comment #1:

No in fact with a monte carlo simulation you want to ensure that every simulation in a particular run is different. Imagine I do something like

and the post process the results into a monte carlo, which is pretty much what any monte carlo simulation on a cluster is going to do, but called many many more time. I want each and every version of myscript to start with a different random seed, which is what Octave does. Getting the same behavior in matlab is a pain in the arse as you have to generate the entropy source for the random seed some how (something that Octave does for you). The inverse however, in the rare case that you want the same random seed is easy to deal with, just change your code to something like

You can even add the line

to your .octaverc file and get this as the default behavior. However, I'd resist making this the default for all users behavior as the workaround is trivial and this feature is extremely useful. I'm marking this bug as "Won't Fix". Sorry this is one case where the "bug" is in in matlab[1]

D.

[1] http://www.gnu.org/software/octave/FAQ.html#index-Compatibility-with-_0040sc_007bMatlab_007d-38

David Bateman <dbateman>
Project MemberIn charge of this item.
Thu 30 Jun 2011 08:06:27 PM UTC, original submission:

It is necessary that rand will begin with the same number every time octave is opened, since the user has to be able to repeat his run with the same result every time (this is specifically critical for monte carlo simulations). this is the default in matlab, and can only be achieved by seeding the algo in octave. for example:

should return the same sequence every time octave is opened.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jordigh (Updated the item)
  • -unavailable- added by dbateman (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 04 Jul 2011 05:27:46 PM UTCjordighOpen/ClosedOpen=>Closed
    Fri 01 Jul 2011 08:39:42 PM UTCdbatemanStatusNone=>Wont Fix
      Assigned toNone=>dbateman

    Back to the top


    Powered by Savane 3.1-cleanup1