Commit 31038455 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Fix typo in inference HOWTO

This fixes issue #683
parent 6ddf1e63
......@@ -108,7 +108,7 @@ the weights, as follows:
.. testcode:: weighted-model
g = gt.collection.konect_data["moreno_train"]
g = gt.collection.ns["train_terrorists"]
# This network contains an internal edge property map with name
# "weight" that contains the strength of interactions. The values
......@@ -168,7 +168,7 @@ follows:
.. testcode:: food-web
g = gt.collection.konect_data["foodweb-baywet"]
g = gt.collection.ns["foodweb_baywet"]
# This network contains an internal edge property map with name
# "weight" that contains the energy flow between species. The values
......@@ -224,7 +224,7 @@ can fit this alternative model simply by using the transformed weights:
rec_types=["real-normal"]))
# improve solution with merge-split
state_ln = state.copy(bs=state.get_bs() + [np.zeros(1)] * 4, sampling=True)
state_ln = state.copy(bs=state_ln.get_bs() + [np.zeros(1)] * 4, sampling=True)
for i in range(100):
ret = state_ln.multiflip_mcmc_sweep(niter=10, beta=np.inf)
......@@ -276,9 +276,9 @@ Therefore, we can compute the posterior odds ratio between both models as:
.. testoutput:: food-web
:options: +NORMALIZE_WHITESPACE
ln Λ: 16490.463643...
ln Λ: 16506.096401...
A value of :math:`\Lambda \approx \mathrm{e}^{16490} \approx 10^{7161}`
A value of :math:`\Lambda \approx \mathrm{e}^{16506} \approx 10^{7168}`
in favor the log-normal model indicates that the exponential model does
not provide a better fit for this particular data. Based on this, we
conclude that the log-normal model should be preferred in this case.
......@@ -293,7 +293,7 @@ initialization, e.g..
.. testcode:: weighted-model
g = gt.collection.konect_data["foodweb-baywet"]
g = gt.collection.ns["foodweb_baywet"]
state = gt.NestedBlockState(g, state_args=dict(recs=[g.ep.weight], rec_types=["real-exponential"]))
......
......@@ -37,7 +37,7 @@ separating these two types of interactions in two layers:
.. testcode:: layered-model
g = gt.collection.konect_data["ucidata-gama"]
g = gt.collection.ns["new_guinea_tribes"]
# The edge types are stored in the edge property map "weights".
......
......@@ -158,7 +158,7 @@ simple example, using
state = gt.MeasuredBlockState(g, n=n, n_default=1, x=x, x_default=0)
# We will first equilibrate the Markov chain
gt.mcmc_equilibrate(state, wait=1000, mcmc_args=dict(niter=10))
gt.mcmc_equilibrate(state, wait=10000, mcmc_args=dict(niter=10))
# Now we collect the marginals for exactly 100,000 sweeps, at
# intervals of 10 sweeps:
......@@ -187,9 +187,9 @@ Which yields the following output:
.. testoutput:: measured
Posterior probability of edge (11, 36): 0.768976...
Posterior probability of non-edge (15, 73): 0.039203...
Estimated average local clustering: 0.571939 ± 0.003534...
Posterior probability of edge (11, 36): 0.829782...
Posterior probability of non-edge (15, 73): 0.058105...
Estimated average local clustering: 0.572087 ± 0.003632...
We have a successful reconstruction, where both ambiguous adjacency
matrix entries are correctly recovered. The value for the average
......@@ -310,9 +310,9 @@ Which yields:
.. testoutput:: measured
Posterior probability of edge (11, 36): 0.631563...
Posterior probability of non-edge (15, 73): 0.022402...
Estimated average local clustering: 0.570065 ± 0.007145...
Posterior probability of edge (11, 36): 0.655165...
Posterior probability of non-edge (15, 73): 0.013301...
Estimated average local clustering: 0.553358 ± 0.01615...
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
......
Markdown is supported
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