getting marginals for nested PartitionModeState

Hi all,
I have my PartitionModeState for multiple NestedBlockState models. Using pmode.get_marginal(g) I can retrieve the 2d matrix of the node marginals for the deepest level of the nested hierarchy. If M contains the marginals for level 0 and C is a binary matrix with correspondences between level 0 (rows) and any other level (columns), then M @ C gives me the node's marginals for any other level in the hierarchy. As NSBM groups blocks hierarchically, how can I get the marginals of blocks identified at any level for the containing level? e.g. if I have 150 blocks at level 0, what is their marginal for the 33 blocks in level 1? Does this makes any sense?



Dear Davide,