causaldag.structure_learning.gsp

causaldag.structure_learning.gsp(nodes: set, ci_tester: causaldag.utils.ci_tests.ci_tester.CI_Tester, depth: Optional[int] = 4, nruns: int = 5, verbose: bool = False, initial_undirected: Union[str, causaldag.classes.undirected_graph.UndirectedGraph, None] = 'threshold', initial_permutations: Optional[List[T]] = None, fixed_orders={}, fixed_adjacencies={}, fixed_gaps={}, use_lowest=True, max_iters=inf, factor=2, progress_bar=False, summarize=False) -> (<class 'causaldag.classes.dag.DAG'>, typing.List[typing.List[typing.Dict]])[source]

Estimate the Markov equivalence class of a DAG using the Greedy Sparsest Permutations (GSP) algorithm.

Parameters:
  • nodes – Labels of nodes in the graph.
  • ci_tester – A conditional independence tester, which has a method is_ci taking two sets A and B, and a conditioning set C, and returns True/False.
  • depth – Maximum depth in depth-first search. Use None for infinite search depth.
  • nruns – Number of runs of the algorithm. Each run starts at a random permutation and the sparsest DAG from all runs is returned.
  • verbose – TODO
  • initial_undirected – Option to find the starting permutation by using the minimum degree algorithm on an undirected graph that is Markov to the data. You can provide the undirected graph yourself, use the default ‘threshold’ to do simple thresholding on the partial correlation matrix, or select ‘None’ to start at a random permutation.
  • initial_permutations – A list of initial permutations with which to start the algorithm. This option is helpful when there is background knowledge on orders. This option is mutually exclusive with initial_undirected.
  • fixed_orders – Tuples (i, j) where i is known to come before j.
  • fixed_adjacencies – Tuples (i, j) where i and j are known to be adjacent.
  • fixed_gaps – Tuples (i, j) where i and j are known to be non-adjacent.

See also

pcalg(), igsp(), unknown_target_igsp()

Returns:
Return type:(est_dag, summaries)