graph_tool.inference.LatentLayerBaseState#
- class graph_tool.inference.LatentLayerBaseState[source]#
Bases:
object
Base 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
is defined aswhere
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
is defined aswhere
is the posterior probability of a multigraph 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
r
controls 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
.