3.1.6. pywhy_graphs.networkx.bidirected_to_unobserved_confounder#
- pywhy_graphs.networkx.bidirected_to_unobserved_confounder(G, directed_edge_name='directed', bidirected_edge_name='bidirected', uc_label='Unobserved Confounders')[source]#
Convert all bidirected edges to unobserved confounders.
- Parameters:
G : MixedEdgeGraph
A causal graph with bidirected edges.
directed_edge_name : str
The name of the graph representing directed edges in
G
.bidirected_edge_name : str
The name of the graph representing bidirected edges in
G
.uc_label : str
The
label
of the unobserved variables that are added in.- Returns:
G_copy : DiGraph
A networkx DiGraph that is a fully specified DAG with unobserved variables added in place of bidirected edges.
Notes
This converts bidirected to unobserved confounding variables, that are unobserved nodes that have a directed edge pointing to the two variables that were connected with a bidirected edge.