This project is read-only.
1
Vote

Add 'runs' test

description

Runs Test

Basic test to see if random sequence is iid.

Let X(i) be iid random variables having cdf F.
Let R = sum 1(X(i) > X(i - 1)).
What is the distribuition of R?
E R = 1(X(i) > X(i - 1))
= int_{y > x} dF(x) dF(y)
= int_{-infty,infty} F(y) dF(y)
= F^2(y)/2|_infty^infty = 1/2
Var R = Var sum 1(x(i) > x(i - 1)) = diagonal + upper + lower off diagonal

Var (1(x(i + 1) > x(i)) = 1/2 - 1/4 = 1/4.
Cov (1(x(i + 1) > x(i), 1(x(i) > x(i - 1)) = ?

comments