causaldag.structure_learning.permutation2dag

causaldag.structure_learning.permutation2dag(perm: list, ci_tester: causaldag.utils.ci_tests.ci_tester.CI_Tester, verbose=False, fixed_adjacencies: Set[FrozenSet[Hashable]] = {}, fixed_gaps: Set[FrozenSet[Hashable]] = {}, progress=False)[source]

Estimate the minimal IMAP of a DAG which is consistent with the given permutation.

Parameters:
  • perm – list of nodes representing the permutation.
  • ci_tester – object for testing conditional independence.
  • verbose – if True, log each CI test.
  • fixed_adjacencies – set of nodes known to be adjacent.
  • fixed_gaps – set of nodes known not to be adjacent.

Examples

>>> from causaldag.utils.ci_tests import MemoizedCI_Tester, partial_correlation_test, partial_correlation_suffstat
>>> perm = [0,1,2]
>>> suffstat = partial_correlation_suffstat(samples)
>>> ci_tester = MemoizedCI_Tester(partial_correlation_test, suffstat)
>>> permutation2dag(perm, ci_tester, fixed_gaps={frozenset({1, 2})})