Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
probml
GitHub Repository: probml/pyprobml
Path: blob/master/tikz/M-DAG.tex
1191 views
1
\documentclass[tikz, border=2pt]{standalone}
2
% main document, called main.tex
3
\usepackage{tikz}
4
\begin{document}
5
6
\usetikzlibrary{fit,arrows,calc,positioning,shadows.blur}
7
8
\begin{tikzpicture}[var/.style={draw,circle,inner sep=0pt,minimum size=1.2cm},
9
latentconf/.style={draw,circle,dashed,inner sep=0pt,minimum size=1.2cm, fill=green!5}
10
]
11
% Nodes
12
\node (A) [var] {$A$};
13
\node (Y) [var, right=2.2cm of A] {$Y$};
14
\node (U1) [latentconf, above=.8cm of A] {$U_1$};
15
\node (X) [var, below right=.2cm and .8cm of U1] {$X$};
16
\node (U2) [latentconf, above=.8cm of Y] {$U_2$};
17
18
% Arrows
19
\path[->, line width=0.5mm]
20
% (A) edge (Y)
21
(U1) edge (A)
22
(U1) edge (X)
23
(U2) edge (X)
24
(U2) edge (Y);
25
26
\end{tikzpicture}
27
28
\end{document}
29
30