Tag Info

About runs

If there are only two outcomes (as with heads and tails, or with positive and negative residuals from a model) then the Wald-Wolfowitz runs test can be used to test serial autocorrelation or independence. Under the null hypothesis of independence (no autocorrelation) the mean number of runs is given by

$\mu = \frac{2n_1n_2}{n_1 + n_2}+1$

with variance

$\sigma^2 = \frac{2n_1n_2(2n_1n_2 - n_1 - n_1}{(n_1 + n_2}^2(n_1 + n_2 -1)$