Questions tagged [runs]

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

30 questions
7
votes
1 answer

Runs of the same type within a deck of cards - distribution of runs of different length

My background is in physics, not statistics, so forgive any suspect terminology or notation, but I hope the problem is clearly set out below. Secondly, my statistics is not good enough to recognize whether this problem has been asked elsewhere on…
Simon
  • 71
  • 1
5
votes
2 answers

Expected number of wins until $k$ consecutive wins

We play the game, where probability that you win a game is $p$. You play until you win $k$ consecutive games. What is expected number of games you win? I can compute that expected number of games is $\frac{1-p^k}{p^k}\frac1{1-p}$.
Ethan
  • 463
  • 3
  • 7
5
votes
1 answer

Estimating number of Monte Carlo runs to evaluate a percentile

I have a complex distribution which I can numerically sample. I'd like to estimate a percentile (let's say 90%) using Monte-Carlo simulations. What I'm doing is: I run 1 million of independent simulations and I get 1 million of samples from the…
xanz
  • 449
  • 2
  • 11
5
votes
1 answer

One sample run test, but with P(+) $\neq \frac{_1}{^2}$

I am trying to find out how to conduct run tests on one sample but with a non 0.5-0.5 underlying occurrence pattern of the two dichotomous values. For instance +++---++++, but assume that +'s had an underlying probability of 0.8 of happening…
appletree
  • 81
  • 2
3
votes
2 answers

Probability of Runs

I hope the title accurately reflects my question. I have an independent event, with a 98% chance of occurring. Now, I observe and record the outcome of this event 100 times. What is the probability that there is a single run of 17 consecutive…
DocML
  • 31
  • 2
3
votes
0 answers

UP/DOWN Run test: How to determine the Matrix $A$

A test statistic for a UP/DOWN run is defined in Donald E. Knuth, The Art of Computer Programming Volume 2, 1998, pp. 66-.: $V= \frac{1}{n} \sum_{i,j\ <=m} \ (COUNT(i)-nb_i)(COUNT(j)-b_j)a_{ij}$ where $m$ is the max length of the runs. But he…
B Wayne
  • 31
  • 1
2
votes
1 answer

Runs test for randomness for k elements

Say I have a sequence of length $n$ of $k$ different elements, s.t. $n > k, k > 2$. I want to show this sequence is random, based on the number of runs. I found this paper by AM Mood which explains how to find the expected values and variances of…
2
votes
0 answers

Joint distribution of longest run and number of runs in a sequence of $n$ coin tosses?

A coin with probability of heads $p \in (0, 1) $ is tossed $n$ times. What is the joint probability distribution of the number of runs and the longest run? Schilling (1990) discusses the distribution of the longest run but I haven't found a good…
COOLSerdash
  • 25,317
  • 8
  • 73
  • 123
2
votes
0 answers

In general which runs test is more powerful?

There are several tests for randomness, one is runs up and down, another is run against mean or some other values, of cause, Bartel's rank test can also be used. There are studies shows where Bartel's rank test is more powerful than run up&down, and…
2
votes
0 answers

maximum randomness and non-randomness

Two questions about randomness of data-sequences: Using a variant of run test like Wald–Wolfowitz to check randomness hypothesis for a one-sample data sequence, which yields a P value denoting the probability of randomness, can we conclude the…
Manin
  • 21
  • 1
2
votes
1 answer

Runs Test and Chi Square Distribution

I want to identify random data by applying some tests to the observed byte stream. I used the chi square test already on a frequency analysis, which works fine. To reduce the false-positive rate I want to apply some more tests, like the runs test,…
tom
  • 51
  • 2
2
votes
1 answer

Runs test and Durbin-Watson test yield different outcomes

I have analysed the market return using the runs test and the Durbin-Watson test to determine whether the return series follow the random walk or not. The problem I have found is that some return series is rejected by the runs test's null…
Thomas
  • 21
  • 1
2
votes
2 answers

Taking two sets (A, B) out of the same distribution, merging and then sorting should roughly result in a,b,a,b,a,b?

Suppose I take 2 sets ($A$ and $B$) of 1000 random items out the same distribution; I also suppose that all items are different. I then create a new set $C$ which is the union of $A$ and $B$, since all items are different it has 2000 elements. If…
warreee
  • 123
  • 3
2
votes
0 answers

Runs test for a very small sample

I have six measurements taken at different time-points in an experiment, and I want to show if these measurements have a dependence on time (i.e. are they random or not). I originally presented the data as a line graph (measurement vs time) as I…
user102759
  • 21
  • 2
2
votes
1 answer

Distribution of (maximum) run length

I am curious about the distribution of (maximum) run length given k independent trials when $p(X=1)=p_1, p(X=2)=p_2, ..., p(X=n)=p_n.$ For example, for a coin tossing for 3 independent trials, $p(X="H")=1/2, p(X="T")=1/2.$ $p(mrl=3)=2*(1/2)^3 …
KH Kim
  • 1,121
  • 2
  • 10
  • 25
1
2