def participation_coef(cmatrix, Ci): """ Computes nodal participation coefficient for a binary graph and its corresponding community structure. For a directed graph, computes "out- neighbor" participation coefficient. Only for binary networks. Parameters ---------- cmatrix : adjacency matrix Ci : community structure vector Ci Returns ------- P : Participation coefficient Output for directed graphs: "out-neighbor" participation coef Reference: Guimera R, Amaral L. Nature (2005) 433:895-900. Mika Rubinov, UNSW, 2008 """ m = bct.to_gslm(cmatrix.tolist()) cil = bct.to_gslv(Ci.tolist()) str = bct.participation_coef(m, cil) strnp = bct.from_gsl(str) bct.gsl_free(m) bct.gsl_free(str) return np.asarray(strnp)
def participation_coef(*args): return _bct.participation_coef(*args)
def participation_coef(*args): """participation_coef(gsl_matrix A, gsl_vector Ci) -> gsl_vector""" return _bct.participation_coef(*args)