-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
BUG: Remove artificial precision limit in rolling var & std #40505
BUG: Remove artificial precision limit in rolling var & std #40505
Conversation
mroeschke
commented
Mar 18, 2021
•
edited by jreback
Loading
edited by jreback
- closes DOC/PERF: Decide how to handle floating point artifacts during rolling calculations #37051, xref BUG: Series rolling standard deviation gives zero for small numbers #40448, xref BUG: pandas.core.window.rolling.Rolling.std gives all-zero output for small numbers #39872
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
- whatsnew entry
@@ -283,10 +283,6 @@ cdef inline float64_t calc_var(int64_t minp, int ddof, float64_t nobs, | |||
result = 0 | |||
else: | |||
result = ssqdm_x / (nobs - <float64_t>ddof) | |||
# Fix for numerical imprecision. | |||
# Can be result < 0 once Kahan Summation is implemented |
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.
is there any risk of getting negative variance?
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.
I don't believe so, no.
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.
lgtm. just @jbrockmendel question.
thanks @mroeschke |