brainconn.core.assortativity_wei

assortativity_wei(CIJ, flag=0)[source]

The assortativity coefficient is a correlation coefficient between the strengths (weighted degrees) of all nodes on two opposite ends of a link. A positive assortativity coefficient indicates that nodes tend to link to other nodes with the same or similar strength.

Parameters:
  • CIJ (NxN numpy.ndarray) – weighted directed/undirected connection matrix
  • flag (int) – 0 : undirected graph; strength/strength correlation 1 : directed graph; out-strength/in-strength correlation 2 : directed graph; in-strength/out-strength correlation 3 : directed graph; out-strength/out-strength correlation 4 : directed graph; in-strength/in-strengthn correlation
Returns:

r – assortativity coefficient

Return type:

float

Notes

The main diagonal should be empty. For flag 1
the function computes the directed assortativity described in Rubinov and Sporns (2010) NeuroImage.