Compute degree assortativity of graph.
Assortativity measures the similarity of connections in the graph with respect to the node degree.
This is the same as degree_assortativity_coefficient but uses the potentially faster scipy.stats.pearsonr function.
Parameters : | G : NetworkX graph x: string (‘in’,’out’) :
y: string (‘in’,’out’) :
weight: string or None, optional (default=None) :
nodes: list or iterable (optional) :
|
---|---|
Returns : | r : float
|
Notes
This calls scipy.stats.pearsonr.
References
[R114] | M. E. J. Newman, Mixing patterns in networks Physical Review E, 67 026126, 2003 |
[R115] | Foster, J.G., Foster, D.V., Grassberger, P. & Paczuski, M. Edge direction and the structure of networks, PNAS 107, 10815-20 (2010). |
Examples
>>> G=nx.path_graph(4)
>>> r=nx.degree_pearson_correlation_coefficient(G)
>>> r
-0.5