Commit 1c016bc7 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

inference: update expected test results

parent d8007e21
Pipeline #967 passed with stage
in 48 minutes and 48 seconds
......@@ -273,9 +273,9 @@ Therefore, we can compute the posterior odds ratio between both models as:
.. testoutput:: food-web
:options: +NORMALIZE_WHITESPACE
ln Λ: -52.959287...
ln Λ: -83.765635...
A value of :math:`\Lambda \approx \mathrm{e}^{53} \approx 10^{23}` in
A value of :math:`\Lambda \approx \mathrm{e}^{83} \approx 10^{36}` in
favor the exponential model indicates that the log-normal model does not
provide a better fit for this particular data.
......
......@@ -207,10 +207,10 @@ which shows the number of nodes and groups in all levels:
.. testoutput:: celegans
l: 0, N: 297, B: 15
l: 1, N: 15, B: 6
l: 2, N: 6, B: 2
l: 3, N: 2, B: 1
l: 0, N: 297, B: 26
l: 1, N: 26, B: 9
l: 2, N: 9, B: 3
l: 3, N: 3, B: 1
l: 4, N: 1, B: 1
The hierarchical levels themselves are represented by individual
......@@ -227,11 +227,11 @@ The hierarchical levels themselves are represented by individual
.. testoutput:: celegans
<BlockState object with 297 blocks (15 nonempty), degree-corrected, for graph <Graph object, directed, with 297 vertices and 2359 edges, 2 internal vertex properties, 1 internal edge property, 2 internal graph properties, at 0x...>, at 0x...>
<BlockState object with 15 blocks (6 nonempty), for graph <Graph object, directed, with 297 vertices and 125 edges, 2 internal vertex properties, 1 internal edge property, at 0x...>, at 0x...>
<BlockState object with 8 blocks (2 nonempty), for graph <Graph object, directed, with 15 vertices and 32 edges, 2 internal vertex properties, 1 internal edge property, at 0x...>, at 0x...>
<BlockState object with 2 blocks (1 nonempty), for graph <Graph object, directed, with 8 vertices and 4 edges, 2 internal vertex properties, 1 internal edge property, at 0x...>, at 0x...>
<BlockState object with 1 blocks (1 nonempty), for graph <Graph object, directed, with 2 vertices and 1 edge, 2 internal vertex properties, 1 internal edge property, at 0x...>, at 0x...>
<BlockState object with 297 blocks (26 nonempty), degree-corrected, for graph <Graph object, directed, with 297 vertices and 2359 edges, 2 internal vertex properties, 1 internal edge property, 2 internal graph properties, at 0x...>, at 0x...>
<BlockState object with 26 blocks (9 nonempty), for graph <Graph object, directed, with 297 vertices and 274 edges, 2 internal vertex properties, 1 internal edge property, at 0x...>, at 0x...>
<BlockState object with 9 blocks (3 nonempty), for graph <Graph object, directed, with 26 vertices and 59 edges, 2 internal vertex properties, 1 internal edge property, at 0x...>, at 0x...>
<BlockState object with 3 blocks (1 nonempty), for graph <Graph object, directed, with 9 vertices and 9 edges, 2 internal vertex properties, 1 internal edge property, at 0x...>, at 0x...>
<BlockState object with 1 blocks (1 nonempty), for graph <Graph object, directed, with 3 vertices and 1 edge, 2 internal vertex properties, 1 internal edge property, at 0x...>, at 0x...>
This means that we can inspect the hierarchical partition just as before:
......@@ -246,9 +246,9 @@ This means that we can inspect the hierarchical partition just as before:
.. testoutput:: celegans
278
4
4
197
6
8
Refinements using merge-split MCMC
++++++++++++++++++++++++++++++++++
......@@ -283,7 +283,7 @@ to the above minimization for the `C. elegans` network is the following:
.. testoutput:: celegans-mcmc
Improvement: -36.887009...
Improvement: -122.83984...
Whenever possible, this procedure should be repeated several times, and
the result with the smallest description length (obtained via the
......
......@@ -110,8 +110,8 @@ show in the example below.
.. testoutput:: model-evidence
Model log-evidence for deg_corr = True: -678.633834...
Model log-evidence for deg_corr = False: -670.190510...
Model log-evidence for deg_corr = True: -679.052588...
Model log-evidence for deg_corr = False: -672.773743...
The outcome shows a preference for the non-degree-corrected model.
......@@ -168,8 +168,8 @@ approach for the same network, using the nested model.
.. testoutput:: nested-model-evidence
Model log-evidence for deg_corr = True: -666.147684...
Model log-evidence for deg_corr = False: -657.426243...
Model log-evidence for deg_corr = True: -666.444281...
Model log-evidence for deg_corr = False: -656.553775...
The results are similar: The non-degree-corrected model possesses the
largest evidence. Note also that we observe a better evidence for the
......
......@@ -10,7 +10,7 @@ we have
.. testsetup:: model-selection
gt.seed_rng(43)
gt.seed_rng(44)
.. testcode:: model-selection
......@@ -25,10 +25,10 @@ we have
.. testoutput:: model-selection
:options: +NORMALIZE_WHITESPACE
Non-degree-corrected DL: 8550.039909...
Degree-corrected DL: 8204.289347...
Non-degree-corrected DL: 8526.689850...
Degree-corrected DL: 8667.387042...
Since it yields the smallest description length, the degree-corrected
Since it yields the smallest description length, the non-degree-corrected
fit should be preferred. The statistical significance of the choice can
be accessed by inspecting the posterior odds ratio
[peixoto-nonparametric-2017]_
......@@ -52,13 +52,13 @@ fits. In our particular case, we have
.. testoutput:: model-selection
:options: +NORMALIZE_WHITESPACE
ln Λ: -345.750561...
ln Λ: 140.697191...
The precise threshold that should be used to decide when to `reject a
hypothesis <https://en.wikipedia.org/wiki/Hypothesis_testing>`_ is
subjective and context-dependent, but the value above implies that the
particular degree-corrected fit is around :math:`\mathrm{e}^{345}
\approx 10^{149}` times more likely than the non-degree corrected one,
particular non-degree-corrected fit is around :math:`\mathrm{e}^{140}
\approx 10^{60}` times more likely than the non-degree corrected one,
and hence it can be safely concluded that it provides a substantially
better fit.
......@@ -80,9 +80,9 @@ example, for the American football network above, we have:
.. testoutput:: model-selection
:options: +NORMALIZE_WHITESPACE
Non-degree-corrected DL: 1733.525685...
Degree-corrected DL: 1780.964656...
ln Λ: -47.438970...
Non-degree-corrected DL: 1733.525685...
Degree-corrected DL: 1780.576716...
ln Λ: -47.051031...
Hence, with a posterior odds ratio of :math:`\Lambda \approx
\mathrm{e}^{-47} \approx 10^{-21}` in favor of the non-degree-corrected
......
......@@ -136,8 +136,8 @@ above).
.. testoutput:: missing-edges
likelihood-ratio for (101, 102): 0.0202066
likelihood-ratio for (17, 56): 0.979793
likelihood-ratio for (101, 102): 0.0199639
likelihood-ratio for (17, 56): 0.980036
From which we can conclude that edge :math:`(17, 56)` is more likely
than :math:`(101, 102)` to be a missing edge.
......
......@@ -189,9 +189,9 @@ Which yields the following output:
.. testoutput:: measured
Posterior probability of edge (11, 36): 0.377937...
Posterior probability of non-edge (15, 73): 0.0
Estimated average local clustering: 0.571134 ± 0.002860...
Posterior probability of edge (11, 36): 0.555355...
Posterior probability of non-edge (15, 73): 0.091109...
Estimated average local clustering: 0.570987 ± 0.004233...
We have a successful reconstruction, where both ambiguous adjacency
......@@ -313,9 +313,9 @@ Which yields:
.. testoutput:: measured
Posterior probability of edge (11, 36): 0.414341...
Posterior probability of edge (11, 36): 0.643764...
Posterior probability of non-edge (15, 73): 0.0
Estimated average local clustering: 0.57138 ± 0.003014...
Estimated average local clustering: 0.573348 ± 0.004569...
The results are very similar to the ones obtained with the uniform model
in this case, but can be quite different in situations where a large
......@@ -439,9 +439,9 @@ The above yields the output:
.. testoutput:: uncertain
Posterior probability of edge (11, 36): 0.699969...
Posterior probability of non-edge (15, 73): 0.0
Estimated average local clustering: 0.540214 ± 0.028586...
Posterior probability of edge (11, 36): 0.817281...
Posterior probability of non-edge (15, 73): 0.011501...
Estimated average local clustering: 0.564856 ± 0.013842...
The reconstruction is accurate, despite the two ambiguous entries having
the same measurement probability. The reconstructed network is visualized below.
......@@ -718,8 +718,8 @@ Which yields the following output:
.. testoutput:: measured-closure
Posterior probability of edge (11, 36): 0.915691...
Posterior probability of edge (11, 36): 0.992899...
Posterior probability of non-edge (15, 73): 0.0
Estimated average local clustering: 0.573308 ± 0.002496...
Estimated average local clustering: 0.575197 ± 0.004423...
.. include:: _reconstruction_dynamics.rst
......@@ -146,8 +146,8 @@ The reconstruction can accurately recover the hidden network and the infection p
.. testoutput:: dynamics
Posterior similarity: 0.984240...
Inferred infection probability: 0.690546 ± 0.0476793
Posterior similarity: 0.993689...
Inferred infection probability: 0.695153 ± 0.031080...
The figure below shows the reconstructed network and the inferred community structure.
......
......@@ -60,8 +60,8 @@ from a random partition into 20 groups
.. testoutput:: model-averaging
Change in description length: -77.095673...
Number of accepted vertex moves: 128045
Change in description length: -63.994946...
Number of accepted vertex moves: 129331
Although the above is sufficient to implement sampling from the
posterior, there is a convenience function called
......@@ -195,8 +195,8 @@ network as above.
.. testoutput:: nested-model-averaging
Change in description length: -73.911066...
Number of accepted vertex moves: 435339
Change in description length: -77.642347...
Number of accepted vertex moves: 499175
.. warning::
......@@ -383,10 +383,11 @@ corresponding to their collective posterior probability.
.. testoutput:: partition-modes
Mode 0 with size 0.493493...
Mode 1 with size 0.352352...
Mode 2 with size 0.121121...
Mode 3 with size 0.033033...
Mode 0 with size 0.486486...
Mode 1 with size 0.317317...
Mode 2 with size 0.139139...
Mode 3 with size 0.054054...
Mode 4 with size 0.003003...
Below are the marginal node distributions representing the partitions that belong to each inferred mode:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment