\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,13)
  \SpecialCoor

  
  \rput(4,2){\fnode[framesize=30pt]{B}}
  \rput(4,2){$\boldsymbol{B}$}  
  
  \rput(4,5){\GM@node[observed=true]{y_il}}
  \GM@label[angle=140]{y_il}{$y_{il}$}  
  
  \rput(4,7){\GM@node{q_il}}
  \GM@label[angle=140]{q_il}{$q_{il}$}
  
  \rput(3,4){\GM@plate{2}{4}{}}  
  
  \rput(4,10){\ovalnode{pi_i}{\phantom{abc}}}
  \rput(4,10){$\boldsymbol{\pi}_i$}  

  \rput(3,12){\ovalnode*[fillcolor=gray]{x_i}{\phantom{abc}}}
  \rput(3,12){$\boldsymbol{x}_i$}  
  
  \rput(1.2,3){\GM@plate{5.6}{10}{$N$}}  
  
  \rput(5,12){\fnode[framesize=30pt]{W_i}}  
  \rput(5,12){$\boldsymbol{W}_i$}
  
  \rput(4,14){\ovalnode{mu}{\phantom{abc}}}
  \rput(4,14){$\boldsymbol{\mu}$}  
  
  \rput(6,14){\fnode[framesize=30pt]{Sigma}}
  \rput(6,14){$\boldsymbol{\Sigma}$}  
  
  \ncline{->}{B}{y_il}
  \ncline{->}{q_il}{y_il}
  \ncline{->}{pi_i}{q_il}
  \ncline{->}{x_i}{pi_i}
  \ncline{->}{W_i}{pi_i}
  \ncline{->}{mu}{W_i}
  \ncline{->}{Sigma}{W_i}
  
\end{pspicture}

\endTeXtoEPS
\end{document}
