susu.exp wrote:
And asking you as a programmer: Do you know how good the random number generator in R is and whether it automatically re-seeds by clock? I´ve found an anylytic solution for a problem usually tackled with a Monte-Carlo technique, but the results don´t match well for large runs and a possible explanation would be that the resampling routine in R introduces some bias.
Well, I never used R, but there are multiple ways to go around this.
If you are interested in knowing how good R's random numbers are, you can create a R program which writes many times it's outputs to a file, and then run on that file one of many analysis tools.
I can't recommend one without knowing what architeture/operating system you are using ofcourse.
If you are interested in going around the problem by not using R's random number generator at all, you can read random numbers from files. There are many solutions for this.
In linux and some other unix systems, you can open the 'magic' file /dev/random or /dev/urandom
When you read from those, the kernel gives you random data, and they make use of any hardware random number generator that the system has (Which are usually based on thermal noise or radioactive decay). The difference between /dev/random and /dev/urandom is that random reads and depletes the kernel's entropy pool, and when the pool is empty, the read blocks while it get's filled in again. This is usually not a problem when you have a hw rnd device, but ofcourse you can read from it faster then it can fill the pool. But otherwise, your application will have sluggish performance, which can be a little improved by moving around the mouse (linux also uses mouse data, hard-drive activity and other events to fill the entropy pool, but they are very slow for this). /dev/urandom uses a pseudo-random number generator using the entropy pool as seed, and it does not deplete it, so the data it provides is worse, but you never have to wait for it.
On other systems which don't have such magic files, you can use any application to create a normal file filled with random data, if you are careful to create one big enough, and optionally using any interface to hw rnd generators.
You can buy those, and they usually come with some application to dump their data to a file, or a library you can use from many programming environments to read from it directly. (They are a bit pricey though)
You can even download such files, and so not bother generating them yourself.
http://www.random.org/files/ provides very good data, generated from atmospheric noise.