scipy
scipy copied to clipboard
ENH: use analytical formula in scipy.stats.powerlaw._munp().
Reference issue
Closes gh-20036.
What does this implement/fix?
Use analytical formula in scipy.stats.powerlaw._munp
. The formula is derived by simple integration, and elaborated in gh-20036.
Additional information
A simple unit test case is supplied.
Are there difficulties for very high moments for the powerlaw distribution?
No, the expect
function works perfectly fine for 5th moment and only starts to lose precision when moment > 10000.
I did a quick search for a common moment test but didn’t find one, so I wrote the custom test. Thanks for pointing it out!
I’ll make an update commit to remove the custom test.
@dschmitz89 I'll let you use the new big green button on this one! (Sounds like it will appear in your interface soon if it hasn't already.)
@dschmitz89 Could you please merge and close this PR?
@fancidev I do not have commit rights, so cannot merge. You could not know that though, that's fine :). Still, I would rather not discuss scipy's ACL openly here.
@fancidev I do not have commit rights, so cannot merge. You could not know that though, that's fine :). Still, I would rather not discuss scipy's ACL openly here.
Understood. I implied that when @mdhaber mentioned about the “new big green button” :-)
Thanks @fancidev !