Re: strong nonrandom pattern in rand
- From: "Petr Savicky" <savicky@xxxxxxxxx>
- Date: Thu, 6 Apr 2006 19:45:49 -0400
Peter Perkins wrote:
Petr, it's worth noting that that Tech Solution is a little out of
date -- it
points you to a mex file on MATLAB Central, but in fact the
Mersenne Twister
algorithm is now one of the choices in MATLAB's built-in uniform
generator,
RAND, since several releases ago.
The current versions Matlab contain an internal Mersenne Twister and
the user may use it, if explicitly asks for that. However, without an
explicit request for 'twister' or 'seed', the discussed subtract with
borrow generator is used.
Most users do not know that one can choose between different
generators and rely completely on Matlab defaults. Even the users who
know that there is a choice may think that for simple tasks the
default generator is sufficient and have no reason to investigate the
situation in depth.
Assume, one generates a sequence of 2800 random integers between 0
and 3 from the default generator and splits them into 100 vectors of
length 28. In each of these vectors (a[1], ..., a[28]) consider only
the numbers (a[1], a[16], a[28]). There are 64 possible triples, but
the 10 triples
(0, 0, 1),
(0, 1, 2),
(0, 1, 3),
(0, 2, 0),
(0, 3, 0),
(1, 0, 0),
(1, 0, 1),
(1, 1, 1),
(2, 1, 0),
(3, 1, 0)
never occur. The probability of this event for a good generator is
(54/64)^100 < 4.2e-8. I think, that a generator which fails on the
4.2e-8 level of statistical significance in this simple test using
only 2800 numbers is not acceptable even for simple tasks.
.
- References:
- strong nonrandom pattern in rand
- From: Petr Savicky
- Re: strong nonrandom pattern in rand
- From: helper
- Re: strong nonrandom pattern in rand
- From: Petr Savicky
- Re: strong nonrandom pattern in rand
- From: Peter Perkins
- strong nonrandom pattern in rand
- Prev by Date: g77 mex problem under win
- Next by Date: Re: Deming regression
- Previous by thread: Re: strong nonrandom pattern in rand
- Next by thread: PIXELINK PL A741
- Index(es):
Relevant Pages
|