harissa.model.tree module#

Generate random trees

Functions#

loop_erasure

Compute the loop erasure of a given path.

random_step

Make one step of the random walk on the weighted graph defined by a.

random_tree

Generate a random spanning tree rooted in node 0 from the uniform distribution with weights given by matrix a (using Wilson's method).

tree

Generate a random tree-like network model.

harissa.model.tree.loop_erasure(path)[source]#

Compute the loop erasure of a given path.

harissa.model.tree.random_step(state, a)[source]#

Make one step of the random walk on the weighted graph defined by a. NB: here we construct an in-tree so all directions are reversed.

harissa.model.tree.random_tree(a)[source]#

Generate a random spanning tree rooted in node 0 from the uniform distribution with weights given by matrix a (using Wilson’s method).

harissa.model.tree.tree(n_genes, weight=None)[source]#

Generate a random tree-like network model. A tree with root 0 is sampled from the ‘weighted-uniform’ distribution, where weight[i,j] is the probability weight of link (i) -> (j).