# Wald-Wolfowitz runs test

Revision as of 22:18, 12 April 2007 by 128.101.220.43 (talk) (Chi-square is not "more powerful", it is just different. I don't know about K-S, so I will leave that to another editor)

The **runs test** (also called **Wald-Wolfowitz test**) is a non-parametric test that checks the randomness hypothesis of a two-valued data sequence.

A 'run' is a sequence of adjacent equal elements. For example, the sequence "++++−−−+++−−++++++−−−−" is divided in six runs, three of which consist of +s and the others of −s. If +s and −s alternate randomly, the number of runs is a random variable whose distribution has:

If there are too many runs more or less than foreseen, the data are likely to alternate in a nonrandom order.

Runs tests can be used to test:

- the randomness of a distribution, by taking the data in the given order and marking with + the data greater than the median and with − the rest;
- whether a function fits well to a data set, by marking the data exceeding the function value with + and the other data with −. For this use, the runs test, which takes into account the signs but not the distances, is complementary to the chi square test, which takes into account the distances but not the signs.

The Kolmogorov-Smirnov test is more powerful, if it can be applied.