Hi Tiago,
I would like to thank you for the graph tool. I have a question about the details of get_marginal. Here is my code:
bs = []
def collect_partitions(s):
global bs
bs.append(s.get_bs())
gt.mcmc_equilibrate(state, force_niter=20, mcmc_args=dict(niter=10),
callback=collect_partitions)
# Disambiguate partitions and obtain marginals
pmode = gt.PartitionModeState(bs, nested=True, converge=True)
pv = pmode.get_marginal(g)
# Get consensus estimate
bsp = pmode.get_max_nested()
state = state.copy(bs=bsp)
In my case, there are 18186 nodes in the graph. The state.print_summary() is:
l: 0, N: 18186, B: 7
l: 1, N: 7, B: 2
l: 2, N: 2, B: 1
So I tried pv[43] and it gives me:
array([ 0, 0, 0, 0, 2, 16, 1], dtype=int32)
Does it mean that, in the mcmc process, the node β43β appears in the sixth community for 16 times, in the 5th community for 2 times, and in the 7th community for 1 time?
When I try pv[2], it gives me:
array([ 0, 16, 3], dtype=int32)
Does it mean that, in the mcmc process, the node β2β appears in the 2nd community for 16 times, in the 3rd community for 3 times?
When I try model.state.get_levels()[0].get_blocks()[43], it returns 5. I think it suggests that in the case of get_max_nested(), the node β43β appears in the 5th community (start counting the community from 0), which is the same as the result of pv[43]. Is the community index in the get_marginal() is the same to the get_blocks() if I use the state by get_max_nested()?
How to get the probability of nodes for higher hierarchy? For example, the node β43β is in community 5, I was wondering how to get the marginal index of community 5 as a node in the second layer?