Title: Uniformity
1Uniformity
2 Test
- Break up the unit interval into k bins
- If data are uniform, expect n/k in each bin
(make sure you expect at least 5 in each bin)
Uniformity
3 Test
In our sample with n100,000
k20
Uniformity
4 Test
In our sample with n100,000, k20
We passed!
Uniformity
5Serial Test
Idea Bunch up the data into vectors.
If the individual values are independent,
the vectors should be uniformly distributed in
the unit cube.
Uniformity and Independence
6Serial Test
Dump the data into bins of some width
Uniformity and Independence
7Serial Test
- let Oij be the number of observations in the
i-jth bin
- if uniform and members of pairs independent,
expect (n/2)/k2 in each bin
Uniformity and Independence
8Serial Test
For our sample, I used a 20 by 20 grid
Of the 50,000 pairs
We expect 125 in each cell
We passed!
Uniformity and Independence
9Serial Test
Incidentally
(failed!)
Uniformity and Independence
10Kolmogorov-Smirnov Test
Uniformity
11Kolmogorov-Smirnov Test
Uniformity
12Kolmogorov-Smirnov Test
If X1, X2, , Xn really come from the
distribution with cdf F, the distance
should be small.
Uniformity
13Kolmogorov-Smirnov Test
Computing the test statistic
(obviously simplified)
Uniformity
14Kolmogorov-Smirnov Test
0.6 0.2 0.5 0.9 0.1 0.4 0.2
Put them in order
0.6 0.2 0.5 0.9 0.1 0.4 0.2
Now the empirical cdf is
Uniformity
15Kolmogorov-Smirnov Test
0.6 0.2 0.5 0.9 0.1 0.4 0.2
Uniformity
16Kolmogorov-Smirnov Test
Uniformity
17Kolmogorov-Smirnov Test
0.6 0.2 0.5 0.9 0.1 0.4 0.2
Uniformity
18Kolmogorov-Smirnov Test
Let X(1), X(2), ,X(n) be the ordered sample.
Then Dn can be estimated by
This is exact for the uniform distribution!
where
Uniformity
(assuming non-repeating values)
19Kolmogorov-Smirnov Test
- We reject that this sample came from the
proposed distribution if the empirical cdf is
too far from the true cdf of the proposed
distribution
- ie We reject if Dn is too large.
Uniformity
20Kolmogorov-Smirnov Test
In the 1930s, Kolmogorov and Smirnov showed that
Uniformity
21Kolmogorov-Smirnov Test
For small samples, people have worked out and
tabulated critical values, but there is no nice
closed form solution.
- J. Pomeranz (1973)
- J . Durbin (1968)
Uniformity
22Kolmogorov-Smirnov Test
For our small sample of size 7,
From a table, the critical value for a 0.05 level
test for n7 is 0.483.
We passed!
Uniformity
23Kolmogorov-Smirnov Test
We passed!
Uniformity