-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/k stest #167
Fix/k stest #167
Conversation
@lmizrahi the test fail, but I think this is because they are set up the wrong way. Lets discuss this in a 4eye session? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done by Leila
seismostats/analysis/estimate_mc.py
Outdated
@@ -44,6 +44,8 @@ def cdf_discrete_GR( | |||
|
|||
def empirical_cdf( | |||
sample: np.ndarray | pd.Series, | |||
mc: float = None, | |||
delta_m: float = 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 does not make sense, put a warning that binning is in fact needed
Default small (e-16? +warning that can take long)
seismostats/analysis/estimate_mc.py
Outdated
|
||
x, y_count = np.unique(x, return_counts=True) | ||
# add empty bins | ||
if delta_m > 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delta_m is always >0
seismostats/analysis/estimate_mc.py
Outdated
idx = np.argsort(x) | ||
x = x[idx] | ||
y_count = y_count[idx] | ||
|
||
y = y[np.cumsum(y_count) - 1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
np.cumsum(y_count) can be zero at the beginning.
Then, we want the corresponding y to be 0
The ks test had the problem that it did not take into account bins that were empty, skewing the result.