graph_tool.inference.LatentLayerBaseState#
- class graph_tool.inference.LatentLayerBaseState[source]#
Bases:
objectBase state for uncertain latent layer network inference.
Methods
collect_marginal([gs, total])Collect marginal inferred network during MCMC runs.
Collect marginal latent multigraphs during MCMC runs.
get_ec([ew])Return edge property map with layer membership.
mcmc_sweep([r, multiflip])Perform sweeps of a Metropolis-Hastings acceptance-rejection sampling MCMC to sample network partitions and latent edges.
multiflip_mcmc_sweep(**kwargs)Alias for
mcmc_sweep()withmultiflip=True.- collect_marginal(gs=None, total=False)[source]#
Collect marginal inferred network during MCMC runs.
- Parameters:
- glist of
Graph(optional, default:None) Previous marginal graphs.
- glist of
- Returns:
- glist
Graph New list of marginal graphs, each with internal edge
EdgePropertyMap"eprob", containing the marginal probabilities for each edge.
- glist
Notes
The posterior marginal probability of an edge \((i,j)\) is defined as
\[\pi_{ij} = \sum_{\boldsymbol A}A_{ij}P(\boldsymbol A|\boldsymbol D)\]where \(P(\boldsymbol A|\boldsymbol D)\) is the posterior probability given the data.
This function returns a list with the marginal graphs for every layer.
- collect_marginal_multigraph(gs=None)[source]#
Collect marginal latent multigraphs during MCMC runs.
- Parameters:
- glist of
Graph(optional, default:None) Previous marginal multigraphs.
- glist of
- Returns:
- glist of
Graph New marginal multigraphs, each with internal edge
EdgePropertyMap"w"and"wcount", containing the edge multiplicities and their respective counts.
- glist of
Notes
The mean posterior marginal multiplicity distribution of a multi-edge \((i,j)\) is defined as
\[\pi_{ij}(w) = \sum_{\boldsymbol G}\delta_{w,G_{ij}}P(\boldsymbol G|\boldsymbol D)\]where \(P(\boldsymbol G|\boldsymbol D)\) is the posterior probability of a multigraph \(\boldsymbol G\) given the data.
This function returns a list with the marginal graphs for every layer.
- mcmc_sweep(r=0.5, multiflip=True, **kwargs)[source]#
Perform sweeps of a Metropolis-Hastings acceptance-rejection sampling MCMC to sample network partitions and latent edges. The parameter
rcontrols the probability with which edge move will be attempted, instead of partition moves. The remaining keyword parameters will be passed tomcmc_sweep()ormultiflip_mcmc_sweep(), ifmultiflip=True.
- multiflip_mcmc_sweep(**kwargs)[source]#
Alias for
mcmc_sweep()withmultiflip=True.