\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)(9,11)
  \SpecialCoor

  
  \rput(3,1.5){\fnode[framesize=40pt]{B}}
  \rput(3,1.5){$\boldsymbol{B}$}  
  
  \rput(7.1,7){\fnode[framesize=40pt]{A}}
  \rput(7.1,7){$\boldsymbol{A}$}  
 
  \rput(3,5){\GM@node[observed=true]{y_il}}
  \GM@label[angle=140]{y_il}{$y_{il}$} 
  
  \rput(3,7){\GM@node{q_il}}
  \GM@label[angle=140]{q_il}{$q_{il}$}  
  
  \rput(2,4){\GM@plate{2}{4}{}}
  
  \rput(1,7){\GM@node[observed=true]{c_i}}
  \GM@label[angle=90]{c_i}{$c_i$}
    
  \rput(3,9.5){\ovalnode{pi_i}{\phantom{abcd}}}
  \rput(3,9.5){$\boldsymbol{\pi}_i$}  
  
  \rput(0.2,3.2){\GM@plate{5.2}{7.4}{$N$}}  
  
  \rput(3,11.5){\GM@node{alpha}}
  \GM@label[angle=180]{alpha}{$\alpha$}  
  
  \ncline{->}{B}{y_il}  
  \ncline{->}{q_il}{y_il}
  \ncline{->}{c_i}{q_il}
  \ncline{->}{pi_i}{q_il}
  \ncline{->}{alpha}{pi_i}
  \ncline{->}{A}{q_il}
  
\end{pspicture}

\endTeXtoEPS
\end{document}
