3
$\begingroup$

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)?

$\endgroup$

2 Answers 2

2
$\begingroup$

You could try Runs test for randomness. I am not familiar with Java functions. I got a link related to runs test that may useful to you. JAVA NPST. Apart from this you could do durbin-watson test or Ljung-Box portmanteau test. Most important is the visual check of time series plot ( I guess you have done this already).

$\endgroup$
3
  • $\begingroup$ If you go with Ljung-Box, which is easy to program, you might want to check out this question and answers. $\endgroup$
    – jbowman
    Commented Jan 3, 2012 at 17:22
  • $\begingroup$ Hi, which flavor of the runs test? Calculating the runs when the value increases and decreases? $\endgroup$
    – Grzenio
    Commented Jan 4, 2012 at 13:09
  • $\begingroup$ 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) $\endgroup$
    – vinux
    Commented Jan 4, 2012 at 14:08
1
$\begingroup$

Another option is a permutation test. Compute a measure of autocorrelation, then randomly permute the values and recompute the same measure of autocorrelation. Do the permute and recompute step a bunch of times (like 2,000 overall) and compare the value for the original ordering to the permuted values to do the test.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.