2

How to align the equation below with number in center of equation? And I need that the equations have same length.

\begin{equation}
\begin{aligned}
VAR(X)&=\frac{1}{12m}\sum_{u \in \Omega}\left( a_{u1}^2 +a_{u2}^2 + a_{u3}^2 + a_{u1}a_{u2} + a_{u1}a_{u3} + a_{u2}a_{u3}\right) - \left[ \frac{1}{m}\sum_{u \in \Omega} \frac{a_{u1} + a_{u2} + a_{u3}}{3} \right]^2\\
VAR(Y)&=\frac{1}{12m}\sum_{u \in \Omega}\left( b_{u1}^2 +b_{u2}^2 + b_{u3}^2 + b_{u1}b_{u2} + b_{u1}b_{u3} + b_{u2}b_{u3}\right) - \left[ \frac{1}{m}\sum_{u \in \Omega} \frac{b_{u1} + b_{u2} + b_{u3}}{3} \right]^2
\label{eq:variancia_amostral_triangulo_x_y}
\end{aligned}
\end{equation}

Wrong mode. enter image description here

1 Answer 1

5

This does the trick.... and makes VAR look less like V times A times R.

    \documentclass{article}

    \usepackage{amsmath}

    \begin{document}
    \begin{equation}
    \begin{aligned}
    \mathrm{VAR}(X)&=\frac{1}{12m}\sum_{u \in \Omega}\left( a_{u1}^2 +a_{u2}^2 + a_{u3}^2 + a_{u1}a_{u2} + a_{u1}a_{u3} + a_{u2}a_{u3}\right) \\
     & \qquad - \left[ \frac{1}{m}\sum_{u \in \Omega} \frac{a_{u1} + a_{u2} + a_{u3}}{3} \right]^2\\
    \mathrm{VAR}(Y)&=\frac{1}{12m}\sum_{u \in \Omega}\left( b_{u1}^2 +b_{u2}^2 + b_{u3}^2 + b_{u1}b_{u2} + b_{u1}b_{u3} + b_{u2}b_{u3}\right) 
    \\
    &\qquad - \left[ \frac{1}{m}\sum_{u \in \Omega} \frac{b_{u1} + b_{u2} + b_{u3}}{3} \right]^2
    \end{aligned}
     \label{eq:variancia_amostral_triangulo_x_y}
   \end{equation}

    \end{document}

output

4
  • 2
    "VAR" is probably short for "variance". Since the amsmath package is being loaded, it's a good idea to define \VAR as a math operator, say, \DeclareMathOperator{\VAR}{VAR}, and then write VAR(X)=.... For an extra bonus point, don't autosize the square brackets on lines 2 and 4; instead, use \biggl[ and \biggr].
    – Mico
    Aug 18, 2016 at 6:21
  • 2
    \label should go outside the aligned
    – egreg
    Aug 18, 2016 at 7:38
  • 1
    @Mico Got told off for using \DeclareMathOperator for Value at Risk in the past.... True, that had indices as opposed to an argument, but it's no less an operator than the variance.....
    – JPi
    Aug 18, 2016 at 12:46
  • @egreg: fixed...
    – JPi
    Aug 18, 2016 at 12:46

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.