From help-request at octave dot org Fri Sep 17 03:28:55 2004 Subject: Re: recursion and fsolve From: David Bateman To: Paul Kienzle Cc: Bart Vandewoestyne , help-octave@octave.org Date: Fri, 17 Sep 2004 10:24:18 +0200 According to Paul Kienzle (on 09/17/04): > It isn't an m-file, it is in C/C++. Look in the octave-forge > package at http://octave.sf.net in the file FIXES/randmtzig.c. > > I don't believe The Mathworks is using the MersenneTwister > for their random number generator. > > What David was referring to above is Marsaglia's ziggurat > algorithm for generating normally distributed random numbers. > Matlab has older version of this algorithm. David's implementation > comes from the description given in TOMS. No I had it in my mind that Matlab used the Mersenne Twister. Following up Dmitri's reference it seems that they aren't, but something else proposed by Marsaglia to generate uniform floating-point distributions directly. The advantage of this is that all floating point values are possible. As we use a 53-bit integer and then divide to get the floating point number we can't generate certain floating point values close to zero. However, as John pointed out, some problems have been identified with the randomness of this algorithm, though nothing critical in most cases (not for crypto)... The matlab normal generator, although it uses a ziggurat uses a different uniform generator as its basis, with a much shorter period... So although we probably use exactly the same ziggurat (the mapping function from uniform to normal distributions), we'll never have the same sequence as the base generators aren't the same... Regards D. -- David Bateman David dot Bateman at motorola dot com 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 -------------------------------------------------------------