Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a quite large matrix multiplication:

\begin{align*}
\mathrm{Var}(\alpha)&\approx \begin{pmatrix}\sqrt{1+\pi^{2}}\exp(-\delta^{*}+\zeta^{*}) &\frac{\pi\exp(-\delta^{*}+\zeta^{*})}{\sqrt{1+\pi^{2}}}&-\sqrt{1+\pi^{2}}\exp(-\delta^{*}+\zeta^{*})\end{pmatrix}  
\begin{pmatrix} \mathrm{Var}(\zeta^{*}) &\mathrm{Cov}(\zeta^{*},\pi) & \mathrm{Cov}(\zeta^{*},\delta^{*}) \\\mathrm{Cov}(\pi,\zeta^{*}) & \mathrm{Var}(\pi) & \mathrm{Cov}(\pi, \delta^{*}) \\\mathrm{Cov}(\delta^{*},\zeta^{*}) & \mathrm{Cov}(\delta^{*},\pi) & \mathrm{Var}(\delta^{*}) \end{pmatrix}
\begin{pmatrix}\sqrt{1+\pi^{2}}\exp(-\delta^{*}+\zeta^{*}) \\\frac{\pi\exp(-\delta^{*}+\zeta^{*})}{\sqrt{1+\pi^{2}}}\\-\sqrt{1+\pi^{2}}\exp(-\delta^{*}+\zeta^{*})\end{pmatrix}
        \end{align*}

Since this does not fit a single line I am wondering how I could typeset this in the best way? So that the logic of the matrix multiplication is still visible?

share|improve this question

2 Answers 2

up vote 9 down vote accepted

Please always post complete documents, not just fragments. It is shorter and clearer if you highlight the fact that this is VAV^T:

enter image description here

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align*}
\mathrm{Var}(\alpha)&\approx 
V\begin{pmatrix} \mathrm{Var}(\zeta^{*}) &\mathrm{Cov}(\zeta^{*},\pi) & \mathrm{Cov}(\zeta^{*},\delta^{*}) \\\mathrm{Cov}(\pi,\zeta^{*}) & \mathrm{Var}(\pi) & \mathrm{Cov}(\pi, \delta^{*}) \\\mathrm{Cov}(\delta^{*},\zeta^{*}) & \mathrm{Cov}(\delta^{*},\pi) & \mathrm{Var}(\delta^{*}) \end{pmatrix}V^T
        \end{align*}
where
\[V=\begin{pmatrix}\sqrt{1+\pi^{2}}\exp(-\delta^{*}+\zeta^{*}) &\frac{\pi\exp(-\delta^{*}+\zeta^{*})}{\sqrt{1+\pi^{2}}}&-\sqrt{1+\pi^{2}}\exp(-\delta^{*}+\zeta^{*})\end{pmatrix} \]


\end{document}
share|improve this answer
    
Probably a \dfrac instead of \frac is better looking here? –  karlkoeller Aug 18 '13 at 13:45
4  
Using \DeclareMathOperator for “Var” and “Cov” should be recommended –  egreg Aug 18 '13 at 13:47

Like David Carlisle does in his answer, I would also reduce the overall visual complexity of the main equation by rewriting it in the form V(a)=V <some matrix> V^T and providing a separate equation to explain the structure of V^T. Furthermore, in order to enhance the appearance of the components of the 3x3 matrix and the 3x1 column vector I would suggest that you do not use the pmatrix environment, which centers the contents of each column. Instead, it may be better to use the more general array environment to left-align the columns in the matrix and to right-align the column vector. Additionally, the legibility of the code (and look of the output) are enhanced, I think, if one defines the math operator terms \Var and \Cov in the preamble and then uses them throughout the equations.

enter image description here

If you feel so inclined, you can simplify the expression for V^T further by factoring out the common term \exp(-\delta^{*}+\zeta^{*}).

\documentclass{article}
\usepackage{amsmath,array}
\setlength\arraycolsep{3pt}
\DeclareMathOperator{\Var}{Var}
\DeclareMathOperator{\Cov}{Cov}
\begin{document}
\begin{align*}
\Var(\alpha) &\approx V
\left( \begin{array}{lll} 
\Var(\zeta^{*})            &\Cov(\zeta^{*},\pi)   & \Cov(\zeta^{*},\delta^{*}) \\
\Cov(\pi,\zeta^{*})        & \Var(\pi)            & \Cov(\pi, \delta^{*}) \\
\Cov(\delta^{*},\zeta^{*}) & \Cov(\delta^{*},\pi) & \Var(\delta^{*}) 
\end{array} \right)
V^T\\
\intertext{where}
V^T &= 
\left( \begin{array}{@{}r}
\sqrt{1+\pi^{2}}\,\exp(-\delta^{*}+\zeta^{*}) \\
\pi/(\sqrt{1+\pi^{2}})\, \exp(-\delta^{*}+\zeta^{*})\\
-\sqrt{1+\pi^{2}}\,\exp(-\delta^{*}+\zeta^{*})
\end{array}\right)
\end{align*}
\end{document}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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