From: Bruce S. <so...@ui...> - 2004-06-02 15:17:19
|
Hi, All three use different but well-known algorithms For Matlab 5 onwards, this references the randn (which is the standard normal): http://www.mathworks.com/company/newsletters/news_notes/clevescorner/spring01_cleve.html (You also note the link to Matlabs uniform generator that has excellent properties.) numarray.random_array.normal that uses ranlib snorm (snorm is the standard normal). numarray.linear_algebra.mlab.randn uses the Box-Muller method using random uniform numbers from ranlib. Your problems suggest that randn is not the cause. Without any code or what you want to do it hard to address your question except that you should ensure that your sampling does provide the normal distribution with your parameters. By that I mean draw many, many samples from one set of parameters and check the estimated mean and variance. Regards Bruce ---- Original message ---- >Date: Wed, 2 Jun 2004 17:27:02 +0300 >From: Karthikesh Raju <ka...@ja...> >Subject: [Numpy-discussion] Random Numbers >To: num...@li... > >Hi All, > >How close is the random number generation from >numarray.random_array.normal(0,1,x) or >numarray.linear_algebra.mlab.randn(x) to matlab's randn? > >i am having problems with an identical program written in matlab and >python, with the results entirely different in both cases :( > >Warm regards > >karthik > > >----------------------------------------------------------------------- >Karthikesh Raju, email: ka...@ja... >Researcher, http://www.cis.hut.fi/karthik >Helsinki University of Technology, Tel: +358-9-451 5389 >Laboratory of Comp. & Info. Sc., Fax: +358-9-451 3277 >Department of Computer Sc., >P.O Box 5400, FIN 02015 HUT, >Espoo, FINLAND >----------------------------------------------------------------------- > > >------------------------------------------------------- >This SF.Net email is sponsored by the new InstallShield X. >From Windows to Linux, servers to mobile, InstallShield X is the one >installation-authoring solution that does it all. Learn more and >evaluate today! http://www.installshield.com/Dev2Dev/0504 >_______________________________________________ >Numpy-discussion mailing list >Num...@li... >https://lists.sourceforge.net/lists/listinfo/numpy-discussion |