Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

d-Separation Example #191

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/img/dsep3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/dsep4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions representation/directed/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,27 @@ In other words, all the independencies encoded in $$G$$ are sound: variables tha

In a way this is almost a trivial statement. If $$p(x,y) = p(x)p(y)$$, then this distribution still factorizes over the graph $$y \rightarrow x$$, since we can always write it as $$p(x,y) = p(x\mid y)p(y)$$ with a CPD $$p(x\mid y)$$ in which the probability of $$x$$ does not actually vary with $$y$$. However, we can construct a graph that matches the structure of $$p$$ by simply removing that unnecessary edge.

**Framework for determining d-separation** {% include sidenote.html note="Taken from Pieter Abbeel's YouTube video on d-separation https://www.youtube.com/watch?v=yDs_q6jKHb0&t=1040s" %}

Given a query $$X_1 \perp X_2 \mid X_3, X_4$$
- Shade all evidence nodes ($$X_3, X_4$$)
- For all paths from $$X_1$$ to $$X_2$$, take triplets along each path and using the 4 rules described above, determine if the path is active or inactive.
- If any path is active it is not guaranteed that $$X_1 \perp X_2 \mid X_3, X_4$$ is true.
- If all paths are inactive (one of the triplets along the path violates the 4 rules) then the query is true.

**Example of Applying this Framework**

{% include marginfigure.html id="dp2" url="assets/img/dsep3.png" description="In this example, $$Y$$ and $$Z$$ are not $$d$$-separated given $$X$$." %}

We consider the query $$Y \perp Z \mid X$$
- There are two paths from $$Y$$ to $$Z$$. ($$Y, X, V, T, Z$$ and $$Y, W, V, T, Z$$)
- Considering Path 1 $$Y, X, V, T, Z$$, the first triple is $$Y, X, V$$.
- This is an inactive triple since $$X$$ is observed, which means that Path 1 is inactive.
- Along Path 2, the first triple is $$Y, W, V$$ which is active.
- The second triple is $$W, V, T$$ which is active and finally the third triple $$V, T, Z$$ is also active.
- Since there is an active path between $$Y$$ and $$Z$$ the independence statement is not guaranteed to be true.


### The representational power of directed graphs

This raises our last and perhaps most important question: can directed graphs express all the independencies of any distribution $$p$$? More formally, given a distribution $$p$$, can we construct a graph $$G$$ such that $$I(G) = I(p)$$?
Expand Down