# Test for independence of random variables

I have a time series of data (about 300-750 elements, depending on the sample) and a model that has some random residues. I used the Kolmogorov–Smirnov test to make sure that the normality hypothesis can't be rejected, so I assume that the residuals are normally distributed. But now I guess I should test if they are independent of each other - so that there is no autoregression? Which test should I use (preferably one that is easily implementable in java)?

-

You need to check both. The rejection rule is $R \leq C_1$ or $R \geq C_2$, where $C_1$ and $C_2$ are critical values obtained from table (or from normal distribution for large sample) –  vinux Jan 4 '12 at 14:08