[Tex/LaTex] How to draw a dashed line from a node without connecting to any other node or a shape in tikz

pdftextechnical-drawingtikz-pgf

I want to generate hidden markov models using tikz. I have successfully generated nodes and connected them. But i want to generate dashed lines generating below the node to an empty space like this enter image description here. I tried to make it work using this code:

\begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=2.8cm,
                semithick,scale=1.5,transform shape]
\tikzstyle{every state}=[fill=red,draw=none,text=white]

\node[state]    (A)                    {$S_1$};
\node[state]    (B) [right of=A]       {$S_2$};


\path (A) edge [loop above] node {$a_{11}$} (A)
          edge [bend left]  node {$a_{12}$} (B)
      (B) edge [loop above] node {$a_{22}$} (B)
          edge [bend left]  node {$a_{21}$} (A);

\draw [dashed] (A) edge [bend below] node {$b_{11}$};
\end{tikzpicture}

But this code doesn't work for me. It generates something like thisenter image description here
How do i draw dashed lines from the nodes exactly shown in the figure with nodes rainy and sunny?

Best Answer

Like this? The labels are not precise, you can change the labels to whatever you want.

enter image description here

\documentclass[border=2mm,tikz]{standalone}
\usetikzlibrary{arrows,automata,positioning}
\begin{document}

\begin{tikzpicture}[->,>=stealth',shorten >=1pt,node distance=2.8cm,
                semithick,scale=1.5,transform shape]
\tikzstyle{every state}=[fill=red,draw=none,text=white]

\node[state]    (A)                    {$S_1$};
\node[state]    (B) [right of=A]       {$S_2$};


\path[auto] (A) edge [loop above] node {$a_{11}$} (A)
          edge [bend left]  node {$a_{12}$} (B)
      (B) edge [loop above] node {$a_{22}$} (B)
          edge [bend left]  node {$a_{21}$} (A);

\node (01) at ([shift={(-3em,-4em)}]A.south) {$b12$};
\node (04) at ([shift={(0,-5em)}]A.south) {$b11$};
\node (05) at ([shift={(3em,-4em)}]A.south) {$b13$};

\draw [shorten >=0pt,dashed] (A.south) --node[pos=.7,fill=white,inner sep=1pt]{0.4} (04);
\draw [shorten >=0pt,dashed] (A.south) --node[fill=white,inner sep=1pt]{0.1} (01);
\draw [shorten >=0pt,dashed] (A.south) --node[fill=white,inner sep=1pt]{0.5} (05);

\end{tikzpicture}

\end{document}
Related Question