3

Could you help me to solve this problem, please ? Where "Kalman filter" is the label of the node below I want the arrows like in red ones. Thank you in advanced.

enter image description here

\begin{tikzpicture}
\node[draw,fill=white,ellipse,minimum height=5cm,minimum width=5cm,text width = 2cm,align=center,label=above:\textbf{State-space model}] (A)
  {Transition \\
  abc abc \\
  $ \downarrow $ \\
  Measurement\\
  $y_t  = \hat{t}$ };
\node[xshift=8cm,draw,fill=white,ellipse,minimum height=5cm,minimum width=5cm,text width=2cm,align=center,label=above:\textbf{Estimated data Empirical data}] (B)
  {$ y \rightarrow \emptyset $ \\
  \vspace{5mm}
  $ y_{t / t-1} \rightarrow y_t $};
\node[xshift=4cm,yshift=-5cm,draw,fill=white,ellipse,text width=4cm,align=center,label=above:\textbf{Kalman filter}] (C)
  {$ v_t = y_t - y_{t,t-1} $};
\node[xshift=4cm,yshift=-7.5cm,draw,fill=white,rectangle,minimum height=1.2cm,text width=1.5cm,align=center] (D)
  {$ y_t $};  

\path[->] (A) edge (C);
\draw [->] (B) to (C);
\draw [->] (C) to (D);

\end{tikzpicture}
  • Please always post compilable code as it makes things much easier than mere snippets. – cfr Jul 27 '18 at 1:38
4

Give the label node a name with label={[name=kalman]above:\textbf{Kalman filter}}, and draw to kalman instead of C.

enter image description here

\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}
\node[draw,fill=white,ellipse,minimum height=5cm,minimum width=5cm,text width = 2cm,align=center,label=above:\textbf{State-space model}] (A)
  {Transition \\
  abc abc \\
  $ \downarrow $ \\
  Measurement\\
  $y_t  = \hat{t}$ };
\node[xshift=8cm,draw,fill=white,ellipse,minimum height=5cm,minimum width=5cm,text width=2cm,align=center,label=above:\textbf{Estimated data Empirical data}] (B)
  {$ y \rightarrow \emptyset $ \\
  \vspace{5mm}
  $ y_{t / t-1} \rightarrow y_t $};
\node[xshift=4cm,yshift=-5cm,draw,fill=white,ellipse,text width=4cm,align=center,label={[name=kalman]above:\textbf{Kalman filter}}] (C)
  {$ v_t = y_t - y_{t,t-1} $};
\node[xshift=4cm,yshift=-7.5cm,draw,fill=white,rectangle,minimum height=1.2cm,text width=1.5cm,align=center] (D)
  {$ y_t $};  

\draw [->] (A) to (kalman);
\draw [->] (B) to (kalman);
\draw [->] (C) to (D);

\end{tikzpicture}
\end{document}
1

UPDATED ANSWER: For some reason you seem not to like Torbjørn's nice solution, so here comes an alternative: use Torbjørn's nice solution along with fit. This has the advantage that the arrows point to the C node, not to the label, and gets rid of the big disadvantage of my previous proposal (see below) where one has to adjust distances by hand.

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{shapes.geometric,fit}
\begin{document}
\begin{tikzpicture}
\node[draw,fill=white,ellipse,minimum height=5cm,minimum width=5cm,text width = 2cm,align=center,label=above:\textbf{State-space model}] (A)
  {Transition \\
  abc abc \\
  $ \downarrow $ \\
  Measurement\\
  $y_t  = \hat{t}$ };
\node[xshift=8cm,draw,fill=white,ellipse,minimum height=5cm,minimum width=5cm,text width=2cm,align=center,label=above:\textbf{Estimated data Empirical data}] (B)
  {$ y \rightarrow \emptyset $ \\[5mm]
  $ y_{t / t-1} \rightarrow y_t $};
\node[xshift=4cm,yshift=-5cm,draw,fill=white,ellipse,text width=4cm,align=center,
label={[name=kalman,font=\bfseries]above:Kalman filter}] (C)
  {$ v_t = y_t - y_{t,t-1} $};
\node[xshift=4cm,yshift=-7.5cm,draw,fill=white,rectangle,minimum height=1.2cm,text width=1.5cm,align=center] (D)
  {$ y_t $};  
\node[fit=(C) (kalman)] (F){};

\draw[->] (A) to (F);
\draw[->] (B) to (F);
\draw [->] (C) to (D);
\end{tikzpicture}
\end{document}

enter image description here

ORIGINAL PROPOSAL: use shorten.

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}
\node[draw,fill=white,ellipse,minimum height=5cm,minimum width=5cm,text width = 2cm,align=center,label=above:\textbf{State-space model}] (A)
  {Transition \\
  abc abc \\
  $ \downarrow $ \\
  Measurement\\
  $y_t  = \hat{t}$ };
\node[xshift=8cm,draw,fill=white,ellipse,minimum height=5cm,minimum width=5cm,text width=2cm,align=center,label=above:\textbf{Estimated data Empirical data}] (B)
  {$ y \rightarrow \emptyset $ \\[5mm]
  $ y_{t / t-1} \rightarrow y_t $};
\node[xshift=4cm,yshift=-5cm,draw,fill=white,ellipse,text width=4cm,align=center,label=above:\textbf{Kalman filter}] (C)
  {$ v_t = y_t - y_{t,t-1} $};
\node[xshift=4cm,yshift=-7.5cm,draw,fill=white,rectangle,minimum height=1.2cm,text width=1.5cm,align=center] (D)
  {$ y_t $};  

\draw[->,shorten >=6mm] (A) edge (C);
\draw[->,shorten >=6mm] (B) to (C);
\draw [->] (C) to (D);
\end{tikzpicture}
\end{document}

enter image description here

The big disadvantage of this solution is that you have to put in the 6mm by hand, the slight advantage is that the arrows point to the center of the C node, not to the center of the label.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.