\documentclass[12pt]{standalone} \usepackage{ucs} \usepackage[utf8x]{inputenc} \usepackage[T1]{fontenc} \usepackage{textcomp} \renewcommand{\rmdefault}{ugm} \renewcommand{\sfdefault}{phv} \usepackage[garamond]{mathdesign} \usepackage{tikz} \usetikzlibrary{positioning, shapes, arrows, shadows} \begin{document} \tikzset{ observed/.style={circle, draw}, partly observed/.style 2 args={draw, fill=#2, path picture={ \fill[#1, sharp corners] (path picture bounding box.south west) -| (path picture bounding box.north east) -- cycle;}, circle}, unobserved/.style={draw, circle, fill=gray!40}, residual/.style={draw, rectangle} } \tikzset{>=latex} \begin{tikzpicture} \node[observed] (y) {$Y$}; \node[unobserved, above=of y] (x) {$X$}; \node[observed, left=of x] (w) {$W$}; \node[observed,right=of x] (z) {$Z$}; \draw[->] (z) to (y); \draw[->] (z) -- (x); \draw[->] (x) -- (y); \draw[->] (x) -- (w); \draw[->] (x) to (y); \draw[->] (y) -- (w); \draw[->] (y) -- (w); \end{tikzpicture} \end{document}