marginal_graph_sample#
- graph_tool.inference.marginal_graph_sample(g, ep)[git][source]#
Sample a graph from the marginal edge probabilities.
- Parameters:
- g
Graph Marginal graph.
- ep
EdgePropertyMap Edge property map with the marginal probability of each edge (e.g. the property map
"eprob"returned bycollect_marginal()).
- g
- Returns:
- w
EdgePropertyMap Edge property map with values
1for the sampled edges, and0otherwise.
- w
See also
marginal_graph_lprobLog-probability of a marginal graph
marginal_multigraph_sampleSample from the marginal multigraph distribution
UncertainBlockStateNetwork reconstruction with uncertain edges
Notes
Each edge \((i,j)\) is sampled independently with probability \(\pi_{ij}\), given by
ep.This algorithm runs in time \(O(E)\), where \(E\) is the number of edges in
g.Parallel implementation.
If enabled during compilation, this algorithm will run in parallel using OpenMP. See the parallel algorithms section for information about how to control several aspects of parallelization.