get_distribution_from_path {triversity} | R Documentation |
Compute the probability distribution associated to a random walk following a path between the levels of a tripartite graph.
Description
get_distribution_from_path
computes the probability distribution of a random walk within
the different levels of the input tripartite
graph. It starts at a given level with an
initial probability distribution, then randomly follows the links of the graph between the
different levels according to the input path
, then stops at the last specified level.
Usage
get_distribution_from_path(tripartite, path, initial_distribution = NULL,
initial_node = NULL)
Arguments
tripartite |
A tripartite graph obtained by calling the |
path |
A vector of integers in { |
initial_distribution |
A vector of floats in [ |
initial_node |
A string giving the name of a node in the first level of the input
|
Value
A vector of floats in [0
,1
] and summing to 1
giving the probability distribution of the
random walk when arriving at the last level, after having followed the input path
within
the different levels of the graph.
Examples
data (tripartite_example)
tripartite <- get_tripartite (data=tripartite_example)
get_distribution_from_path (tripartite, path=c(2,1,2,3))
get_distribution_from_path (tripartite, path=c(2,1,2,3), initial_distribution=c(0.25,0,0.25,0.5))
get_distribution_from_path (tripartite, path=c(2,1,2,3), initial_node='i2')