GithubHelp home page GithubHelp logo

Comments (2)

jeffalstott avatar jeffalstott commented on July 22, 2024

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.

Jophelias avatar Jophelias commented on July 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.