annotate toolboxes/FullBNT-1.0.7/bnt/general/dsep.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
rev   line source
wolffd@0 1 function sep = dsep(X, Y, S, G)
wolffd@0 2 % DSEP Is X indep Y given S wrt DAG G?
wolffd@0 3 % sep = dsep(X, Y, S, G)
wolffd@0 4 %
wolffd@0 5 % Instead of using the Bayes-Ball criterion, we see if S separates X and Y
wolffd@0 6 % in the moralized ancestral graph.
wolffd@0 7
wolffd@0 8 conn = reachability_graph(G);
wolffd@0 9 M = myunion(myunion(X, Y), S);
wolffd@0 10 [A,junk] = find(conn(:, M));
wolffd@0 11 A = unique(A);
wolffd@0 12 A = myunion(A, M);
wolffd@0 13 GM = moralize(G(A,A));
wolffd@0 14 %sep = graph_separated(GM, X, Y, S);
wolffd@0 15 sep = graph_separated(GM, find_equiv_posns(X,A), find_equiv_posns(Y,A), find_equiv_posns(S,A));