# Kolmogorov Smirnov Test Consistency

I was reading that the Kolmogorov Smirnov 2 sample test is consistent, that is Probability of rejection under $$H_1$$ is 1 for sample size going to infinity.

Say we have 2 random variables X and Y. K-S Test checks if $$F=G$$.

The test statistics is: $$sup_z|F_n(z)-G_n(z)|$$

The test is consistent (for some level $$\alpha$$) means :

$$Lim_{n\rightarrow \infty}P(sup_z|F_n(z)-G_n(z)|>D_{n,\alpha})=1$$

where $$G_n$$ is the empirical cdf distribution of Y and $$G_n(y)=\sum_{i=1}^n\frac{\mathbb{1}_{Y_i where m is the number of sample of Y.

$$F_n$$ is the empirical cdf of X, $$F_n(X)=\sum_{i=1}^n\frac{\mathbb{1}_{X_i where n is the number of sample of X.

I cannot prove the consistency can anyone help in it ?

Assume, under $$H_1$$, $$F\not=G$$. This means that for some $$z$$ and $$\epsilon>0$$,we have $$|F(z)-G(z)|>\epsilon$$. Glivenko-Cantelli gives $$F_n\to F, G_n\to G$$ uniformly in probability. In particular, with probability going to 1, $$|F_n(z)-G_n(z)|\to\epsilon>0$$. You get the result from $$D_{n,\alpha}\to 0$$. This follows from the fact that if $$F=G$$, Glivenko-Cantelli implies that the supremum difference goes to zero in probability, therefore all quantiles of the distribution of that supremum for fixed $$\alpha$$.
• Why is $D_{n,\alpha}$ go to 0 ? May 7, 2023 at 10:20
• So basically to are showing that under $H_0$ , $D_n=D_{n,\alpha}$ goes to 0 , and under $H_1$ , $D_n>\epsilon$ for some $\epsilon$ and thus it follows right ? May 7, 2023 at 12:32
• @Andrew741 Yes (except that I have to guess what $D_n$ is as this had not been defined). May 7, 2023 at 12:54