degrees
degree_assortativity
¶
Calculate the degree assortativity
Source code in src/pathpyG/statistics/degrees.py
degree_central_moment
¶
Calculates the k-th central moment of the degree distribution.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
graph
|
pathpyG.core.graph.Graph
|
The graph for which to calculate the k-th central moment |
required |
Source code in src/pathpyG/statistics/degrees.py
degree_distribution
¶
Calculates the degree distribution of a graph
Source code in src/pathpyG/statistics/degrees.py
degree_generating_function
¶
Returns the generating function of the degree distribution of a network, calculated for either a single argument x or a list or numpy array of arguments x
Returns f(x) where f is the probability generating function for the degree distribution P(k) for a graph. The function is defined in the interval [0,1]. The value returned is from the range [0,1]. The following properties hold:
[1/k! d^k/dx f]_{x=0} = P(k) with d^k/dx f being the k-th derivative of f by x
f'(1) =
[(x d/dx)^m f]_{x=1} =
Parameters:
Name | Type | Description | Default |
---|---|---|---|
graph
|
pathpyG.core.graph.Graph
|
The graph for which the generating function shall be computed |
required |
float, list, numpy.ndarray
The argument(s) for which value(s) f(x) shall be computed.
Example:
# Generate simple network
import pathpyG as pp
import numpy as np
import matplotlib.pyplot as plt
g = pp.Graph.from_edge_list([('a', 'b'), ('b', 'c'), ('a', 'c'), ('c', 'd'),
('d', 'e'), ('d', 'f'), ('e', 'f')]).to_undirected()
# Return single function value
val = pp.statistics.degreee_generating_func(n, 0.3)
print(val)
0.069
# Plot generating function of degree distribution
x = np.linspace(0, 1, 20)
y = pp.statistics.degree_generating_func(n, x)
x = plt.plot(x, y)
# [Function plot]
# Plot generating function based on degree sequence
x = np.linspace(0, 1, 20)
y = pp.statistics.degree_generating_func([1,2,1,2], x)
x = plt.plot(x, y)
# [Function plot]
Source code in src/pathpyG/statistics/degrees.py
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 |
|
degree_raw_moment
¶
Calculates the k-th raw moment of the degree distribution of a network
Parameters:
Name | Type | Description | Default |
---|---|---|---|
graph
|
pathpyG.core.graph.Graph
|
The graph in which to calculate the k-th raw moment |
required |
Source code in src/pathpyG/statistics/degrees.py
degree_sequence
¶
Calculates the degree sequence of an undirected network.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
graph
|
The |
required |