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

A 'run' is a sequence of adjacent equal symbols. I.e. the following sequence: ++++---+++--++++++---- is divided in six runs, three of them are made out of + and the others are made out of -. If +s and -s alternate with each other in a random order, the number of runs is a random var whose distribution has:

mean: \mu=\frac{2\ N_+\ N_-}{N}+1 , with N=N_++N_-
Variance: \sigma^2=\frac{2\ N_+\ N_-\ (2\ N_+\ N_--N)}{N^2\ (N-1)}=\frac{(\mu-1)(\mu-2)}{N-1}

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

Run-test can be used to:

  1. test the randomness of a distribution, by taking the data in the same order they have been taken and marking with + the ones above the median and with - the ones below the median.
  2. test whether a function fits well a data set, by marking with + the data above the function and with minus the data below the function.

For this use, runs test, that takes into account the signs but not the distance, is considered complementary to chi square test, that takes into account the distance but not the signs.

Kolmogorov-Smirnov test and chi-square test are more powerful, if they can be applied.

See alsoEdit


This page uses Creative Commons Licensed content from Wikipedia (view authors).

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.