\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,6)%\showgrid
  \SpecialCoor

  \rput(0,2){\GM@node{Psi}}
  \GM@label[angle=-180]{Psi}{$\boldsymbol{\Psi}$}

  \rput(2,6){\GM@node{pi}}
  \GM@label[angle=-180]{pi}{$\boldsymbol{\pi}$}

  \rput(6.5,2){\GM@node{W_k}}
  \GM@label[angle=0]{W_k}{$\boldsymbol{W}_k$}

  \rput(6.5,3){\GM@node{mu_k}}
  \GM@label[angle=0]{mu_k}{$\boldsymbol{\mu}_k$}

  \rput(3,2){\GM@node[observed=true]{x_i}}
  \GM@label[angle=-120]{x_i}{$\boldsymbol{x}_i$}

  \rput(2,4){\GM@node{q_i}}
  \GM@label[angle=-180]{q_i}{$q_i$}
  
  \rput(4,4){\GM@node{z_i}}
  \GM@label[angle=-180]{z_i}{$\boldsymbol{z}_i$}

  \rput(0.8,1){\GM@plate{4.3}{3.9}{N}}
  \rput(5.8,1){\GM@plate{2.5}{2.7}{K}}

  \ncline[arrows=->]{Psi}{x_i}
  \ncline[arrows=->]{q_i}{x_i}
  \ncline[arrows=->]{z_i}{x_i}
  \ncline[arrows=->]{mu_k}{x_i}
  \ncline[arrows=->]{W_k}{x_i}
  \ncline[arrows=->]{pi}{q_i}
%  \psline[arrows=->](5.8,2)(3.3,2)


\end{pspicture}

\endTeXtoEPS
\end{document}
