Created
August 4, 2016 16:34
-
-
Save chris-wood/8867990e01afa35c858f603b366c11d2 to your computer and use it in GitHub Desktop.
kolmogorov_smirnov_statistic.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def distribution_supremum(F0, Fk): | |
delta = map(lambda ((x1, y1), (x2, y2)) : abs(y2 - y1), zip(F0, Fk)) | |
support = filter(lambda x : x > 0.0, delta) | |
return max(support) | |
def kolmogorov_smirnov_statistic(F0, Fk): | |
''' | |
Compute the statistic according to: | |
https://onlinecourses.science.psu.edu/stat414/node/322 | |
''' | |
return distribution_supremum(F0, Fk) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment