brainconn.clustering
.clustering_coef_wu_sign¶
-
clustering_coef_wu_sign
(W, coef_type='default')[source]¶ Returns the weighted clustering coefficient generalized or separated for positive and negative weights.
Three Algorithms are supported; herefore referred to as default, zhang, and constantini.
- Default (Onnela et al.), as in the traditional clustering coefficient computation. Computed separately for positive and negative weights.
- Zhang & Horvath. Similar to Onnela formula except weight information incorporated in denominator. Reduces sensitivity of the measure to weights directly connected to the node of interest. Computed separately for positive and negative weights.
- Constantini & Perugini generalization of Zhang & Horvath formula. Takes both positive and negative weights into account simultaneously. Particularly sensitive to non-redundancy in path information based on sign. Returns only one value.
Parameters: - W (NxN
numpy.ndarray
) – weighted undirected connection matrix - corr_type ({'default', 'zhang', 'constantini'}) – Allowed values are ‘default’, ‘zhang’, ‘constantini’
Returns: - Cpos (Nx1
numpy.ndarray
) – Clustering coefficient vector for positive weights - Cneg (Nx1
numpy.ndarray
) – Clustering coefficient vector for negative weights, unless coef_type == ‘constantini’. - References – Onnela et al. (2005) Phys Rev E 71:065103 Zhang & Horvath (2005) Stat Appl Genet Mol Biol 41:1544-6115 Costantini & Perugini (2014) PLOS ONE 9:e88669