Hi, While reading some material on Monte Carlo simulations I came across a simple method to test a random number generator. You can generate N numbers and plot them in 2D by using one random number as x coordinate and another as y. For a good random generator the scatter plot will look random. However, OBRandom does not do very well. The plot from OBRandom looks like the text book example of a bad random number generator. The points lie on a small number of lines as can be seen in the images linked below.
The second link (Random) is from a linear congruential method and only requires 2 lines of code doing any computation. The parameters have to be chosen well for this to work but good values can be found in literature. The OBRandom implementation on the other hand is huge. However, the graphs are clear. Would it be a good idea to replace the current algorithm with this simple method? This method also has it's limitations (e.g. only m distinct values can be returned, I used m = 6075) We could also look for a better method and I have some references but they are generally more complex and require more information to be stored etc. I haven't tested rand() but since this depends on the system used, this is not really a portable solution. OBRandom is mainly used for conformer searching right now. I haven't tested how OBRandom's performance influences this use but I'll probably test this tomorrow. OBRandom: https://spreadsheets.google.com/oimg?key=0AhYF5J4BE5cLdHRqMU1DQXRwMVBPeXRsdjRITThGSkE&oid=2&zx=rz4w9liahgsi Random: https://spreadsheets.google.com/oimg?key=0AhYF5J4BE5cLdGpTOFhkcUhSUFhPQXRGVXVWMzBvNGc&oid=2&zx=w575fiq96kbt source: http://pastebin.org/473622 Cheers, Tim
------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev
_______________________________________________ OpenBabel-Devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openbabel-devel
