octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #39085] randg cannot be initialized


From: David Bateman
Subject: [Octave-bug-tracker] [bug #39085] randg cannot be initialized
Date: Mon, 03 Jun 2013 23:34:36 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:20.0) Gecko/20100101 Firefox/20.0

Update of bug #39085 (project octave):

                  Status:                    None => Wont Fix               
             Assigned to:                    None => dbateman               
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #3:

This has been discussed a number of times in the past. In matlab rand and
randn are separator generators and are seeded separately. Thus


rand('state',0.5)
randn()
rand('state',0.5)
randn()


in both matlab and octave give different results for both calls to randn(). In
Octave the generators rand, randn, rande, randg and randp are all separate
whereas as in matlab rande, randg, randp are derived from rand and randn, and
thus the difference between matlab and octave you observe

When I implemented these functions I asked on the list whether we should
duplicate matlab behavior by sharing the state vectors between generators and
the consensus at the time was that if we couldn't duplicate the exact
sequences of the matlab generators from the same state vectors it was better
to be able to reset these generators separately. So try instead


randg('state',0.5)
randg()
randg('state',0.5)
randg()


So yes this is a difference between matlab and octave, but no its not a bug,
and yes you can "initialize" randg

D.
 


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?39085>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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