comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 function sep = dsep(X, Y, S, G)
2 % DSEP Is X indep Y given S wrt DAG G?
3 % sep = dsep(X, Y, S, G)
4 %
5 % Instead of using the Bayes-Ball criterion, we see if S separates X and Y
6 % in the moralized ancestral graph.
7
8 conn = reachability_graph(G);
9 M = myunion(myunion(X, Y), S);
10 [A,junk] = find(conn(:, M));
11 A = unique(A);
12 A = myunion(A, M);
13 GM = moralize(G(A,A));
14 %sep = graph_separated(GM, X, Y, S);
15 sep = graph_separated(GM, find_equiv_posns(X,A), find_equiv_posns(Y,A), find_equiv_posns(S,A));