To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / _FullBNT / BNT / general / dsep.m @ 8:b5b38998ef3b
History | View | Annotate | Download (490 Bytes)
| 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)); |