Re: Random testing [message #52063] |
Tue, 02 January 2007 08:20  |
James Kuyper
Messages: 425 Registered: March 2000
|
Senior Member |
|
|
Joshua wrote:
> Does anybody know how to test
> a binary mask for spatial randomness?
> All I'm trying to do is see whether the 1's are spatially random
> or systematic.
There is, inherently, no such thing as a yes-no test for randomness. In
principle, quantum uncertainty is truly random, but nothing else in
nature is. Quantum randomness can only be measured with real-world
devices that introduce a certain amount of non-random noise; the
measured result always has a certain amount of non-randomness, even if
the thing being measured is truly random. So-called "random" number
generators are more correctly known as "pseudo-random", because there's
always an inherently deterministic algorithm behind them. For any
finite set of data, there's always a non-random pattern that fits it,
even if it is actually random.
The best that you can do is check for various specific types of
non-randomness that might cause you problems. Try fitting the mask to
various different models of patterns that you do not want to see in the
mask, using methods that provide estimates of the statistical
significance of the fit. If the data is truly random, the model
parameters will tend not be statistically significant. However, if you
test a sufficiently large number of different models, sooner or later
you'll find one that appears to be a good match, even though the mask
is truly random.
One thing I'd strongly recommend for a 2-D bit-mask, is to perform 2-D
fourier transform of the mask. Peaks in the magnitude of the transform
indicate auto-correlations with a corresponding lag. With truly random
data, you shouldn't see any statistically significant peaks (except, of
course, the one corresponding to a lag of (0,0)).
|
|
|