Re: Matlab's random number generator is suspicious... what to do?



One additional thought.
How did you run it? In one procedure (10 000 000 (?) ) monte carlo
simulations?
If you run two copies of MATLAB (5000000 & 5000000) simulations to get these
results, and did not bother to reinitialize the random number generator, you
should obtain EXACTLY THE SAME results. Just because MATLAB by default
generates the same sequence of 'random' numbers every time you start it.

Arthur

"Randy Poe" <poespam-trap@xxxxxxxxx> wrote in message
news:1152292420.208055.294420@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

gino wrote:
"Rune Allnor" <allnor@xxxxxxxxxxxx> wrote in message
news:1151737171.192977.91330@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

gino wrote:
I did some Monte Carlo simulation,

with some random data,

for 5000 thousands runs, the result is extremely good;

and for another 5000 thousands runs, the result is extremely bad...

this makes me suspect the randomness of the Matlab's random number
generator... (I am trying to generate some Geometric Brownian Motion
process)...

Are they ways that I can make Matlab's random number generator better?

First: I don't see very often that people actually check how Monte
Carlo simulations perform. Too many people take for granted that
MCS is "best" and use the results uncritically.

So good work on you for actually checking, and evaluating the
results.

Now, just out of curiosity, what makes you conclude that

a) There is a problem with your Monte Carlo simulations?
b) The cause of this as of yet unknown problem has to
do with matlab?



Thanks Rune,

the symptom was sometimes the result was extremely good,

Define "extremely good"

and all results
clustered together. and some other times the results were extremely bad,

Define "extremely bad"

and
all results clustered together again.

You've said the results were clustered in both cases. What
about the first case was "good" and the second case was
"bad"?

Also you've only told us the RESULTS were clustered, nothing
about the random numbers.

RAND and RANDN are pretty good PRNGs. I wouldn't
automatically conclude they are at fault without further
analysis of what happened in the "bad" runs.

- Randy



.