get_transition_from_path: Compute the transition matrix of a random walk following a...

Description Usage Arguments Details Value Examples

Description

get_transition_from_path computes the transition matrix of a random walk following a path between the different parts of the input multipartite graph.

Usage

1

Arguments

graph

A multipartite graph obtained by calling the get_multipartite function.

path

A vector of character strings giving the path that the random walk should follow between the different parts of the input multipartite graph. This path can be as long as wanted, with eventual cycles, and each string it contains should refer to a label in graph$parts.

Details

Note that the multipartite graph structure implemented in this package stores in memory any computed transition matrix to avoid redundant computation in the future. Hence, the latter execution of get_transition_from_path, or of any other function that builds on it, can be much faster than the first call. The transition matrices are stored within a data.tree in the input graph variable (see graph$edges).

Value

A matrix of floats in [0,1], with all lines summing to 1, giving the transition matrix of the random walk following the input path.

Examples

1
2
3
4
data (tripartite_example)
graph <- get_multipartite (data=tripartite_example)

as.matrix (get_transition_from_path (graph, path=c(2,1,2,3)))

Lamarche-Perrin/triversity documentation built on May 22, 2019, 12:36 p.m.