## math_proof 2 years ago method of least squares fit, y=Bx to the following n=6 points (3,4),(1,2),(5,4),(6,8),(3,6),(4,5) and it has to go through the origin can someone help me get started?

1. tkhunny

Did you answer the question last night? $$\sum{xy} = B\cdot\sum{x^{2}}$$ Have you seen it? Can you create it?

2. math_proof

you have to minimize the B right?

3. math_proof

how did you already get the summation etc without minimazing and taking derivatives?

4. tkhunny

No, you are minimizing the error. You must select the B that accomplishes this task.

5. tkhunny

You are asking good questions. This suggests that you have seen the development of Normal Equations.

6. tkhunny

$$I(B) = \left(y - Bx\right)^{2}$$ Find $$\dfrac{dI}{dB}$$.

7. math_proof

2x(y-Bx)?

8. math_proof

I don't get how did you get the summation equation that you posted, i know how to solve it from there, but how did you figured it out so fast

9. tkhunny

Negative x?

10. tkhunny

It doesn't matter, in this case. I just wanted to check to see that you had it right and were moving on.

11. math_proof

the question is if there is other way to coming up with the equation to the problem you came up with, instead of going through the minimalization formula then partial derivative =0

12. tkhunny

Well, there are some Matrix methods, but I'm guessing we don't want to talk about those, today. You have it just fine, excepting that this is a one-parameter derivation so it's just a Derivative, not a Partial Derivative. -2x(y-Bx) = 0 leads to what?

13. math_proof

-2xy-2bx^2 =0

14. math_proof

-2xy+Bx^2=0 sorry

15. math_proof

2Bx^2=+2xy B=2xy/2x^2 B=xy/x^2

16. math_proof

ii see it now

17. tkhunny

More importantly, $$xy = Bx^{2}$$. Resist the temptation to solve for B. If you've more than one parameter, you WILL become confused. Reach for the standard Normal Equation form.

18. math_proof

i am not really familiar with Normal Equation yet

19. tkhunny

Pretty much just: 1) Everything without a parameter on one side, and 2) Everything with a parameter on the other side - in ascending Order of the terms.

20. tkhunny

Solving for y = a + bx comes out: y = a + bx yx = ax + bx^2 For example.