
\documentclass{article}
\usepackage{com.braju.graphicalmodels}

\catcode`\@=11%

\pagestyle{empty}

\begin{document}
\TeXtoEPS

\LARGE
\psset{unit=13mm,arrowscale=1.5,linewidth=1.5pt}
\begin{pspicture}(0,0)(18,10)%\showgrid
  \SpecialCoor

  \rput(1,2){\GM@node[observed=false]{a1}} \GM@label[angle=180]{a1}{ }
  \rput(2,3){\GM@node[observed=false]{a2}} \GM@label[angle=180]{a2}{ }
  \rput(3,5){\GM@node[observed=false]{a3}} \GM@label[angle=180]{a3}{ }
  \rput(2,1){\GM@node[observed=false]{a4}} \GM@label[angle=180]{a4}{ }
  \rput(3.5,4){\GM@node[observed=false]{a5}} \GM@label[angle=180]{a5}{ }
  \rput(5,5){\GM@node[observed=false]{a6}} \GM@label[angle=180]{a6}{ }
  \rput(5,3){\GM@node[observed=false]{a7}} \GM@label[angle=180]{a7}{ }
  \rput(5,1){\GM@node[observed=false]{a8}} \GM@label[angle=180]{a8}{ }
  \rput(6,2){\GM@node[observed=false]{a9}} \GM@label[angle=180]{a9}{ }
  \rput(3,2){\GM@node[observed=true]{Xa}} \GM@label[angle=-90]{Xa}{X}

  \rput(8,2){\GM@node[observed=false]{b1}} \GM@label[angle=180]{b1}{ }
  \rput(9,3){\GM@node[observed=false]{b2}} \GM@label[angle=180]{b2}{ }
  \rput(10,5){\GM@node[observed=false]{b3}} \GM@label[angle=180]{b3}{ }
  \rput(9,1){\GM@node[observed=false]{b4}} \GM@label[angle=180]{b4}{ }
  \rput(10.5,4){\GM@node[observed=false]{b5}} \GM@label[angle=180]{b5}{ }
  \rput(12,5){\GM@node[observed=false]{b6}} \GM@label[angle=180]{b6}{ }
  \rput(12,3){\GM@node[observed=false]{b7}} \GM@label[angle=180]{b7}{ }
  \rput(12,1){\GM@node[observed=false]{b8}} \GM@label[angle=180]{b8}{ }
  \rput(13,2){\GM@node[observed=false]{b9}} \GM@label[angle=180]{b9}{ }
  \rput(10,2){\GM@node[observed=true]{Xb}} \GM@label[angle=-90]{Xb}{X}

  
  \ncline[arrows=->]{a2}{a1}
  \ncline[arrows=->]{a4}{a1}
  \ncline[arrows=->]{a3}{a5}
  \ncline[arrows=->]{Xa}{a4}
  \ncline[arrows=->]{Xa}{a8}
  \ncline[arrows=->]{a6}{a5}
  \ncline[arrows=->]{a6}{a7}          
  \ncline[arrows=->]{a7}{a8}  
  \ncline[arrows=->]{a7}{a9}
  
  \ncline[arrows=->]{b2}{b1}
  \ncline[arrows=->]{b4}{b1}
  \ncline[arrows=->]{b3}{b5}
  \ncline[arrows=->]{Xb}{b4}
  \ncline[arrows=->]{Xb}{b8}
  \ncline[arrows=->]{b6}{b5}
  \ncline[arrows=->]{b6}{b7}
  \ncline[arrows=->]{b7}{b8}
  \ncline[arrows=->]{b7}{b9}
  
  
  \psset{linecolor=red,linewidth=3pt}
  \ncline[arrows=->]{a2}{Xa}
  \ncline[arrows=->]{a5}{Xa}
  \ncline[arrows=->]{a7}{Xa}  
  
  
  \psset{linecolor=black}  
  \psline{->}(6.5,3)(7.5,3)
  \huge
  \rput(3.25,5.25){\rput[b](0.25,0.4){$G$}}
  \rput(10.5,5.25){\rput[b](0.25,0.4){$G_{do(X=x)}$}}


\end{pspicture}

\endTeXtoEPS
\end{document}
