scipy icon indicating copy to clipboard operation
scipy copied to clipboard

ENH: use analytical formula in scipy.stats.powerlaw._munp().

Open fancidev opened this issue 1 year ago • 5 comments

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.

fancidev avatar Feb 06 '24 22:02 fancidev

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.

fancidev avatar Feb 08 '24 10:02 fancidev

@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.)

mdhaber avatar Feb 10 '24 21:02 mdhaber

@dschmitz89 Could you please merge and close this PR?

fancidev avatar Feb 19 '24 05:02 fancidev

@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.

dschmitz89 avatar Feb 21 '24 07:02 dschmitz89

@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” :-)

fancidev avatar Feb 21 '24 09:02 fancidev

Thanks @fancidev !

dschmitz89 avatar Mar 03 '24 07:03 dschmitz89