View source: R/get_distance_matrix.R
get_distance_matrix_from_T | R Documentation |
Returns a matrix where each entry encodes the diffusion distance between two nodes of a network, given a transition matrix on the network and a diffusion time.
The diffusion distance at time τ between nodes i, j \in G is defined as
D_{τ}(i, j) = \vert \mathbf{p}(t|i) - \mathbf{p}(t|j) \vert_2
with \mathbf{p}(t|i) = (e^{- τ L})_{i\cdot} = \mathbf{e}_i e^{- τ L} indicating the i-th row of the stochastic matrix e^{- τ L} and representing the probability (row) vector of a random walk dynamics corresponding to the initial condition \mathbf{e}_i, i.e. the random walker is in node i at time τ = 0 with probability 1.
The Laplacian L is the normalised laplacian corresponding to the given transition matrix, i.e. L = I - Pi.
get_distance_matrix_from_T(Pi, tau, verbose = TRUE) get_DDM_from_T(Pi, tau, verbose = TRUE) get_distance_matrix_from_Pi(Pi, tau, verbose = TRUE) get_DDM_from_Pi(Pi, tau, verbose = TRUE)
Pi |
a transition matrix (it should be a stochastic matrix) |
tau |
diffusion time |
verbose |
default TRUE |
The diffusion distance matrix D_t, a square numeric matrix
of the L^2-norm distances between posterior probability vectors, i.e.
Euclidean distances between the rows of the stochastic matrix
P(t) = e^{-τ L}, where -L = -(I - T) is the generator of the
continuous-time random walk (Markov chain) corresponding to the
discrete-time transition matrix T=Pi
.
De Domenico, M. (2017). Diffusion Geometry Unravels the Emergence of Functional Clusters in Collective Phenomena. Physical Review Letters. doi: 10.1103/PhysRevLett.118.168301
Bertagnolli, G., & De Domenico, M. (2021). Diffusion geometry of multiplex and interdependent systems. Physical Review E, 103(4), 042301. doi: 10.1103/PhysRevE.103.042301 arXiv: 2006.13032
get_distance_matrix get_diffusion_probability_matrix,
get_diffusion_probability_matrix_from_T
g <- igraph::sample_pa(10, directed = FALSE) dm <- get_distance_matrix(g, tau = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.