\documentclass{article}
\usepackage{com.braju.graphicalmodels}
\usepackage{amsmath}
% \special{papersize=40mm,80mm}
% \setlength{\pdfpagewidth}{40mm}
% \setlength{\pdfpageheight}{80mm}
% \usepackage[vcentering,dvips]{geometry}
% \geometry{papersize={80mm,120mm},total={80mm,120mm},margin=0mm}



\catcode`\@=11%

\pagestyle{empty}

\begin{document}
\TeXtoEPS

\LARGE
\psset{unit=10mm,arrowscale=1.5,linewidth=1.5pt}

\begin{pspicture}(0,0)(8,8)
  \SpecialCoor

  \rput(1.0,1.0){\circlenode{x4}{$x_4$}}
  \rput(2.5,2.5){\rnode{p_x4_x3}{\psframebox{$p(x_4 | x_3)$}}}
  \rput(4.0,4.0){\circlenode{x3}{$x_3$}}
  \rput(5.5,2.5){\rnode{p_x5_x3}{\psframebox{$p(x_5 | x_3)$}}}
  \rput(7.0,1.0){\circlenode{x5}{$x_5$}}
  \rput(4.0,5.5){\rnode{p_x3_x1_x2}{\psframebox{$p(x_3 | x_1, x_2)$}}}
  \rput(2.5,7.0){\circlenode{x1}{$x_1$}}
  \rput(5.5,7.0){\circlenode{x2}{$x_2$}}  
  \rput(1.0,8.5){\rnode{p_x1}{\psframebox{$p(x_1)$}}}  
  \rput(7.0,8.5){\rnode{p_x2}{\psframebox{$p(x_2)$}}}  
  
  \ncline{x4}{p_x4_x3}
  \ncline{x5}{p_x5_x3}
  \ncline{p_x4_x3}{x3}
  \ncline{p_x5_x3}{x3}
  \ncline{x3}{p_x3_x1_x2}
  \ncline{x1}{p_x3_x1_x2}
  \ncline{x2}{p_x3_x1_x2}
  \ncline{p_x1}{x1}
  \ncline{p_x2}{x2}
     
\end{pspicture}

\endTeXtoEPS
\end{document}
