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
Warped series is not of the same length as the reference and query #7
Comments
It is intended. |
I realise this issue has been closed, however I've been experiencing the same problem. There is an off-by-one difference, where the warped series is always one sample short of the length of the series it is being warped to. I can see that I've tried making that change in my own local copy, and it doesn't seem to have broken anything. If nothing else, maybe an extra argument could be added to the function giving the user the option to choose? |
I think you rather want either the |
Okay, here's an example adapted from the docs to show what I mean. First, modify the warp function in warp.py to allow incrementing
Then run the example from the docs
The existing warp behaviour makes Using the R implementation, the same example produces the behaviour I was expecting (the warped query is the same length as the reference):
So the python and R implementations are slightly inconsistent here. The difference arises because python and R use different indexing (numpy's |
Thanks for the added details. I'll have a look. The R |
Sorry for the delay. I still haven't had the time to carefully check the fix and think about the corner cases, but in the meantime, it sounds good for people stumbling upon the bug. |
I have also recently come across this issue and decided on the same fix for the code. Is there any confirmation that this change will then provide the same output as the R version? |
Python version's |
I incorporated the change in 9ad9bf9 and released 1.4.0 . Sorry for taking it so long. |
Description
If the query and reference series are of size N, then the warped series is always of size N-1. This can be explained by how the warp function is set up:
As Python starts counting from 0,
jmax
is always N-1. I was wondering whether this is the desired output or whether the length of the warped series should also be N.What I Did
The text was updated successfully, but these errors were encountered: