Git Product home page Git Product logo

Comments (3)

aestrivex avatar aestrivex commented on July 22, 2024

Hi,

I have no doubt your formulation is clearer than the code currently (which
is directly modeled off of BCT matlab code) but can you point out
explicitly where is the error in parenthesis?

On Tue, Mar 31, 2015 at 5:18 PM, birkantunc [email protected]
wrote:

Hi,

For both assortativity_bin and assortativity_wei, there is a mistake in
calculation of "r"

Right formulation is

term1 = np.sum(degi
degj)/K term2 = np.square(np.sum(.5(degi+degj))/K)
term3 = np.sum(.5_(degi_degi+degj*degj))/K
r = (term1 - term2) / (term3 - term2)

for binary and

term1 = np.sum(stri
strj)/K term2 = np.square(np.sum(.5(stri+strj))/K)
term3 = np.sum(.5_(stri_stri+strj*strj))/K
r = (term1 - term2) / (term3 - term2)

for weighted matrices.

Regards,
Birkan


Reply to this email directly or view it on GitHub
#7.

from bctpy.

birkantunc avatar birkantunc commented on July 22, 2024

Hi,

Sorry for not giving the details.

In the original form it is

r=(( np.sum(degi_degj)/K - np.square(np.sum(.5_(degi+degj))/K)) /
np.sum(.5_(degi_degi+degj_degj))/K - np.square(sum(.5_(degi+degj))/K))

It should be

r=( np.sum(degi_degj)/K - np.square(np.sum(.5_(degi+degj))/K)) /
(np.sum(.5_(degi_degi+degj_degj))/K - np.square(sum(.5_(degi+degj))/K))

i.e. first parenthesis should be moved to the beginning of the denominator. The correct form is
(t1 - t2) /(t3 - t4)
but currently it is
((t1 - t2) / t3 - t4)
Thus, results are not in the range of [-1, 1] as it should be. Again, since always t4 = t2, you do not need to calculate it twice.

from bctpy.

aestrivex avatar aestrivex commented on July 22, 2024

You are right, thanks.

from bctpy.

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.