Open joheli opened 4 years ago
@jmanitz https://github.com/jmanitz/NetOrigin
Dear Johannes,
Thanks a lot for your comment and careful considerations. You are correct, the effective distance is not a metric in the mathematical sense as it does not fullfill symmetry, other conditions are fullfilled:
Some more theory on the derivation can be found here:
Does that clarify your question?
Best regards from Boston Juliane
Dear Juliane,
thank you so much for your comment and the references - I obviously have to delve deeper into the matter.
Could you maybe comment on the following to further send me on the right track?
NetOrigin::eff_dist
given a directed, weighted graph?Also, how do I interpret the output, i.e. in a matrix of effective distances generated by NetOrigin::eff_dist
A | B | |
---|---|---|
A | X1 | X3 |
B | X2 | X4 |
Is X2 B to A or A to B?
Kind regards,
Johannes
Hi Johannes,
no worries at all, I am happy to help!
The effective distance works for directed and undirected graphs. The implementation is able to accommodate that too. Here a little toy example:
# adjacency matrix with random weights
net <- matrix(nrow=6, ncol=6, data=runif(36))
isSymmetric(net)
# transition probabilties
p <- net/rowSums(net)
image(p)
# effective distance
eff <- eff_dist(p)
image(eff)
Folks I would like to understand how to correctly apply the function
eff_dist
of packageNetOrigin
and there is one step I am not sure of (see below the paragraph in bold).First, let's create a few nodes with random edges and weights:
edges
now looks like this:Now, let's proceed to create a beautiful graph:
The result (
p.gr
) looks like this:The final step(s) are where I am unsure:
ed
looks like this:My question revolves around the creation of
p
: up to this point the matrices have been 'symmetrical' (i.e. the graph has been 'undirected') but now e.g. 'a to b' is not equivalent to 'b to a'. E.g. if you look at the first column (heading 'a') the ranking of the distances (b < e < c) do not correspond to imagep.gr
or tableedges
(where b < c < e).Is this a feature of the function or am I interpreting the output in wrong way?
Thank you for any hints.