I need to compute the Kolmogorov-Smirthov test but the scipy.stats.kstest
method is not applicable to my situation. The scipy.stats.kstest
method needs 2 inputs: the CDF respect to which you have to compute the statistic and an array containing i.i.d. random variable observations. But my situation is slightly different: I don't have the observations but I have the empirical CDF.
So I could trivially compute the value of the statistic with this code:
value = 0
for i in range(len(y_list)):
if(abs(y_list[i]-y_true_list[i])) >= value:
value = abs(y_list[i]-y_true_list[i])
where I basically compute the maximum (over every x) of the absolute value of the difference between the empirical CDF (y_list
) and the CDF respect which I need to do the test (y_true_list
).
But now how can I compute the p-value of the given result?