Skip to content
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

Erros in alpha calculation #9

Open
XauTrop opened this issue Nov 4, 2020 · 3 comments
Open

Erros in alpha calculation #9

XauTrop opened this issue Nov 4, 2020 · 3 comments

Comments

@XauTrop
Copy link

XauTrop commented Nov 4, 2020

When using your power law implementation with this data:
[0.0018, 0.0076, 0.0077, .... , 277.89, 546.74]
I got this error:
/usr/local/lib/python3.4/dist-packages/plfit/plfit.py:1012: RuntimeWarning: invalid value encountered in log
alpha = 1.0 + float(nn) * (sum(log(xx/(float(xmin)-0.5))))**-1

This is because your implementation is not working with values below 1?

@keflavich
Copy link
Owner

That's just a warning, but presumably you got alpha=nan? There shouldn't be a problem with xmin<1 generally, but it looks like there is a way to get negatives here... hm.

@XauTrop
Copy link
Author

XauTrop commented Nov 5, 2020

IThanks for the answer. I managed multipliying all the data to get them >1 and of course divide again the xmin. I'am curious if there is a way to get various xmin from the module, like a list of the maximum curvature change in the data, not only the maximum curvature. My data looks like that, and the maximum curvature is not the desired xmin. Thanks in advance.
Return_period

@keflavich
Copy link
Owner

You might want https://github.com/keflavich/plfit/blob/master/plfit/plfit.py#L474 , alphavsks, and https://github.com/keflavich/plfit/blob/master/plfit/plfit.py#L455, xminvsks, to check the best-fit statistic vs. xmin value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants