\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}(-2,0)(12,13)
  \SpecialCoor

  
  \rput(1,1){\fnode[framesize=55pt]{A_hmm}}
  \rput(1,1){$\boldsymbol{A}^{HMM}$}  
 
  \rput(5,1){\fnode[framesize=55pt]{B_hmm}}
  \rput(5,1){$\boldsymbol{B}^{HMM}$}
 
  \rput(14,8){\fnode[framesize=55pt]{B_lda}}
  \rput(14,8){$\boldsymbol{B}^{LDA}$}  
  
  \rput(1,5){\GM@node{s_il1}}
  \GM@label[angle=140]{s_il1}{$z_{i,l-1}$}
  
  \rput(5,5){\GM@node{s_il2}}
  \GM@label[angle=140]{s_il2}{$z_{i,l}$}
  
  \rput(9,5){\GM@node{s_il3}}
  \GM@label[angle=40]{s_il3}{$z_{i,l+1}$}  
  
  \rput(11,5){\GM@ldots{s_il4}}  
  
  \rput(1,7){\GM@node[observed=true]{y_il1}}
  \GM@label[angle=140]{y_il1}{$y_{i,l-1}$}  
  
  \rput(5,7){\GM@node[observed=true]{y_il2}}
  \GM@label[angle=140]{y_il2}{$y_{i,l}$}
  
  \rput(9,7){\GM@node[observed=true]{y_il3}}
  \GM@label[angle=140]{y_il3}{$y_{i,l+1}$}
  
  \rput(11,7){\GM@ldots{y_il4}}
  
  \rput(1,9){\GM@node{q_il1}}
  \GM@label[angle=140]{q_il1}{$q_{i,l-1}$}
  
  \rput(5,9){\GM@node{q_il2}}
  \GM@label[angle=140]{q_il2}{$q_{i,l}$}
  
  \rput(9,9){\GM@node{q_il3}}
  \GM@label[angle=40]{q_il3}{$q_{i,l+1}$}  
  
  \rput(11,9){\GM@ldots{q_il4}}  
  
  \rput(5,11){\ovalnode{pi}{\phantom{abcd}}}
  \rput(5,11){$\boldsymbol{\pi}_i$}  
  
  \rput(5,13){\GM@node[observed=true]{alpha}}
  \GM@label[angle=-180]{alpha}{$\alpha$}  
  
  \rput(-1,3.5){\GM@plate{13}{8.5}{$N$}}  
  
  \nccurve[angleA=90,angleB=-90]{->}{A_hmm}{s_il1}
  \nccurve[angleA=80,angleB=-140]{->}{A_hmm}{s_il2}
  \nccurve[angleA=70,angleB=-120]{->}{A_hmm}{s_il3}
  \nccurve[angleA=80,angleB=-65]{->}{B_hmm}{y_il1}
  \nccurve[angleA=70,angleB=-65]{->}{B_hmm}{y_il2}
  \nccurve[angleA=60,angleB=-140]{->}{B_hmm}{y_il3}
  \ncline{->}{s_il1}{y_il1}
  \ncline{->}{s_il2}{y_il2}
  \ncline{->}{s_il3}{y_il3}
  \ncline{->}{s_il1}{s_il2}
  \ncline{->}{s_il2}{s_il3}
  \ncline{->}{q_il1}{y_il1}
  \ncline{->}{q_il2}{y_il2}
  \ncline{->}{q_il3}{y_il3}
  \ncline{->}{pi}{q_il1}
  \ncline{->}{pi}{q_il2}
  \ncline{->}{pi}{q_il3}
  \ncline{->}{alpha}{pi}
  \nccurve[angleA=176,angleB=25]{->}{B_lda}{y_il1}
  \nccurve[angleA=178,angleB=25]{->}{B_lda}{y_il2}
  \nccurve[angleA=180,angleB=25]{->}{B_lda}{y_il3}  
  
\end{pspicture}

\endTeXtoEPS
\end{document}
