{"action":"created","issue":{"url":"https://api.github.com/repos/numpy/numpy/issues/2047","labels_url":"https://api.github.com/repos/numpy/numpy/issues/2047/labels{/name}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/2047/comments","events_url":"https://api.github.com/repos/numpy/numpy/issues/2047/events","html_url":"https://github.com/numpy/numpy/issues/2047","id":7729331,"number":2047,"title":"Patch with Ziggurat method for Normal distribution (Trac #1450)","user":{"login":"thouis","id":473043,"avatar_url":"https://avatars.githubusercontent.com/u/473043?v=3","gravatar_id":"","url":"https://api.github.com/users/thouis","html_url":"https://github.com/thouis","followers_url":"https://api.github.com/users/thouis/followers","following_url":"https://api.github.com/users/thouis/following{/other_user}","gists_url":"https://api.github.com/users/thouis/gists{/gist_id}","starred_url":"https://api.github.com/users/thouis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thouis/subscriptions","organizations_url":"https://api.github.com/users/thouis/orgs","repos_url":"https://api.github.com/users/thouis/repos","events_url":"https://api.github.com/users/thouis/events{/privacy}","received_events_url":"https://api.github.com/users/thouis/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/numpy/numpy/labels/component:%20numpy.random","name":"component: numpy.random","color":"ff0000"},{"url":"https://api.github.com/repos/numpy/numpy/labels/Enhancement","name":"Enhancement","color":"e102d8"},{"url":"https://api.github.com/repos/numpy/numpy/labels/Patch","name":"Patch","color":"009800"},{"url":"https://api.github.com/repos/numpy/numpy/labels/priority:%20normal","name":"priority: normal","color":"ff0000"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":23,"created_at":"2012-10-19T21:02:53Z","updated_at":"2015-04-28T10:53:02Z","closed_at":null,"body":"_Original ticket http://projects.scipy.org/numpy/ticket/1450 on 2010-04-10 by trac user ilan, assigned to @charris._\n\nI've written a patch which replaces the Box-Muller transform\nin numpy/random/mtrand/randomkit.c with the faster Ziggurat method.\nThe patch also includes updates to doc-strings which include the\nrelevant references:\n\n    Doornik, J.A. (2005), \"An Improved Ziggurat Method to Generate Normal\n    Random Samples\", mimeo, Nuffield College, University of Oxford, and\n    www.doornik.com/research.\n\n    Marsaglia, G. and Tsang, W. W. (2000), \"The Ziggurat Method for\n    Generating Random Variables\", Journal of Statistcal Software 5,\n    http://www.jstatsoft.org/v05/i08/\n\n    Marsaglia, G. (1964) \"Generating a variable from the tail of the\n    normal distribution\", Technometrics 6, 101-102.\n\nMy patch is based on the support code which J. Doornik has made available\non his web page (first reference).  I've contacted him, and he has given\npermission to include his code in numpy on the condition that his paper\nis referenced (which the patch does).\n\nThe patch was written against http://svn.scipy.org/svn/numpy/tags/1.4.0,\nand I've just checked to make sure it can still be applied to the\ntrunk (revision 8324).  I've tested the patch on Windows, MacOSX, Linux\nand Solaris.\n\nThe speedup is a bit over 2 times, when creating a large number of Standard\nNormal distributed random numbers.  To verify that the method works and\nproduces good random numbers, I have:\n  * created a large array, using randn()\n  * transformed (using the cumulative distribution function) it back to\n    uniform distributed random numbers\n  * written the data to a large file\n  * performed the diehard tests (I used the dieharder program) on the data\n\nFeel free to hammer the patch.  I hope this patch will make its way\ninto numpy soon."},"comment":{"url":"https://api.github.com/repos/numpy/numpy/issues/comments/97015004","html_url":"https://github.com/numpy/numpy/issues/2047#issuecomment-97015004","issue_url":"https://api.github.com/repos/numpy/numpy/issues/2047","id":97015004,"user":{"login":"rkern","id":46135,"avatar_url":"https://avatars.githubusercontent.com/u/46135?v=3","gravatar_id":"","url":"https://api.github.com/users/rkern","html_url":"https://github.com/rkern","followers_url":"https://api.github.com/users/rkern/followers","following_url":"https://api.github.com/users/rkern/following{/other_user}","gists_url":"https://api.github.com/users/rkern/gists{/gist_id}","starred_url":"https://api.github.com/users/rkern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkern/subscriptions","organizations_url":"https://api.github.com/users/rkern/orgs","repos_url":"https://api.github.com/users/rkern/repos","events_url":"https://api.github.com/users/rkern/events{/privacy}","received_events_url":"https://api.github.com/users/rkern/received_events","type":"User","site_admin":false},"created_at":"2015-04-28T10:53:02Z","updated_at":"2015-04-28T10:53:02Z","body":"My new favorite candidate for a new core PRNG: http://www.pcg-random.org/"}}