next up previous
Next: Visual test Up: Testing for randomness and Previous: Moments

Autocorrelation

Another simple test determines the near-neighbor correlation in your random sequence by taking the sume of products at a ``distance'' $m$:

\begin{displaymath}
C(m)=\langle x_ix_{i+m} \rangle = \frac{1}{N} \sum_{i=1}^N {x_ix_{i+m}}.
\end{displaymath} (94)

If your random numbers are distributed with a joint probability distribution $P(x_i,x_{i+m})$ and are independent and uniform, then (95) must compare to the integral:

\begin{displaymath}
\int _0^1 {dx \int _0^1{dy P(x,y)xy}}.
\end{displaymath}



Adrian E. Feiguin 2004-06-01