temporal_participation_coeff¶
-
temporal_participation_coeff
(tnet, communities=None, decay=None, removeneg=False)[source]¶ Calculates the temporal participation coefficient
Temporal participation coefficient is a measure of diversity of connections across communities for individual nodes.
Parameters: - tnet (array, dict) – graphlet or contact sequence input. Only positive matrices considered.
- communities (array) – community vector. Either 1D (node) community index or 2D (node,time).
- removeneg (bool (default false)) – If true, all values < 0 are made to be 0.
Returns: P – participation coefficient
Return type: array
Notes
Static participatoin coefficient is:
\[P_i = 1 - \sum_s^{N_M}({{k_{is}}\over{k_i}})^2\]Where s is the index of each community (\(N_M\)). \(k_i\) is total degree of node. And \(k_{is}\) is degree of connections within community.[part-1]_
This “temporal” version only loops through temporal snapshots and calculates \(P_i\) for each t.
If directed, function sums axis=1, so tnet may need to be transposed before hand depending on what type of directed part_coef you are interested in.
References
[part-1] Guimera et al (2005) Functional cartography of complex metabolic networks. Nature. 433: 7028, p895-900. [Link]