1

I am wondering how I can get vertical alignment of the equations spread out over multiple align-environments:

\begin{align*}
    \mathbf{y}_{t} &= \mathbf{A'} \cdot \mathbf{x}_{t} + \mathbf{H'} \cdot \boldsymbol{\xi}_{t} + \textbf{v}_{t},\\
    \boldsymbol{\xi}_{t} &= \mathbf{F} \cdot \boldsymbol{\xi}_{t-1} + \varepsilon_{t},
\end{align*}

Here, $\mathbf{y}_{t}$ is a vector of observed contemporaneous variables; $\mathbf{x}_{t}$ is a vector of observed exogenous and lagged exogenous variables, and  $\boldsymbol{\xi}_{t}$ is the vector of unobserved states. The vectors of stochastic disturbances are assumed to be Gaussian and mutually uncorrelated, with mean zero and covariance matrices $\mathbf{R}$ and $\mathbf{Q}$, respectively:

\begin{align*}
    \mathbf{v}_{t} & \sim \mathcal{N}(0, \mathbf{R})\\
    \boldsymbol{\varepsilon}_{t} & \sim \mathcal{N}(0, \mathbf{Q})
\end{align*}

The first-stage model is represented by the following matrices:

\begin{align*}
    \mathbf{y}_{t} &=   \begin{bmatrix}
                        y_{t} & \pi_{t}
                        \end{bmatrix}\\
    \mathbf{x}_{t} &=   \begin{bmatrix}
                        y_{t-1} & y_{t-2} & \pi_{t-1} \pi_{t-2,4}
                        \end{bmatrix}\\
    \boldsymbol{\xi}_{t} &=     \begin{bmatrix}
                                y^{*}_{t} & y^{*}_{t-1} & y^{*}_{t-2}
                                \end{bmatrix}\\
\end{align*}

To clarify, the equations, from a vertical point of view, the equations do not start at the same point in the page: they are centered on the page according to their length. I would like all equations to have the same starting point on the page, such that they 'vertically align'.

Furthermore, how does one impose a matrix transpose in the bmatrix environment?

Thanks!

Sean
  • 151

2 Answers2

4

You can use a single align environment and the \intertext command for the text between groups of alignments, but it's designed for short sentences, so, in case a \intertext happens at the bottom of a page, it may go to the next page, leaving an unwanted blank space at the bottom of the page.

I don't think this is a good idea – one aligns only equations which are tightly linked: what would be the meaning of aligning, say, the formula for the discriminant of a quadratic equation and a trigonometric identity? Equations are not a marching troop.

Anyway, for what it's worth, here is a code:

\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{mathtools}

\begin{document}


\begin{align*}
    \mathbf{y}_{t} &= \mathbf{A'}\mathbf{x}_{t} + \mathbf{H'}\boldsymbol{\xi}_{t} + \textbf{v}_{t},\\
    \boldsymbol{\xi}_{t} &= \mathbf{F}\boldsymbol{\xi}_{t-1} + \varepsilon_{t},
\intertext{Here, $\mathbf{y}_{t}$ is a vector of observed contemporaneous variables; $\mathbf{x}_{t}$ is a vector of observed exogenous and lagged exogenous variables, and $\boldsymbol{\xi}_{t}$ is the vector of unobserved states. The vectors of stochastic disturbances are assumed to be Gaussian and mutually uncorrelated, with mean zero and covariance matrices $\mathbf{R}$ and $\mathbf{Q}$, respectively:}
    \mathbf{v}_{t} & \sim \mathcal{N}(0, \mathbf{R})\\
    \boldsymbol{\varepsilon}_{t} & \sim \mathcal{N}(0, \mathbf{Q})
\intertext{The first-stage model is represented by the following matrices:}
    \mathbf{y}_{t} &= \begin{bmatrix}
                        y_{t} & \pi_{t}
                        \end{bmatrix}\\
    \mathbf{x}_{t} &= \begin{bmatrix}
                        y_{t-1} & y_{t-2} & \pi_{t-1} \pi_{t-2,4}
                        \end{bmatrix}\\
    \boldsymbol{\xi}_{t} &= \begin{bmatrix}
                                y^{*}_{t} & y^{*}_{t-1} & y^{*}_{t-2}
                                \end{bmatrix}\\
\end{align*}

\end{document} 

enter image description here

Bernard
  • 271,350
  • Aside: I would also recommend dropping the \cdot directives -- they're neither required nor particularly helpful. – Mico Jun 03 '18 at 11:58
  • @Mico: I didn't focus on this aspect of the problem, but you're right. I've changed the code. – Bernard Jun 03 '18 at 12:04
  • @Bernard this is great! thanks. But you suggest that I watch out with using \intertext close to the end of the page? – Sean Jun 03 '18 at 12:13
  • Unless you're OK with possibly large blank spaces at the bottom of pages… – Bernard Jun 03 '18 at 12:15
  • @Bernard It appears that my file does not respond to \intertext, I do have the mathtools package though – Sean Jun 03 '18 at 12:20
  • ??? Anyway, \intertext is defined in amsmath; mathtools adds only \shortintertext (with a tighter spacing). Didn't you forget \ before \shortintertext? – Bernard Jun 03 '18 at 12:46
  • Also bm should be used; load it after mathtools so it will redefine \boldsymbol to be the same as \bm (which is however simpler to type). – egreg Jun 03 '18 at 13:50
1

If you want every equation environment to be left aligned, you can add the option fleqn when loading the amsmath package

\usepackage[fleqn]{amsmath}

or use flalign or flalign* environments instead if you only want this locally.

PLease see this post for more information.

EDIT using barbara beeton advice

\documentclass[10pt]{article}
\usepackage[fleqn]{amsmath}

\begin{document}
\makeatletter \@mathmargin=10pt\makeatother % to set flalign margin to 10 pt
\begin{flalign}
1+2=3
\end{flalign}
\end{document}
BambOo
  • 8,801
  • 2
  • 20
  • 47
  • I took a look, but I would prefer the equations still to be centered and vertically aligned within a section. fleqn aligns everything to the left. Thanks! – Sean Jun 03 '18 at 10:59
  • 2
    if the fleqn option is set, it should be possible to set the left margin for math with the following: \makeatletter \@mathmargin=<amount of indent> \makeatother. this muxt be done after \begin{document}. (not tested.) – barbara beeton Jun 03 '18 at 18:39
  • @barbarabeeton I just tested your solution and it works ! Big thanks for the advice – BambOo Jun 03 '18 at 19:58