diff options
| author | jeanpouget-abadie <jean.pougetabadie@gmail.com> | 2015-11-10 16:42:12 -0500 |
|---|---|---|
| committer | jeanpouget-abadie <jean.pougetabadie@gmail.com> | 2015-11-10 16:42:12 -0500 |
| commit | 82b14ab18ccfd032f817979ec0ce74f274b69c3d (patch) | |
| tree | 6ab8aee6e6c189c7957ee2b05b062c833ca959a5 /simulation/bayes.py | |
| parent | 4db9cdc26c52ecf596e552f569729278bc5dfd8e (diff) | |
| download | cascades-82b14ab18ccfd032f817979ec0ce74f274b69c3d.tar.gz | |
changing non-defined prior and source specification
Diffstat (limited to 'simulation/bayes.py')
| -rw-r--r-- | simulation/bayes.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/simulation/bayes.py b/simulation/bayes.py index 7d8567b..e2be6da 100644 --- a/simulation/bayes.py +++ b/simulation/bayes.py @@ -45,13 +45,13 @@ def mc_graph_setup(infected, susceptible, prior=None, *args, **kwargs): # Container class for graph parameters n_nodes = len(infected[0][0]) theta = np.empty((n_nodes,n_nodes), dtype=object) - for i in xrange(n_nodes): - for j in xrange(n_nodes): - if prior is None: + if prior is None: + for i in xrange(n_nodes): + for j in xrange(n_nodes): theta[i, j] = pymc.Beta('theta_{}{}'.format(i, j), alpha=1, - beta=1) - else: - theta[i, j] = prior('theta_{}{}'.format(i, j), *args, **kwargs) + beta=1) + else: + theta = prior(theta=theta, *args, **kwargs) # Container class for cascade realization x = {} |
