aboutsummaryrefslogtreecommitdiff
path: root/beliefs/models/BernoulliOrModel.py
diff options
context:
space:
mode:
Diffstat (limited to 'beliefs/models/BernoulliOrModel.py')
-rw-r--r--beliefs/models/BernoulliOrModel.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/beliefs/models/BernoulliOrModel.py b/beliefs/models/BernoulliOrModel.py
new file mode 100644
index 0000000..da18fb6
--- /dev/null
+++ b/beliefs/models/BernoulliOrModel.py
@@ -0,0 +1,17 @@
+from beliefs.models.BayesianModel import BayesianModel
+from beliefs.types.BernoulliOrNode import BernoulliOrNode
+
+
+class BernoulliOrModel(BayesianModel):
+ """
+ BernoulliOrModel stores node instances of BernoulliOrNodes (Bernoulli
+ variables associated with an OR conditional probability distribution).
+ """
+ def __init__(self, edges, nodes=None):
+ """
+ Input:
+ edges: an edge list, e.g. [(parent1, child1), (parent1, child2)]
+ """
+ if nodes is None:
+ nodes = self.create_nodes(edges, node_class=BernoulliOrNode)
+ super().__init__(edges, nodes=nodes)