Runs refers to repeated occurrences of one outcome. For example, in repeated tosses of a coin, there will be runs of heads and tails. In the sequence HHHTHT there are 4 runs (one of length 3 and 3 of length 1).

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

history | excerpt history