I am trying to test if the sampled interval between random events fits a particular geometric distribution, and am pretty lost as to what I'm doing wrong.
Assuming there's nothing wrong with the library,
# Take n samples from the geometric distribution
data = scipy.stats.geom.rvs(.2, size=n, random_state=None)
# Perform ks test against the cdf of distribution
print(scipy.stats.kstest(data, lambda x: scipy.stats.geom.cdf( x, .2)))
results in p-values near 0 (1e-5) with sample size of 100. Increasing the sample size causes the p-values to decrease further (eg 1000 samples results in 1e-35), which is the opposite of what I expect.
Am I making some incorrect statistical assumptions? Is something wrong with my methodology? Is goodness of fit testing not what I'm looking for? Are there other statistical tests that I can do instead?