pywhy_graphs.AugmentedGraph#

class pywhy_graphs.AugmentedGraph(incoming_directed_edges=None, incoming_bidirected_edges=None, incoming_undirected_edges=None, directed_edge_name: str = 'directed', bidirected_edge_name: str = 'bidirected', undirected_edge_name: str = 'undirected', **attr)[source]#

An augmented causal diagram.

An augmented graph is one where interventions are represented by F-nodes. See [1], where they were first introduced. They allow one to model hard and soft interventions as an explicit “F-node” added to the existing causal graph. For more information, see <TBD user guide>.

Parameters:
incoming_directed_edgesinput directed edges (optional, default: None)

Data to initialize directed edges. All arguments that are accepted by networkx.DiGraph are accepted.

incoming_bidirected_edgesinput bidirected edges (optional, default: None)

Data to initialize bidirected edges. All arguments that are accepted by networkx.Graph are accepted.

incoming_undirected_edgesinput undirected edges (optional, default: None)

Data to initialize undirected edges. All arguments that are accepted by networkx.Graph are accepted.

directed_edge_namestr

The name for the directed edges. By default ‘directed’.

bidirected_edge_namestr

The name for the bidirected edges. By default ‘bidirected’.

undirected_edge_namestr

The name for the directed edges. By default ‘undirected’.

attrkeyword arguments, optional (default= no attributes)

Attributes to add to graph as key=value pairs.

Notes

Edge Type Subgraphs

Different edge types in an I-PAG are represented exactly as they are in a pywhy_graphs.PAG.

F-nodes

F-nodes are represented in pywhy-graphs as a tuple as ('F', <index>), where index is just a random index number. Each F-node is mapped to the intervention-set that they are applied on. For example in the graph \(('F', 0) \rightarrow X \rightarrow Y\), ('F', 0) is the F-node added that models an intervention on X. Each intervention-set is a set of regular nodes in the causal graph.

References