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