Re: Matlab's random number generator is suspicious... what to do?
- From: Peter Boettcher <boettcher@xxxxxxxxxx>
- Date: Mon, 03 Jul 2006 09:20:30 -0400
"gino" <loseminds@xxxxxxxxxxx> writes:
"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, and all results
clustered together. and some other times the results were extremely bad, and
all results clustered together again. It was not like something that is
random...
The Mersenne twister algorithm is considered to be a better RNG than
the default generator in MATLAB. See "help rand". I would try
running with all three of the methods and see how the affect your
results.
But remember that the available range of the various generators may
also affect your result, depending on how you use the numbers. A
different scaling method might make all the difference.
--
Peter Boettcher <boettcher@xxxxxxxxxx>
MIT Lincoln Laboratory
MATLAB FAQ: http://www.mit.edu/~pwb/cssm/
.
- References:
- Prev by Date: Re: plot -command
- Next by Date: Re: MMX/SIMD/etc. used in MATLAB
- Previous by thread: Re: Matlab's random number generator is suspicious... what to do?
- Next by thread: Re: Matlab's random number generator is suspicious... what to do?
- Index(es):