-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
ENH: multiple small improvements to scipy.stats.circmean #20240
Comments
|
I’ll make separate PRs for (1) and (4). (4) is straightforward and I’d simply rewrite For (2), I don’t mean that scaling is not useful, but that they should be handled outside of |
An example where two angles are symmetric numerically:
The same data gives |
A related corner case is that |
Is your feature request related to a problem? Please describe.
When working on the MLE of
vonmises
distribution, I came across thecircmean
function and had to read the source code to find out what exactly it’s doing. A few improvements could make it easier to use the function.Describe the solution you'd like.
The improvements I’d suggest are:
Deprecate thehigh
andlow
arguments. They are there for radian/degree conversion (which explains whyhigh
comes beforelow
), but such conversion should be handled by the user. (Or otherwise all trigonometric functions would accepthigh
andlow
.) The doc already provides a clear example of how to do the radian/degree conversion.Rename the first argument toa
and make it a position-only argument. The naming is consistent with e.g.np.mean
. And making it position-only (a breaking change) ensures callers don’t reference it by name.high
andlow
are fully removed, rearrange the computation code so that the conversions don’t bring unnecessary numerical error. (MAINT: stats: minor numerical improvements to circular statistics #20766)Describe alternatives you've considered.
No response
Additional context (e.g. screenshots, GIFs)
No response
The text was updated successfully, but these errors were encountered: