# Limitations of Kolmogorov–Smirnov test

In this article, it is said that the test statistic tends to be more sensitive near the center of the distribution than at the tails. Can some please explain this what it means? (with a simple example if possible). Also please let me know when should the KS test test is preferred and not preferred for testing normality.

The variance of the sample cdf in the tails is smaller than near the median.

I assume we're talking about a one-sample Kolmogorov-Smirnov (though similar comments come into the two-sample case).

Specifically, the variance is proportional to $$F(1-F)$$, so as $$F$$ approaches $$0$$ or $$1$$ the variance goes to zero, and so does the standard error of the ecdf.

This means that even small deviations in the tail can be a strong indication of a problem with the null distribution.

However, the Kolmogorov-Smirnov "sees" a given difference in the tail and in the middle as equally serious (they both give the same statistic), but it's much "harder" for the data to deviate that much in the tail so the test is relatively insensitive to what's going on in the tails compared to some other tests.

In particular, try looking at the uniform case (since any other case can be reduced to the uniform by transforming the data by the hypothesized cdf under the null). Here's 500 uniform ecdfs with n=20 If you look at the width of the spread near $$x=0.5$$, it's much wider than it is at $$x=0.05$$ or $$x=0.95$$. So it's "harder" to achiever the critical value of D in the tail region than in the middle -- so the test generally finds deviations more toward the middle than right up at the ends.

• Thanks for the detailed explanation, In this case can we always go for the Anderson–Darling test for normality which gives more weight to the tails than does the K-S test? – Venkatesh Gandi Nov 27 '19 at 6:51
• It does, and also uses information from all of the differences, not just the largest one. It often has better power against interesting alternatives, but also has worse test bias against some alternatives. – Glen_b -Reinstate Monica Nov 27 '19 at 11:09
• There's also a KS-type test that accounts for not only the sample variance differences but the exact finite-sample distribution/skew seen in the graph of the above (nice) answer, in order to spread power evenly across the distribution; see this 2018 Journal of Econometrics article and references therein (esp. the Buja and Rolke 2006 working paper); open draft available here. – David M Kaplan Jan 18 at 2:52