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

local_assortativity_wu_sign not separating signs properly #125

Open
ghost opened this issue Sep 28, 2023 · 0 comments
Open

local_assortativity_wu_sign not separating signs properly #125

ghost opened this issue Sep 28, 2023 · 0 comments

Comments

@ghost
Copy link

ghost commented Sep 28, 2023

In computing the local assortativity for signed, unweighted networks, local_assortativity_wu_sign executes the following two lines
r_pos = assortativity_wei(W * (W > 0))
r_neg = assortativity_wei(W * (W < 0))

np.isnan(r_neg).any()) would return True no matter what network I input into this function.

In the second line, the array passed to assortativity_wei has strictly negative values. In assortativity_wei, we compute
i, j = np.where(np.triu(CIJ, 1) > 0)

This will always give back i = j = 0. I would get divide by 0 warnings when this function divided by K = len(i) in later steps.

I made the methods functional by adding a negative sign to the argument where we find r_neg, i.e.,
r_neg = assortativity_wei(-W * (W < 0))
But I don't know if this compromises the statistics.

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

0 participants