Kolmogorov smirnov test

1,561 views 10 slides May 30, 2017
Slide 1
Slide 1 of 10
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10

About This Presentation

Kolmogorov-Smirnov test is used to find out the uniformity between the random numbers in a sequece. It can only be used to the pseudo random numbers.


Slide Content

Kolmogorov-Smirnov Test & Its Implementation -Ramesh Giri

Contents: -> Random numbers?? -> True and pseudo random?? -> Main properties of pseudo random . -> Kolmogorov-Smirnov? -> Why Kolmogorov-Smirnov?

Random numbers Sequence of  numbers  or symbols that cannot be reasonably predicted better than by a  random  chance. True Random Random number sequence that has no chance of being predicted. Pseudo Random Random number sequence that has some chance of being predicted.

Properties of pseudo random number -> Dependent -> Uniformity -> Deterministic -> Tractable

Kolmogorov-Smirnov Test -> Used to test the uniformity of the given sequence. -> Compares the continuous cdf , F(X), of the uniform distribution to the empirical cdf , SN(x), of the sample of N observations. -> Based on the statistic D = max | F(x) - SN(x)|

Algorithm: Step 1: Rank the data from smallest to largest. Let Ri denote ith smallest observation, so that R 1 <=R 2 <=R 3 <= ...<=R N Step2: Compute D+ = max { i /N –Ri} and D-= max {Ri –(i-1)/N} Step 3: Find D = max {D+, D-} Step 4: Determine the critical value, Dα, from Table for the specified value of α and the sample size N. Step 5: If the sample statistic D is greater than the tabulated value of Dα, the null hypothesis that the data are a sample from uniform distribution is rejected

Example Give Numbers: 0.05, 0.14, 0.44, 0.81, 0.92. Critical value of D for α = 0.05 and for N=5 is 0.565 .   Now, D+ = max(D+) = 0.26 D- = max(D-) = 0.21   So, D = max (D+, D-) = 0.26.   From tabulated value, D=0.565, i.e. greater than 0.26 (observed). So, the hypothesis, no difference between the distribution of the generated number are the uniform distribution is nor rejected. i.e. Accepted. Ri 0.05 0.14 0.44 0.81 0.92 i/N 0.2 0.4 0.6 0.8 1.0 i/N-Ri (D+) 0.15 0.26 0.16 -0.01 0.07 Ri-(i-1)/N (D-) 0.05 -0.06 0.04 0.21 0.13

Conclusion: K-S test can be only applied to pseudo random numbers. Used to find whether the sequence is uniformly distributed or not Based on the statistic D = max | F(x) - SN(x)|

Any Questions???

Thank You   