help-octave
[Top][All Lists]
Advanced

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

Re: Re: recursion and fsolve


From: David Bateman
Subject: Re: Re: recursion and fsolve
Date: Fri, 6 Aug 2004 16:12:09 +0200
User-agent: Mutt/1.4.1i

Daprès John W. Eaton <address@hidden> (le 06/08/2004):
> On  6-Aug-2004, David Bateman <address@hidden> wrote:
> 
> | If multiple entry points only occur in randlib my preference would be to
> | get the mersenne twister and zigurat code from octave-forge in to octave
> | and eliminate randlib entirely.
> 
> If we are going to replace the current random number generation code
> in Octave, I think it would be good to make it compatible with
> Matlab's generator if we can (yes, some people would like to be able
> to generate precisely the same sequence with both systems so they can
> compare results).  An M-file version of the random number generator
> exists on the MathWorks web pages but it is not clear whether it will
> be possible to use that to write our own derivative version.  But if
> it turns out that there is no way to have compatibility, then yes, we
> should use a better generator.

We are using the same generator as Mathworks for rand. For randn they
use a simplier generator, to get the same speed for rand and randn.
So useless we can figure out what they are using (with very limited
info) for the randn generator there is little chance of us having
compatiable generators.

For rand as we use the same generator there are several things that need
to be done to get exact matlab compatiablity.

1) Use the same seed value as they do. I think octave-forge treats this
  better as the seed is initialized from an entropy pool as is different
  each time it is run. Having the same seed is a great way to end up 
  doing the same simulation N times when you really wanted N different
  simulations.

2) Make the octave-forge rand generator use 53-bits of precsion by default.
  This also means we have to figure out exactly what the munging between
  the 32-bit data given by the Mersenne Twister and the 53-bit data is used
  by matlab. That might be tricky. Are they using all of the bits? Or are
  they using 64-bits and throwing away 11 of them like octave-forge does?

3) Check that all versions of matlab return the same sequences. There is no
  guarentee that matlab itself respects the same sequences between versions

I think the cost of exact matlab compatiablity is quite high here as octave's
entropy pool is a big plus. And even if we wanted complete compatiability 
there is quite some work to achieve it. 

Regards
David

-- 
David Bateman                                address@hidden
Motorola CRM                                 +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 1 69 35 77 01 (Fax) 
91193 Gif-Sur-Yvette FRANCE

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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