aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjeanpouget-abadie <jean.pougetabadie@gmail.com>2015-11-10 18:04:21 -0500
committerjeanpouget-abadie <jean.pougetabadie@gmail.com>2015-11-10 18:04:21 -0500
commit43b07f68505ee10f2fe9fa94f365b27fb72f953c (patch)
tree18baae6021e5431b8d77b653c6d65697946a603b
parentdae606656be0302c97902bf982ad9abaf5a34d1c (diff)
downloadcascades-43b07f68505ee10f2fe9fa94f365b27fb72f953c.tar.gz
small bug fix -> n to n-1
-rw-r--r--simulation/bayes.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/simulation/bayes.py b/simulation/bayes.py
index 82dc0c1..bde9e94 100644
--- a/simulation/bayes.py
+++ b/simulation/bayes.py
@@ -54,7 +54,7 @@ def mc_graph_setup(infected, susceptible, prior=None, *args, **kwargs):
for i in xrange(n_nodes):
for j in xrange(n_nodes):
theta[i, j] = pymc.Beta('theta_{}{}'.format(formatLabel(i,
- n_nodes), formatLabel(j, n_nodes)),
+ n_nodes-1), formatLabel(j, n_nodes-1)),
alpha=1, beta=1)
else:
theta = prior(theta=theta, *args, **kwargs)
@@ -98,7 +98,7 @@ if __name__=="__main__":
else:
ax[i, j].get_xaxis().set_ticks([])
ax[i, j].get_yaxis().set_ticks([])
- it, jt = formatLabel(i, n_nodes), formatLabel(j, n_nodes)
+ it, jt = formatLabel(i, n_nodes-1), formatLabel(j, n_nodes-1)
ax[i,j].hist(mcmc.trace('theta_{}{}'.format(it,jt))[:], normed=True)
ax[i, j].set_xlim([0,1])
ax[i, j].plot([g[i, j]]*2, [0, ax[i,j].get_ylim()[-1]], color='red')