Daniel@0: function sep = dsep(X, Y, S, G) Daniel@0: % DSEP Is X indep Y given S wrt DAG G? Daniel@0: % sep = dsep(X, Y, S, G) Daniel@0: % Daniel@0: % Instead of using the Bayes-Ball criterion, we see if S separates X and Y Daniel@0: % in the moralized ancestral graph. Daniel@0: Daniel@0: conn = reachability_graph(G); Daniel@0: M = myunion(myunion(X, Y), S); Daniel@0: [A,junk] = find(conn(:, M)); Daniel@0: A = unique(A); Daniel@0: A = myunion(A, M); Daniel@0: GM = moralize(G(A,A)); Daniel@0: %sep = graph_separated(GM, X, Y, S); Daniel@0: sep = graph_separated(GM, find_equiv_posns(X,A), find_equiv_posns(Y,A), find_equiv_posns(S,A));