C
Carl
Hi, I am running some Monte Carlo simulations under C++ and have noticed
that there seems to be some bias evident. For example when using random
sampling on the function f(x) = x between x=-100...100 (to evaluate the
integral of the function) I always get large positive/negative resulting
values, even when running the simulation beyond a million steps.
The basic question are:
1) does the raw srand(time(0)) ... rand() produce any bias if run over a
long period of time?
2) what is a better random number generator? As my algorithms are heavily
dependent on randomness I need a really good random number generator.
Any help most appreciated!
Thanks!
Carl
that there seems to be some bias evident. For example when using random
sampling on the function f(x) = x between x=-100...100 (to evaluate the
integral of the function) I always get large positive/negative resulting
values, even when running the simulation beyond a million steps.
The basic question are:
1) does the raw srand(time(0)) ... rand() produce any bias if run over a
long period of time?
2) what is a better random number generator? As my algorithms are heavily
dependent on randomness I need a really good random number generator.
Any help most appreciated!
Thanks!
Carl