1

I'm just going through my notes, and noticed I couldn't follow how to do this step, in deriving a formula for the variance.

$$ V(Y) = E\left[\sum_i^n a_i (Y_i - \mu_i)\right]^2$$ $$ =E\left[\sum_i^n a_i^2(Y_i -\mu_i)^2 +\sum_i^n\sum_i^na_ia_j(Y_i-\mu_i)(Y_j-\mu_j)\right],\space i\neq j$$

What's the technique for expanding this kind of sum? Why do the double summations get involved. Would be happy with an answer showing a link to the technique itself, if not solving the question specifically.

I can see where the first component comes from, but am lost on how/where the double summation comes from. Especially confused on why the indexing changes when we start off with just one index.

Thank you so much!

HonsTh
  • 93
  • Are you sure the equation is correct? What is $m$? (There is also an opening square bracket after the second $E$ with no closing square bracket.) I think the basic idea that is being used is that $(\sum_i^n x_i)^2=(\sum_i^n x_i)(\sum_j^n x_j)$. – smcc Sep 08 '18 at 19:18
  • Thanks - you're correct - I was reading it wrong! However, I'm still confused on the second line. Where does the $ Y_j$ come from, why do we have anything after the $\sum_i^n a_i^2(Y_i - \mu_i)^2$ component of the equation? – HonsTh Sep 08 '18 at 19:25
  • It is still unclear what the upper limit $m$ is on the last summation symbol. Your last question is easy to answer: generally ($\sum_i^n x_i)^2\neq \sum_i^n x_i^2$ (for example, $(1+2)^2\neq 1^2+2^2$) – smcc Sep 08 '18 at 19:27
  • Sorry - fixed. So is this a rule for the square of a variable within a sum? Where does the derivation of that second line follow from is what I am interested in. – HonsTh Sep 08 '18 at 19:45
  • Why has $j$ changed to a $i$ in the last sum? Have you got a picture of the equation? (Note there is a related question here: https://math.stackexchange.com/questions/1187687/expansion-of-the-square-of-the-sum-of-n-numbers.) – smcc Sep 08 '18 at 19:49
  • Ah yes, correct again. The sums both only have $i$'s in them, but the second half of the components should be $j$'s where $ i \neq j$. Thanks for the link, it was what I was after – HonsTh Sep 08 '18 at 19:52
  • This is really an algebra question. You take an expectation after you do the algebra, and the thing that is asked about is only what you do BEFORE taking the expectation. – Michael Hardy Sep 08 '18 at 20:46

1 Answers1

1

$\begin{align*} \left[\sum_i^n x_i\right]^2&=\left[\sum_i^n x_i\right]\left[\sum_j^n x_j\right]\\ &=\sum_i^n x_i(x_1+x_2+\cdots+x_n)\\ &=x_1(x_1+x_2+\cdots+x_{n-1}+x_n)+\cdots +x_n(x_1+x_2+\cdots +x_{n-1}+x_{n})\\ &=(x_1^2+\cdots+x_n^2)+x_1(x_2+\cdots+x_{n-1}+x_n)+\cdots +x_n(x_1+x_2+\cdots +x_{n-1})\\ &=\sum_i^n x_i^2+ x_1\sum_{j\neq 1}^nx_j+\cdots +x_n\sum_{j\neq n}^nx_j\\ &=\sum_i^n x_i^2+ \sum_i^nx_i\sum_{j\neq i}^nx_j\\ &=\sum_i^n x_i^2 +\sum_i^n\sum_{j\neq i}^nx_ix_j \end{align*}$

smcc
  • 5,694
  • Thanks so much for this! – HonsTh Sep 08 '18 at 19:58
  • I changed $\displaystyle [\sum_i^n x_i]^2 = [\sum_i^n x_i] [\sum_j^n x_j ]$ to $\displaystyle \left[\sum_i^n x_i\right]^2=\left[\sum_i^n x_i\right]\left[\sum_j^n x_j\right].$ That seems to improve legibility. Notice that just using \left and \right is all you need; you don't need to assess the sizes yourself; the software does that for you. – Michael Hardy Sep 08 '18 at 20:45