The Kolmogorov-Smirnov test (or simply KS test) is a test of equality for one-dimensional probability distributions that are continuous in nature. It is one of the popular methods to determine whether two sets of data points differ significantly.
Create a method that takes two different data distributions. We will see if the difference of the two data distributions is significant by using Kolmogorov-Smirnov test:
public void calculateKs(double[] x, double[] y){
One of the key statistics in the test is d-statistic. It is a double value that we will need in order to calculate the p-value of the test:
double d = TestUtils.kolmogorovSmirnovStatistic(x, y);
To evaluate the null hypothesis that the values are drawn from a unit normal distribution, use the following code:
System.out.println(TestUtils.kolmogorovSmirnovTest(x, y, false));
Finally, the p-value of the significance test can be found...