You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think @hmselwyn and myself have found a bug while working with the code.
For two almost identical vectors, one returns a median value 90 degrees offset from the other (with one being visually much more believable).
First, a simple fix: If you remove one data point from t when ap=500, it will returns the correct result.
It's indeed a bug. The current implementation doesn't cover all the edge cases for even number of samples.
When alpha has an even number of samples, circstat returns the mean of two potential medians. For well-behaved data (mostly concentrated data), these two potential medians were likely nearby, thus this simplistic approach works well. But for not-so-well-bahaved data (e.g. too spread out, but there are many others...), such as yours, it returns the median and the anti-median, thus the mean of them would be 90 degrees off.
I think @hmselwyn and myself have found a bug while working with the code.
For two almost identical vectors, one returns a median value 90 degrees offset from the other (with one being visually much more believable).
Here is code to reproduce:
The text was updated successfully, but these errors were encountered: