marginal_multigraph_lprob#
- graph_tool.inference.marginal_multigraph_lprob(g, ews, ecount, ew)[git][source]#
Compute the log-probability of edge multiplicities according to the marginal latent multigraph distribution.
- Parameters:
- g
Graph Marginal multigraph.
- ews
EdgePropertyMap Vector-valued edge property map containing the observed edge multiplicities.
- ecount
EdgePropertyMap Vector-valued edge property map containing the counts of each multiplicity in
ews. The property map"wcount"returned bycollect_marginal_multigraph()is indexed by the multiplicity itself, so that it is used together withews[e] = range(len(wcount[e])).- ew
EdgePropertyMap Edge multiplicities whose probability will be computed.
- g
- Returns:
- L
float Log-probability of the edge multiplicities
ew.
- L
See also
marginal_multigraph_sampleSample from the marginal multigraph distribution
marginal_multigraph_entropyEntropy of the marginal multigraph distribution
marginal_graph_lprobLog-probability of a marginal graph
Notes
The log-probability is computed as
\[\ln P(\boldsymbol w) = \sum_{(i,j)}\ln \pi_{ij}(w_{ij}),\]where the sum is over the edges of
g, and\[\pi_{ij}(w) = \frac{n_{ij}(w)}{\sum_{w'}n_{ij}(w')},\]with \(n_{ij}(w)\) being the count of multiplicity \(w\), given by
ecount. If a multiplicity inewhas not been observed for its edge, the value \(-\infty\) will be returned.This algorithm runs in time \(O(\sum_{ij}k_{ij})\), where \(k_{ij}\) is the number of distinct multiplicities observed for edge \((i,j)\).
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.