3.1.10. 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:
- GMixedEdgeGraph
- A causal graph with bidirected edges. 
- directed_edge_namestr
- The name of the graph representing directed edges in - G.
- bidirected_edge_namestr
- The name of the graph representing bidirected edges in - G.
- uc_labelstr
- The - labelof the unobserved variables that are added in.
 
- Returns:
- G_copyDiGraph
- 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.