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

Off-by-one error in Continuous.p? #3

Open
jhauffa opened this issue Apr 30, 2019 · 1 comment
Open

Off-by-one error in Continuous.p? #3

jhauffa opened this issue Apr 30, 2019 · 1 comment
Assignees
Labels

Comments

@jhauffa
Copy link

jhauffa commented Apr 30, 2019

According to the paper of Clauset et al. (both the 2007 and the 2009 version), the PDF of a continuous power-law distribution is defined as (alpha-1)/x_min * (x/x_min)^(-alpha). The current implementation (line 43 of Continuous.java) does not match that definition:
return (exponent() / xMin()) * Math.pow(x / xMin(), -exponent());
Should it be changed to:
return ((exponent() - 1.0) / xMin()) * Math.pow(x / xMin(), -exponent());
?

@pbloem pbloem self-assigned this Apr 30, 2019
@pbloem
Copy link
Member

pbloem commented Apr 30, 2019

Thanks for the pointer. I haven't looked at this code in years, so I can't say for sure. If nothing depends on p() then it's likely just a mistake in a quick implementation of a utility function that's there for completeness. I'll see if I can find some time to dig in soon.

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

No branches or pull requests

2 participants