Skip to content

local_assortativity_wu_sign not separating signs properly #125

@ghost

Description

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions