9

I'm trying to code this matrix equation below,

enter image description here

I'm not an expert in latex, but I've been successful dealing with other matrix equations. However with this one, I can't achieve it. The alignment of the entries makes it more difficult to code. I tried the left hand side, but this is best I can do,

\documentclass{article}    
\usepackage{booktabs}
\usepackage{amsmath}
\begin{document}
\begin{equation}
    \label{fig:yulewalkermuch2}
    \left[\begin{array}{c}
    s=1\begin{cases}
    \begin{array}{c}
    \gamma_{00}(1)\\
    \gamma_{10}(1)\\
    \vdots\\
    \gamma_{\lambda 0}(1)
    \end{array}
    \end{cases}\\
    \midrule
    s=2\begin{cases}
    \begin{array}{c}
    \gamma_{00}(2)\\
    \gamma_{10}(2)\\
    \vdots\\
    \gamma_{\lambda 0}(2)
    \end{array}
    \end{cases}\\
    \midrule
    \qquad\,\,\vdots\\
    \midrule
    s=k\begin{cases}
    \begin{array}{c}
    \gamma_{00}(k)\\
    \gamma_{10}(k)\\
    \vdots\\
    \gamma_{l 0}(k)
    \end{array}
    \end{cases}
    \end{array}\right]=
\end{equation}
\end{document}

Output:

enter image description here

I really appreciate if you could help me with both the left and right hand side of the equation, especially with the alignment of the entries, from rows to columns. It's fine with me if you could just give me a code even for small dimensions only, so that I could expand it then.

2 Answers 2

8

With the code of this answer, and a bit of effort (manual tweaking). I got this (far from optimal, but if you have to fight with this kind of matrix only one time, it might work).

I used the \coolunder, \coolover, \coolrightbrace and \coolleftbrace from the answer I linked, but a bit tweaked to adapt the mtpro2 package. The reason to use the mtpro2 package is that it provides those curly long braces. If you don't have this font/package, just change the definitions of the commands to

\newcommand\coolover[2]{\mathrlap{\smash{\overbrace{\phantom{%
\begin{matrix} #2 \end{matrix}}}^{\mbox{$#1$}}}}#2} 

\newcommand\coolunder[2]{\mathrlap{\smash{\underbrace{\phantom{%
\begin{matrix} #2 \end{matrix}}}_{\mbox{$#1$}}}}#2}

\newcommand\coolleftbrace[2]{%
#1\left\{\vphantom{\begin{matrix} #2 \end{matrix}}\right.}

\newcommand\coolrightbrace[2]{%
\left.\vphantom{\begin{matrix} #1 \end{matrix}}\right\}#2}

Code

Here it is the code. As I said, it is far from optimal (it has a lot of phantoms):

\documentclass{scrartcl}
\usepackage{mathtools}
\usepackage{newtxtext}
\usepackage[lite]{mtpro2}
\usepackage{multirow}
\usepackage[hmargin=1.5cm]{geometry}% You have to find the way to deal with the margins.

% You can comment this (only used to get the appearence of the image).
\setkomafont{captionlabel}{\scshape}
\setcounter{equation}{4}
\setcounter{figure}{1}

% The commands used to get the desired braces.
\newcommand\coolover[2]{\mathrlap{\smash{\overcbrace{\phantom{%
    \begin{matrix} #2 \end{matrix}}}^{\mbox{$#1$}}}}#2} 

\newcommand\coolunder[2]{\mathrlap{\smash{\undercbrace{\phantom{%
    \begin{matrix} #2 \end{matrix}}}_{\mbox{$#1$}}}}#2}

\newcommand\coolleftbrace[2]{%
    #1\LEFTRIGHT\{.{\vphantom{\begin{matrix} #2 \end{matrix}}}}

\newcommand\coolrightbrace[2]{%
    \LEFTRIGHT.\}{\vphantom{\begin{matrix} #1 \end{matrix}}}#2}

\newcommand\Vdots{\vdots}%      You can change the size/appearence of the dots in
\newcommand\Cdots{\cdots}%  the matrixes easily changing this definitions.

\begin{document}
\begin{center}
    \bfseries PHILIP E. PFEIFER AND STUART JAY DEUTCH
\end{center}

\begin{figure}[h!]
    \small
    \centering
    \begin{equation}
        \begin{matrix}
            \coolleftbrace{s = 1}{\\ \\ \vphantom{\Vdots} \\ \\} \\
            \coolleftbrace{s = 2}{\\ \\ \vphantom{\Vdots} \\ \\} \\
            \vphantom{\Vdots}   \\
            \coolleftbrace{s = k}{\\ \\ \vphantom{\Vdots} \\ \\}
        \end{matrix}%
        \begin{bmatrix}
            \gamma_{00}(1) \\
            \gamma_{01}(1) \\
            \Vdots \\
            \gamma_{\lambda0}(1) \\ \hline
            \gamma_{00}(2) \\
            \gamma_{01}(2) \\
            \Vdots \\
            \gamma_{\lambda0}(2) \\ \hline
            \Vdots \\ \hline
            \gamma_{00}(1) \\
            \gamma_{01}(1) \\
            \Vdots \\
            \gamma_{\lambda0}(1)
        \end{bmatrix}
        =
        \left[
        \begin{array}{@{} cccc|cccc|c|c @{}}
            \gamma_{00}(0) & \gamma_{01}(0) & \Cdots & \gamma_{0\lambda}(0) & \gamma_{00}(-1) & \gamma_{01}(-1) & \Cdots & \gamma_{0\lambda}(-1) & \multirow{4}{*}{$\Cdots$} & \multirow{4}{*}{$(1 - k)$} \\
            \gamma_{10}(0) & \gamma_{11}(0) & \Cdots & \gamma_{1\lambda}(0) & \gamma_{10}(-1) & \gamma_{11}(-1) & \Cdots & \gamma_{1\lambda}(-1) & & \\
            \multicolumn{4}{c|}{\Vdots} & \multicolumn{4}{c|}{\Vdots} & & \\
            \gamma_{\lambda0}(0) & \gamma_{\lambda1}(0) & \Cdots & \gamma_{\lambda\lambda}(0) & \gamma_{\lambda0}(-1) & \gamma_{\lambda1}(-1) & \Cdots & \gamma_{\lambda\lambda}(-1) & & \\ \hline
            \multicolumn{4}{c|}{\multirow{4}{*}{$(1)$}} & \multicolumn{4}{c|}{\multirow{4}{*}{$(0)$}} & & \multirow{4}{*}{$(2 - k)$} \\
            & & & & & & & & & \\
            & & & & & & & \vphantom{\Vdots} & & \\
            & & & & & & & & & \\ \hline
            \multicolumn{4}{c|}{\Vdots} & \multicolumn{4}{c|}{\Vdots} & & \Vdots \\ \hline
            \multicolumn{4}{c|}{\multirow{4}{*}{$(k - 1)$}} & \multicolumn{4}{c|}{\multirow{4}{*}{$(k - 2)$}} & \multirow{4}{*}{$\Cdots$} & \multirow{4}{*}{$(0)$} \\
            & & & & & & & & & \\
            & & & & & & & \vphantom{\Vdots} & & \\
            \coolunder{j = 1}{\hphantom{\gamma_{00}(0)} & \hphantom{\gamma_{01}(0)} & \hphantom{\Cdots} & \hphantom{\gamma_{0\lambda}(0)}} & \coolunder{j = 2}{\hphantom{\gamma_{00}(-1)} & \hphantom{\gamma_{01}(-1)} & \hphantom{\Cdots} & \hphantom{\gamma_{0\lambda}(1)}} & & \coolunder{j = k}{\hphantom{(1 - k)}}
        \end{array}
        \right]
        \begin{bmatrix}
            \phi_{10} \\
            \phi_{11} \\
            \Vdots \\
            \phi_{1\lambda} \\ \hline
            \phi_{20} \\
            \phi_{21} \\
            \Vdots \\
            \phi_{2\lambda} \\ \hline
            \Vdots \\ \hline
            \phi_{k0} \\
            \phi_{k1} \\
            \Vdots \\
            \phi_{k\lambda}
        \end{bmatrix}
    \end{equation}\bigskip
    \caption{The space-time analogue of the Yule-Walker equations}
\end{figure}
\end{document}

And this is how it looks: enter image description here

4
  • it's more than a little strange to have both a (numbered) figure caption and an equation number for the same display. Commented Feb 2, 2013 at 18:24
  • @barbarabeeton True. I just tried to make it look the same. Later I'll edit my answer.
    – Manuel
    Commented Feb 2, 2013 at 19:08
  • actually, you have succeeded in making it look the same. i guess my comment more properly belongs on the original question. Commented Feb 2, 2013 at 19:18
  • Manuel, you save me on my thesis! Thank you very much! Indeed @barbarabeeton, but I remove the equation number. Thank you for your effort Manuel, you got it right. Although I'm having problem with the package you used for newtxtext and mtpro2. But I manage to remove the errors by excluding these packages. The output I got was not as perfect as yours due to the two packages, but at least close enough. Thank you again! Commented Feb 3, 2013 at 1:54
4

I tried to put my Copy Editor hat on and make the whole thing a bit more structured:

enter image description here

The code:

\documentclass{article}

\pagestyle{empty}

\usepackage{mathtools,bm}

\newcommand{\GG}{\bm{\Gamma}}
\newcommand{\PP}{\bm{\Phi}}

\begin{document}

We have an equation that can be written in blocks as follows:
\[ 
    \begin{bmatrix}
        \GG_{\bullet 0}(1) \\
        \GG_{\bullet 0}(2) \\ 
        \vdots \\
        \GG_{\bullet 0}(k)
    \end{bmatrix}
    =
    \begin{bmatrix}
        \GG(0) & \GG(-1) & \cdots & \GG(1-k) \\
        \GG(1) & \GG(0) & \cdots & \GG(2-k) \\
        \vdots & \vdots & & \vdots \\
        \GG(k-1) & \GG(k-2) & \cdots & \GG(0)
    \end{bmatrix}
    \begin{bmatrix}
        \PP_{1\bullet} \\
        \PP_{2\bullet} \\
        \vdots \\
        \PP_{k\bullet}
    \end{bmatrix}
,\]
where we use the notation
\[
    \GG_{\bullet j}(t)=\begin{bmatrix}
        \gamma_{0j}(t) \\
        \gamma_{1j}(t) \\
        \vdots \\
        \gamma_{\lambda j}(t)
    \end{bmatrix}
,\quad
    \GG(t)=\begin{bmatrix}
        \gamma_{00}(t) & \gamma_{01}(t) & \cdots & \gamma_{0\lambda}(t) \\
        \gamma_{10}(t) & \gamma_{11}(t) & \cdots & \gamma_{1\lambda}(t) \\
        \vdots & \vdots & & \vdots \
        \gamma_{\lambda 0}(t) & \gamma_{\lambda 1}(t) & \cdots & \gamma_{\lambda\lambda}(t) \\
    \end{bmatrix}
,\quad
    \PP_{i\bullet}=\begin{bmatrix}
        \psi_{i0} \\
        \psi_{i1} \\
        \vdots \\
        \psi_{i\lambda}
    \end{bmatrix}
.\]

\end{document}
1
  • Hello @tohecz, thank you for your effort, I really appreciate it. Your answer was my alternative solution to the equation actually. Thank you again! Commented Feb 3, 2013 at 1:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .