Comments (2)
A power law has the distribution:
p(x) ~ x^a
Stick 0 in for x. What do you get? If a is positive:
p(0) ~ 0^a = 0
If a is negative:
p(0) ~ 0^-a = undefined
From Clauset et al. (right after equation 2.1): "Clearly this density diverges as x → 0".
In a network, a centrality of 0 is a valid value. In a power law distribution, it is not. You'll need to model the density of the 0s using some other method. A typical route would be to build a separate model for "0 vs. non-0", and then use another model for ">0".
SOME of the other distributions implemented in powerlaw
are defined at 0. It's conceivable that one could want to use powerlaw
to fit those distributions to data with zeros. But it's outside of the scope of how powerlaw
is currently constructed; the very first thing that's done is fit the data to a power law. It's possible people would want to fit those other distributions to their whole data set (including 0s), but then they can't directly compare that distributions' goodness of fit to that of the power law; they're using different data! In lieu of a sensible solution to this mathematical and philosophical problem, I'm going to close this issue. If anyone has bright ideas about how to more elegantly address 0s, we can reopen it. A solution to this topic, however, would likely merit publishing an article about it (or at least finding an article that has already been written on the topic).
from powerlaw.
Thank you for such a prompt response Jeff. I really appreciate the comments and the work that goes into this project.
I see the dilemma.
I guess in the absence of a closed form solution for this at the moment, I will set my isolates to have a degree of one and therefore their freeman centrality will be something on the order of 1/n, a very small number which will sidestep the math for now but will likely give me what I need. I imagine this will become an issue for very large sparse networks, but for now I'll figure it out.
If I do publish a paper or run into one related to this topic, I will post under this thread.
Thanks again.
from powerlaw.
Related Issues (20)
- `estimate_discrete` should be False by default or raise a warning for x_min < 6 HOT 1
- p_value not computed from normalizes R HOT 6
- Issue with the x_min
- Curve fitted using power law is far from the data points
- Version label
- Added xmin computation does not work for distributions != power_law/truncated_power_law HOT 1
- power law plot showing fit and all data, not just data from xmin HOT 1
- New user: Why the curvature in power_law.plot_ccdf fit? HOT 14
- Defunct scipy import HOT 1
- threshold in powerlaw fit HOT 1
- Remove or make optional xmin fitting print
- Fitting a powerlaw with the xmax parameter HOT 17
- How to improve the efficiency of the fit.
- Get the estimates when i only have an probability distribution from empirical data
- Some issues in lognormal fit
- how to calculate the R value properly for discrete data
- Feature Request: Return the normalization constant HOT 9
- Please remove print statement on line 341 of powerlaw.py
- parameter1 attribute not set for fit.powerlaw HOT 1
- Can not pass 'bins' keyword to `plot_pdf` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powerlaw.