Repository navigation
ENH: Von Mises distribution fit - #17585
Conversation
There was a problem hiding this comment.
Thanks @dschmitz89 for the PR.
It needs a bit more tests I think to show it behaves nicely on a wide range of params. It does not necessarily need to be in the test suite in the end, but that would be good to see some evidence here.
Also CI failures are related to this PR.
In my opinion, the loc/shape/scale parametrization makes contributing to the distributions in stats unfortunately much harder. Maybe I did not find all dev doc about it but it just feels very much unintuitive, especially for a circular distribution.
Yes this is something we want to address moving forward when we will be doing an overhaul of the distribution infrastructure (we did not start yet, but it's planned for 2nd Quarter next year.)
| loc_vector = np.array([np.cos(loc), np.sin(loc)]) | ||
| loc_vector_fit = np.array([np.cos(loc_fit), np.sin(loc_fit)]) |
There was a problem hiding this comment.
Seems unnecessary, vs the other test
|
Test failures come from
Implemented a check if the distribution is an instance of |
|
The latest CI failure seems unrelated to this PR. |
FYI, we have some failures in main as well on Linux and Cirrus is flaky. |
|
More extensive testing results for Details |
|
|
||
| data, fshape, floc, fscale = _check_fit_input_parameters(self, data, | ||
| args, kwds) | ||
| if self.a == -np.pi: |
There was a problem hiding this comment.
Not sure this is the preferred way but it allows vonmises_line to be untouched by this PR.
|
From my side this is ready for review again. Changes:
|
tupui
left a comment
There was a problem hiding this comment.
Thanks @dschmitz89 I don't have much more comments.
Why not wrap the data? |
I am always a little sceptical when a user can input pretty much anything. But here you are probably right that it is the better solution, people might be relying on this. So in principle it would be enough to add |
|
But then maybe we need some notes in the doc if we don't want a warning. |
tupui
left a comment
There was a problem hiding this comment.
LGTM and we can still iterate before the next release if we need.
Thanks again @dschmitz89

Reference issue
Closes #17576
What does this implement/fix?
Overrides the fit method of the von mises distribution.
Additional information
This is still pretty rough, mainly to get review started. The math should be pretty solid but I count on the reviewer's knowledge about how to properly align all possible fit cases.
In my opinion, the loc/shape/scale parametrization makes contributing to the distributions in
statsunfortunately much harder. Maybe I did not find all dev doc about it but it just feels very much unintuitive, especially for a circular distribution.