Created
July 28, 2018 03:51
-
-
Save otaviomguerra/0344b2abc5ad30709f97e9107871306c to your computer and use it in GitHub Desktop.
computes ECDF for 1D array
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 ecdf(data): | |
"""Compute ECDF for a one-dimensional array of measurements.""" | |
# Number of data points: n | |
n = len(data) | |
# x-data for the ECDF: x | |
x = np.sort(data) | |
# y-data for the ECDF: y | |
y = np.arange(1, n+1) / n | |
return x, y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment