What is autocorrelation?Autocorrelation is a statistical test that determines whether a random number generator is producing independent random numbers in a sequence.What does autocorrelation test?
What does autocorrelation look like?Here is a list of random integers generated. See if you can identify a pattern by looking at the values in the sequence.
If you look carfully at the following table of random integers generated, you'll notice that every number in the 5th, 10th, 15th, and 20th postion is a larger value.
What are the important variables to remember?m - is the lag, the space between the numbers being tested.i - is the index, or the number in the sequence that you start with N - the number of numbers generated in a sequence M - is the largest integer such that Mathematical StuffThe test described below requires the computation of the autocorrelation between every m numbers (m is the lag) starting with the ith number. The autocorrelation between the following numbers .
The value M is is the largest integer such that , where N is the total numbers in the sequence. Since a nonzero
autocorrelation implies a lack of independence, the following two-tailed test is appropriate:
For large values of M, the distribution of the estimator of , denoted with a hat, is approximately normal if the values are uncorrelated. Then the test statistic can be formed as follows:
The formula for (with a hat), in a slightly different form, and the standard deviation of the estimator, are as follows (Scmidt and Taylor 1970):
After computing , do not reject the null hypothesis of independence if , where is the level of signifigance. If > 0, the subsequence is said to exhibit positive autocorrelation. On the other hand, if < 0, the subsequence is exhibiting negative autocorrelation, which means the m values are followed by greater values. How do you figure out the value of M?To figure out the value of M, you must use some simple algebra. For example, the equation: must be solved using the given values i the index, N the number of elements in the sequence, and m the lag.
For example: Since the value M must be an integer, the 0.8 is truncated and the 4 is saved as the value of M. Thus, M is equal to 4. Using the Equations
To use the estimator equation, denoted with a hat, you must understand the sequence and summation notations. The formula
is actually quite easy to use. The next equation is even simpler to use. After solving for M, plug the numbers in and use the results. Applet for computing an Autocorrelation test
How to use the java autocorrelation applet Download Source Code for Applet Drawbacks when using autocorrelation
The ConclusionWhen using autocorrelation tests, be cautious. Autocorrelation may be detected after numerous tests even when no autocorrelation exists. |