I have a time series data set of photon arrival times from a detector and need to know whether the arrival time is uniform.It is a continuous distribution?
I have calculated the maximum $D$ between the normalized CDF of the photon arrival times. Then what should I do? There is a "$Pr(k\le x)$" in the Wiki link. What does it stand for in my question? Could somebody tell me the basic definition of ks-test?
In fact, I can calculate ks-test probability via scipy.stats.kstest. Does anybody know the meaning of
args for a uniform distribution? And the two output values?
>>> stats.kstest(sample, 'uniform',args=(1,2,3,4,5,6)) (1.0, 0.0) >>> stats.kstest(sample, 'uniform',args=(0.1,0.2,0.3,0.4,0.5,0.6)) (1.0, 0.0) >>> stats.kstest(sample, 'uniform',args=(0.1,0.2)) (1.0, 0.0) >>> stats.kstest(sample, 'uniform',args=(1,2)) (0.98999999999999999, 0.0) >>> stats.kstest(sample, 'uniform',args=(1.1,2.1)) (0.98499999999999999, 0.0)
I think I should compare two cdf:the normalised real data and the cdf of a uniform distribution that the photons arrive uniformly.
Please take a look at my plot.The green points are from real data.There are hundreds of green points.Every green point means an arrival of a new photon.x-axis is time and y-axis is normalised,in fact,it is the percent(cumulative arrival photons/total photon number).The red straight line stands for the cdf of uniform distribution.
stats.uniform picks random values every time.Is stats.uniform appropriate?
I took an image of the 2rd version Numerical Recipes in C.
What is the relation between 14.3.9 and wikipedia's Pr(k<=x)?Just an approximation,right?
The significance should be decided only by two values max(D) and sample size,right? Pr(k<=x) is the cdf of D?How to define x?
I can not get a consistent result with stats.kstest().
You mean if I use the real time data which is not normalised,I should use two-sample ks-test,right?