6

Is there anyway I can pull x out of this summation to solve for it?

$$ 0 = \frac{-2}{N} \sum_i^N a_i(b_i - (xa_i))$$

EDIT: Thanks for all the quick comments guys.

I am confused by a certain step everyone seems to be taking.

$$ -\sum_i^N xa_i^2 = -x\sum_i^N a_i^2 $$

Can someone explain or link me to somewhere that explains how this is true.

  • Answers handle the $x$, but I'll note that you can remove the $-2/N$ factor out front. (Just divide through on both sides of the equation.) – Blue Jul 10 '13 at 16:24

4 Answers4

10

given

$$0 = \dfrac{-2}{N} \sum_i^N a_i(b_i - (xa_i))$$

$0=\dfrac{-2}{N} \sum_i^N(a_ib_i-xa_i^2)$

$0=\dfrac{-2}{N} \big (\sum_i^Na_ib_i-\sum_i^Nxa_i^2)$

$0=\dfrac{-2}{N} \big (\sum_i^Na_ib_i-x\sum_i^Na_i^2)$

EDIT : Here, we treat $x$ as a constant. Hence it can be 'pulled' out of the summation

For example :

$2+4+6=12$

$2(1+2+3)=12$

here, $2$ being a constant can be 'pulled' out from the summation

dajoker
  • 2,297
  • 14
  • 25
  • 2
    Thanks that makes sense now. I feel I lose all common sense when I see a summation. – still learning Jul 10 '13 at 16:41
  • happy to help:) – dajoker Jul 10 '13 at 16:42
  • 1
    @Ian: Perhaps your common sense will return when you accept that summations are summations. Although the $\Sigma$ notation is sometimes scary-looking, it only serves to abbreviate expressions of addition, which is one of the least-scary operations we have! So, things like the Distributive Property and factoring-out constants work exactly as you expect. – Blue Jul 10 '13 at 16:54
  • @stilllearning, please accept an answer if you think it is satisfactory. – dajoker Jul 29 '13 at 16:36
1

Hint: The sum is $\sum_{i=1}^N a_ib_i-x\sum_{i=1}^N a_i^2$.

André Nicolas
  • 507,029
1

You can, with a bit of work. We have $$ \sum_i^Na_i(b_i-xa_i) = \sum_i^N(a_ib_i-xa_i^2) = \sum_i^Na_ib_i-x\sum_i^N a_i^2 $$ and from there it's easy.

Rick Decker
  • 8,718
0

This is not an answer but a question:

This looks like the summations involved when you are fitting a straight line through the origin to a set of data points by least squares. Is that what you are trying to do?

If you are learning about least squares and other types of fitting, you will be doing a $lot$ of summations, and you will need to get comfortable with them.

marty cohen
  • 107,799