I'm trying to apply the Kolmogorov-Smirnov test for goodness-of-fit to a dataset. I have a large set of values, and would like to know whether it fits a Poisson distribution with given $\lambda$.
As I am using Java to generate the dataset, I have found a Java class which is supposed to calculate what I want - it's called jsc.goodnessfit.KolmogorovTest.
There are three methods, approxUpperTailProb(int n,double D)
, exactUpperTailProb(int n,double D)
, and getSP()
.
Did I understand correctly that approxUpperTailProb()
calculates the approximate probability that my data fits the given distribution?
Also, the value n
is the size of the sample set, but what is D
? It's described as "the Kolmogorov-Smirnov statistic; must not be $< 0$ or $> 1$."
As far as I understand, it's the maximum distance of any point from my dataset to the corresponding point in the distribution I am comparing with. However, as I am comparing to a general Poisson distribution, I don't know how to calculate D
.
Finally, what is getSP()
? The documentation states that it "Returns the value of the significance probability." What does that mean?
Any help on this would be much appreciated!