causal_networkx.algorithms.uncovered_pd_path#

causal_networkx.algorithms.uncovered_pd_path(graph, u, c, max_path_length, first_node=None, second_node=None)[source]#

Compute uncovered potentially directed path from u to c.

An uncovered pd path is one where: u o-> … -> c. There are no bidirected arrows, bidirected circle arrows, or opposite arrows. In addition, every node beside the endpoints are unshielded, meaning V(i-1) and V(i+1) are not adjacent.

Parameters:

graph : ADMG

PAG to orient.

u : node

A node in the graph to start the uncovered path.

c : node

A node in the graph.

max_path_length : int

The maximum distance to check in the graph.

first_node : node, optional

The node previous to ‘u’. If it is before ‘u’, then we will check that ‘u’ is unshielded. If it is not passed, then ‘u’ is considered the first node in the path and hence does not need to be unshielded. Both ‘first_node’ and ‘second_node’ cannot be passed.

second_node : node, optional

The node after ‘u’ that the path must traverse. Both ‘first_node’ and ‘second_node’ cannot be passed.

Notes

Typically uncovered potentially directed paths are defined by two nodes. However, in its common use case within the FCI algorithm, it is usually defined relative to an adjacent third node that comes before ‘u’.

Return type:

Tuple[List, bool]