Graph¶
- class pqp.graph.Graph(edges=[])¶
Bases:
object
A causal graph
Example
>>> x = Variable("X") >>> y = Variable("Y") >>> g = Graph([ ... y <= x, ... ]) >>> g.idc([y], [x]) P(y | x)
- Parameters:
edges (list of DirectedEdge or BidirectedEdge) – the edges in the graph
Methods Summary
add_edge
(edge)Adds an edge to the graph
draw
()Draws the causal diagram using networkx
idc
(y, x[, z])Identification of conditional interventional distribution.
Methods Documentation
- add_edge(edge)¶
Adds an edge to the graph
- Parameters:
edge (DirectedEdge or BidirectedEdge) – the edge to add
- bi_edge_tuples()¶
- di_edge_tuples()¶
- draw()¶
Draws the causal diagram using networkx
- idc(y, x, z=[])¶
Identification of conditional interventional distribution.
- Parameters:
- Returns:
the expression for the interventional distribution
- Return type: