Skip to content
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

Merged
merged 2 commits into from
Mar 21, 2021

Conversation

mroeschke
Copy link
Member

@mroeschke mroeschke commented Mar 18, 2021

@mroeschke mroeschke added this to the 1.3 milestone Mar 18, 2021
@mroeschke mroeschke added Window rolling, ewma, expanding Bug labels Mar 18, 2021
@mroeschke mroeschke changed the title WIP: Remove artificial precision limit in rolling var & std BUG: Remove artificial precision limit in rolling var & std Mar 19, 2021
@@ -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
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Contributor

@jreback jreback left a 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.

@jreback jreback merged commit 500c4ae into pandas-dev:master Mar 21, 2021
@jreback
Copy link
Contributor

jreback commented Mar 21, 2021

thanks @mroeschke

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Window rolling, ewma, expanding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC/PERF: Decide how to handle floating point artifacts during rolling calculations
3 participants