marginal_graph_lprob#
- graph_tool.inference.marginal_graph_lprob(g, ep, w)[git][source]#
Compute the log-probability of a graph according to 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()).- w
EdgePropertyMap Edge property map with values
1for the edges that are present in the graph, and0otherwise.
- g
- Returns:
- L
float Log-probability of the graph given by
w.
- L
See also
marginal_graph_sampleSample from the marginal graph distribution
marginal_multigraph_lprobLog-probability of a marginal multigraph
UncertainBlockStateNetwork reconstruction with uncertain edges
Notes
The log-probability is computed as
\[\ln P(\boldsymbol w) = \sum_{(i,j)}\left[w_{ij}\ln\pi_{ij} + (1-w_{ij})\ln(1-\pi_{ij})\right],\]where the sum is over the edges of
g, and \(\pi_{ij}\) is given byep.This algorithm runs in time \(O(E)\), where \(E\) is the number of edges in
g.