Open
Conversation
…ion consistently for all cases
bartvanb
reviewed
Apr 24, 2025
Member
bartvanb
left a comment
There was a problem hiding this comment.
I can't really verify whether this is correct as I don't know the algorithm well enough.
What I'm missing is documentation and unit tests for this change.
| # Calculate confidence interval using cumulative variance | ||
| if n_i > d_i and n_i > 0 and S_t > 0: | ||
| std_err = S_t * np.sqrt(cumulative_var) | ||
| z = stats.norm.ppf(1 - 0.05 / 2) # 95% CI |
Member
There was a problem hiding this comment.
I had to think about this code. Isn't it more easily readable to put CI_95_PCT_TWOSIDED = 0.975 and then use that one?
| import numpy as np | ||
|
|
||
| from typing import Dict, List, Union | ||
| from scipy import stats |
Member
There was a problem hiding this comment.
scipy is not included in requirements.txt - maybe it is a dependency of one of the other ones? Not sure if you need to include it.
Same for numpy and pandas actually
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.