0

I am just learning LaTeX recently to write a report. So I am unfamiliar with most LaTeX commands and environments. Can someone help me? I am trying to draw the following model in LaTeX.

enter image description here

Edit: After the help from N3buchadnezzar, I tried to make some changes as needed, but the problem now is the spacing between arrows and their labels. The best result is as shown, I want to make it as close to the first image as possible. Help! enter image description here

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,positioning,matrix}


\begin{document}

\begin{figure}[htp]
\centering
\begin{tikzpicture}[
plain/.style={
  draw=none,
  fill=none,
  },
net/.style={
  matrix of nodes,
  nodes={
    draw,
    circle,
    inner sep=10pt
    },
  nodes in empty cells,
  column sep=0.6cm,
  row sep=-11pt
  },
>=latex
]
\matrix[net,row sep=0em, column sep=4em] (mat)
{
|[plain]|& |[plain]| \parbox{1cm}{\centering $C_j , \sigma_j$} &|[plain]|\\
             &           \\
  |[plain]|  & |[plain]| &  &  &        \\
             &      &  |[plain]|$\vdots$  \\
  |[plain]|$\vdots$ & |[plain]|$\vdots$ &  &  &      \\
             &           \\
|[plain]| \parbox{1cm}{\centering I}& |[plain]| \parbox{1cm}{\centering J} &|[plain]| \parbox{1cm}{\centering K}\\
};
\foreach \ai in {2,4,6}
  {\foreach \aii in {2,4,6}
    \draw[->] (mat-\ai-1) -- (mat-\aii-2);
}

  \draw[->] (mat-2-2) --node[above]{$w_{11}$} (mat-3-3)node(){$\sum$};
  \draw[->] (mat-2-2) --node[above]{$w_{21}$} (mat-5-3)node(){$\sum$};
  \draw[->] (mat-4-2) --node[below]{$w_{12}$} (mat-3-3);
  \draw[->] (mat-4-2) --node[below]{$w_{22}$} (mat-5-3);
  \draw[->] (mat-6-2) --node[above]{$w_{1j}$} (mat-3-3);
  \draw[->] (mat-6-2) --node[below]{$w_{kj}$} (mat-5-3);

\draw[->] (mat-3-3)  --node[above]{$y_1$} (mat-3-4); 
\draw[->] (mat-3-5)node(){$t_i$} -- (mat-3-4);

\draw[->] (mat-5-3) --node[above]{$y_k$} (mat-5-4); 
\draw[->] (mat-5-5)node(){$t_k$} -- (mat-5-4);


\node(x1)  at (mat-2-1){$x_1$}; 
\node(s1) at (mat-2-2)[label=below:$(C_{11}...C_{1i})$]{$\sigma_1$};
\node(x1) at (mat-4-1){$x_2$}; 
\node(s2) at (mat-4-2)[label=below:$(C_{21}...C_{2i})$]{$\sigma_2$};
\node(x1) at (mat-6-1){$x_i$}; 
\node(s3) at (mat-6-2)[label=below:$(C_{j1}...C_{ji})$]{$\sigma_3$};
\end{tikzpicture}


\end{figure}
\end{document}
  • Welcome to TeX.SX. Questions about how to draw specific graphics that just post an image of the desired result are really not reasonable questions to ask on the site. Please post a minimal compilable document showing that you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document. – N3buchadnezzar Jun 25 at 10:44
1

Here is a starting point. See how far you can get on your own. I simply used ideas from Draw a radial basis function diagram in LyX.

enter image description here

Code

\documentclass[12pt]{article}
\usepackage[paper size={15cm,15cm}]{geometry}
\usepackage{tikz}
\usetikzlibrary{shapes,positioning,matrix}

\begin{document}
\begin{figure}[htp]
\centering
\begin{tikzpicture}[
plain/.style={
  draw=none,
  fill=none,
  },
net/.style={
  matrix of nodes,
  nodes={
    draw,
    circle,
    inner sep=8.5pt
    },
  nodes in empty cells,
  column sep=0.6cm,
  row sep=-11pt
  },
>=latex
]
\matrix[net,row sep=0em, column sep=3em] (mat)
{
             &           \\
  |[plain]|  & |[plain]| &  &  &        \\
             &           \\
  |[plain]|$\vdots$ & |[plain]|$\vdots$ &  &  &      \\
             &           \\
};
\foreach \ai in {1,3,5}
  {\foreach \aii in {1,3,5}
    \draw[->] (mat-\ai-1) -- (mat-\aii-2);
}
\foreach \ai in {1,3,5}
  {\foreach \aii in {2,4}
    \draw[->] (mat-\ai-2) -- (mat-\aii-3)node(){$\sum$};
}
\draw[->] (mat-2-3) -- (mat-2-4); \draw[->] (mat-2-5)node(){$t_i$} -- (mat-2-4);

\draw[->] (mat-4-3) -- (mat-4-4); \draw[->] (mat-4-5)node(){$t_k$} -- (mat-4-4);

\node(x1) at (mat-1-1){$x_1$}; \node(s1) at (mat-1-2){$\sigma_1$};
\node(x1) at (mat-3-1){$x_2$}; \node(s2) at (mat-3-2){$\sigma_2$};
\node(x1) at (mat-5-1){$x_i$}; \node(s3) at (mat-5-2){$\sigma_3$};
\end{tikzpicture}


\end{figure}

\end{document}

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.