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

  \rput(2,4){\GM@node[observed=true]{y_il}}
  \GM@label[angle=40]{y_il}{$y_{il}$}
  
  \rput(4,4){\GM@node{q_il}}
  \GM@label[angle=40]{q_il}{$q_{il}$}
  
  \rput(1,3){\GM@plate{4}{2}{}}
  
  \rput(4,6){\ovalnode{pi_i}{\phantom{abc}}}
  \rput(4,6){$\boldsymbol{\pi}_i$}

  \rput(6.5,4){\circlenode[doubleline=true]{q_i}{$\bar{\boldsymbol{q}}_i$}}  
  
  \rput(11,4){\GM@node[observed=true]{R_ij}}
  \GM@label[angle=40]{R_ij}{$R_{ij}$}
    
  \rput(0.5,2.5){\GM@plate{12}{4.5}{$I$}}    
    
  \rput(11,8.5){\circlenode[doubleline=true]{q_j}{$\bar{\boldsymbol{q}}_j$}}    
  
  \rput(11,11){\GM@node{q_jl}}
  \GM@label[angle=40]{q_jl}{$q_{jl}$}  
  
  \rput(11,13){\GM@node[observed=true]{y_jl}}
  \GM@label[angle=40]{y_jl}{$y_{jl}$}  
  
  \rput(10,10){\GM@plate{2}{4}{}}  
  
  \rput(8.5,11){\ovalnode{pi_j}{\phantom{abc}}}
  \rput(8.5,11){$\boldsymbol{\pi}_j$}  
  
  \rput(7.5,1.5){\GM@plate{5.5}{13}{J}}  

  \rput(4,11){\GM@node{alpha}}
  \GM@label[angle=90]{alpha}{$\alpha$}  
  
  \rput(2,13){\fnode[framesize=30pt]{B}}
  \rput(2,13){$\boldsymbol{B}$}  
  
  \rput(11,0){\ovalnode{w}{\phantom{abc}}}
  \rput(11,0){$\boldsymbol{w}$}  
  
  \ncline{->}{q_il}{y_il}  
  \ncline{->}{pi_i}{q_il}
  \ncline{->}{q_il}{q_i}
  \ncline{->}{q_i}{R_ij}
  \ncline{->}{q_j}{R_ij}
  \ncline{->}{q_jl}{q_j}
  \ncline{->}{q_jl}{y_jl}
  \ncline{->}{pi_j}{q_jl}
  \ncline{->}{alpha}{pi_i}
  \ncline{->}{alpha}{pi_j}
  \ncline{->}{B}{y_il}
  \ncline{->}{B}{y_jl}
  \ncline{->}{w}{R_ij}
  
\end{pspicture}

\endTeXtoEPS
\end{document}
