For undirected networks with self-loops, the function Network.transition_matrix() returns a wrong transition matrix, where rows do not sum to one.
Minimal example to reproduce:
n = pp.Network()
n.add_edge('a', 'b')
n.add_edge('a', 'a')
print(n.transition_matrix())
returns a transition matrix, where the row corresponding to node a sums to 1.5.
The reason for this bug is that in Network.transition_matrix() the entry for the self-loop is added twice, thus doubling ist weight in the Transition matrix.
For undirected networks with self-loops, the function
Network.transition_matrix()
returns a wrong transition matrix, where rows do not sum to one.Minimal example to reproduce:
returns a transition matrix, where the row corresponding to node a sums to 1.5.
The reason for this bug is that in
Network.transition_matrix()
the entry for the self-loop is added twice, thus doubling ist weight in the Transition matrix.