@@ -393,10 +393,10 @@ which shows the number of nodes and groups in all levels:
.. testoutput:: celegans
l: 0, N: 297, B: 23
l: 1, N: 23, B: 6
l: 2, N: 6, B: 2
l: 3, N: 2, B: 1
l: 0, N: 297, B: 14
l: 1, N: 14, B: 6
l: 2, N: 6, B: 3
l: 3, N: 3, B: 1
The hierarchical levels themselves are represented by individual
:meth:`~graph_tool.inference.BlockState` instances via the
...
...
@@ -410,10 +410,10 @@ The hierarchical levels themselves are represented by individual
.. testoutput:: celegans
<BlockState object with 23 blocks (23 nonempty), degree-corrected, for graph <Graph object, directed, with 297 vertices and 2359 edges at 0x...>, at 0x...>
<BlockState object with 6 blocks (6 nonempty), for graph <Graph object, directed, with 23 vertices and 249 edges at 0x...>, at 0x...>
<BlockState object with 2 blocks (2 nonempty), for graph <Graph object, directed, with 6 vertices and 31 edges at 0x...>, at 0x...>
<BlockState object with 1 blocks (1 nonempty), for graph <Graph object, directed, with 2 vertices and 4 edges at 0x...>, at 0x...>
<BlockState object with 14 blocks (14 nonempty), degree-corrected, for graph <Graph object, directed, with 297 vertices and 2359 edges at 0x...>, at 0x...>
<BlockState object with 6 blocks (6 nonempty), for graph <Graph object, directed, with 14 vertices and 116 edges at 0x...>, at 0x...>
<BlockState object with 3 blocks (3 nonempty), for graph <Graph object, directed, with 6 vertices and 28 edges at 0x...>, at 0x...>
<BlockState object with 1 blocks (1 nonempty), for graph <Graph object, directed, with 3 vertices and 9 edges at 0x...>, at 0x...>
This means that we can inspect the hierarchical partition just as before:
...
...
@@ -428,9 +428,9 @@ This means that we can inspect the hierarchical partition just as before:
.. testoutput:: celegans
10
6
4
2
1
Model selection
...
...
@@ -453,8 +453,8 @@ case of the `C. elegans` network we have
.. testoutput:: model-selection
:options: +NORMALIZE_WHITESPACE
Non-degree-corrected DL: 8498.72893945
Degree-corrected DL: 8302.44951314
Non-degree-corrected DL: 8500.79633202
Degree-corrected DL: 8288.14138981
Since it yields the smallest description length, the degree-corrected
fit should be preferred. The statistical significance of the choice can
...
...
@@ -479,7 +479,7 @@ description length of both fits. In our particular case, we have
.. testoutput:: model-selection
:options: +NORMALIZE_WHITESPACE
ln Λ: -196.279426317
ln Λ: -212.654942209
The precise threshold that should be used to decide when to `reject a
hypothesis <https://en.wikipedia.org/wiki/Hypothesis_testing>`_ is
...
...
@@ -507,11 +507,11 @@ example, for the American football network above, we have:
:options: +NORMALIZE_WHITESPACE
Non-degree-corrected DL: 1725.78502074
Degree-corrected DL: 1772.83605254
ln Λ: -47.0510317979
Degree-corrected DL: 1784.77629595
ln Λ: -58.9912752096
Hence, with a posterior odds ratio of :math:`\Lambda \sim e^{-47} \sim
10^{-20}` in favor of the non-degree-corrected model, it seems like the
Hence, with a posterior odds ratio of :math:`\Lambda \sim e^{-59} \sim
10^{-25}` in favor of the non-degree-corrected model, it seems like the
degree-corrected variant is an unnecessarily complex description for
this network.
...
...
@@ -605,8 +605,8 @@ random partition into 20 groups
.. testoutput:: model-averaging
Change in description length: 22.0565576...
Number of accepted vertex moves: 4490
Change in description length: -4.2327044...
Number of accepted vertex moves: 3887
Although the above is sufficient to implement model averaging, there is a