netneurotools.metrics.mean_first_passage_time

netneurotools.metrics.mean_first_passage_time(W, tol=0.001)[source]

Calculate mean first passage time.

The first passage time from i to j is the expected number of steps it takes a random walker starting at node i to arrive for the first time at node j. The mean first passage time is not a symmetric measure: mfpt(i,j) may be different from mfpt(j,i).

This function is adapted and optimized from the Brain Connectivity Toolbox.

Warning

Test before use.

Parameters:
  • W ((N x N) ndarray) – Weighted/unweighted, direct/undirected connection weight/length array

  • tol (float, optional) – Tolerance for eigenvalue of 1. Default: 1e-3

Returns:

mfpt – Pairwise mean first passage time array

Return type:

(N x N) ndarray

References