-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: ewma() doesn't adjust weights properly for missing values #7543
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
Comments
I'd be happy to look at the C code that does the calculation if someone could point me in the right direction. Afraid I can't make heads or tails out of pandas\algos.c. |
that is generated from algos.pyx much simpler cython code |
Got it. Thanks. |
Do I need to do anything special for it? My changes to algos.pyx don't seem to be having any effect. |
u have to python setup.py build again |
I must be missing something. I'm using your build script https://github.com/pydata/pandas/blob/master/scripts/windows_builder/build_34-64.bat. I tried duplicating the line
but it didn't make a difference. |
that builds into a new directly eg cd build dir |
I'm using your script for building and testing in one shot. Should that not handle changes to the cython code? My changes to the pure python code are being reflected as expected. |
... never mind. I now see that compiling the Cython file failed, which is why my changes had no effect. |
closed by #7603 |
I mentioned this originally on https://groups.google.com/forum/#!topic/pydata/woxbB8na3C8.
ewma() simply ignores missing values, effectively calculating the exponentially weighted moving average on the compacted series without the missing values. I think this is incorrect, and that values should be weighted based on their absolute location.
In the code below, I reproduce the ewma() calculation using "wrong" weights, and then show what I believe the correct result should be using the "right" weights.
The text was updated successfully, but these errors were encountered: