[Numpy-discussion] Quick Question about Optimization
Charles R Harris
Mon May 19 19:30:15 CDT 2008
On Mon, May 19, 2008 at 5:52 PM, Robert Kern <firstname.lastname@example.org> wrote:
> On Mon, May 19, 2008 at 6:39 PM, Charles R Harris
> <email@example.com> wrote:
> > On Mon, May 19, 2008 at 4:36 PM, Robert Kern <firstname.lastname@example.org>
> >> On Mon, May 19, 2008 at 5:27 PM, Charles R Harris
> >> <email@example.com> wrote:
> >> > The latest versions of Matlab use the ziggurat method to generate
> >> > normals and it is faster than the method used in numpy. I have
> >> > code
> >> > at hand, but IIRC, Robert doesn't trust the method ;)
> >> Well, I outlined the tests that would satisfy me, but I don't think
> >> you ever responded.
> >> which references
> > It's been tested in the literature.
> And it happened to fail such tests. Hence the Doornik paper which
> improves Marsaglia's method to pass the appropriate tests.
Exactly. Doornik was more careful about using independent samples and also
used a better random number generator (MWC8222), not exactly rocket
science. Believe it or not, I had read Doornik's paper before I did my
implementation. I also used a better ziggurat, IMHO, than Marsaglia and
MWC8222 is also about twice as fast on AMD hardware as the Mersenne Twister,
but does require more careful initialization. On Pentium V they are about
they are about the same. I haven't benchmarked either on Core2.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion