How does Kolmogorov-Smirnov Test work?
Below are the steps for how the Kolmogorov-Smirnov test works:
- Hypotheses Formulation:
- Null Hypothesis : The sample follows a specified distribution.
- Alternative Hypothesis: The sample does not follow the specified distribution.
- Selection of a Reference Distribution:
- A theoretical distribution (e.g., normal, exponential) is decided against which you want to test the sample distribution. This distribution is usually based on theoretical expectations or prior knowledge.
- Calculation of the Test Statistic (D):
- For a one-sample Kolmogorov-Smirnov test, the test statistic (D) represents the maximum vertical deviation between the empirical distribution function (EDF) of the sample and the cumulative distribution function (CDF) of the reference distribution.
- For a two-sample Kolmogorov-Smirnov test, the test statistic compares the EDFs of two independent samples.
- Determination of Critical Value or P-value:
- The test statistic (D) is compared to a critical value from the Kolmogorov-Smirnov distribution table or, more commonly, a p-value is calculated.
- If the p-value is less than the significance level (commonly 0.05), the null hypothesis is rejected, suggesting that the sample distribution does not match the specified distribution.
- Interpretation of Results:
- If the null hypothesis is rejected, it indicates that there is evidence to suggest that the sample does not follow the specified distribution. The alternative hypothesis, suggesting a difference, is accepted.
Kolmogorov-Smirnov Test (KS Test)
The Kolmogorov-Smirnov (KS) test is a non-parametric method for comparing distributions, essential for various applications in diverse fields.
In this article, we will look at the non-parametric test which can be used to determine whether the shape of the two distributions is the same or not.