avg_combined_corr#
- graph_tool.correlations.avg_combined_corr(g, deg1, deg2, bins=[0, 1])[source]#
Obtain the single-vertex combined correlation histogram for the given graph.
- Parameters:
- g
Graph Graph to be used.
- deg1string or
VertexPropertyMap first degree type (“in”, “out” or “total”) or vertex property map.
- deg2string or
VertexPropertyMap second degree type (“in”, “out” or “total”) or vertex property map.
- binslist (optional, default: [0, 1])
Bins to be used for the first degrees. If the list has size 2, it is used as the constant width of an automatically generated bin range, starting from the first value.
- g
- Returns:
- bin_avg
numpy.ndarray Array with the deg2 average for the deg1 bins.
- bin_dev
numpy.ndarray Array with the standard deviation of the deg2 average for the deg1 bins.
- bins
numpy.ndarray The deg1 bins.
- bin_avg
See also
assortativityassortativity coefficient
scalar_assortativityscalar assortativity coefficient
corr_histvertex-vertex correlation histogram
combined_corr_histcombined single-vertex correlation histogram
avg_neighbor_corraverage nearest-neighbor correlation
avg_combined_corraverage combined single-vertex correlation
Notes
Parallel implementation.
If enabled during compilation, this algorithm will run in parallel using OpenMP. See the parallel algorithms section for information about how to control several aspects of parallelization.
Examples
>>> def sample_k(max): ... accept = False ... while not accept: ... i = np.random.randint(1,max+1) ... j = np.random.randint(1,max+1) ... accept = np.random.random() < (sin(i/pi)*sin(j/pi)+1)/2 ... return i,j ... >>> g = gt.random_graph(10000, lambda: sample_k(40)) >>> h = gt.avg_combined_corr(g, "in", "out") >>> clf() >>> xlabel("In-degree") Text(...) >>> ylabel("Out-degree") Text(...) >>> errorbar(h[2][:-1], h[0], yerr=h[1], fmt="o") <...> >>> savefig("combined_avg_corr.svg")
Average combined in/out-degree correlation.#