Deriving The Quad. Eq. Using least squares.

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
12 replies · 4K views
juice34
Could someone show me exactly how to derive the quadratic equation from the least squares method? I have no idea where to start. I will appreciate it very much. Thankyou.
 
Physics news on Phys.org
The method is called "completing the square" (not least squares). Google it!
 
Really, my professor said that its the least squares method. Is it the same thing i assume then. I appreciate it very much doc.
 
Im tryin to derive the least squares method for a quadratic equation. I also want to find expressions for the three coefficients in terms of sums Sx, Sy, Sxx, etc.
 
Here is what i have Y=ax^2+bx+c. Then the residual is d(i)=y(xi) so di=yi-(ax^2i+bxi+c). Then i take the sum of the square of the residuals. &(a,b,c)=E di^2=E((ax^2i+bxi+c))^2 and then I am lost after that!
 
juice34 said:
Really, my professor said that its the least squares method. Is it the same thing i assume then. I appreciate it very much doc.
Oops. I thought you were looking for a derivation of the quadratic formula itself (which happens to be done via "completing the square"). But you are looking to derive the parameters of a least squares fit to a quadratic function. My bad!

Redbelly98's got you covered. (I'll move this back to Calc & Beyond.)
 
juice34 said:
Here is what i have Y=ax^2+bx+c. Then the residual is d(i)=y(xi) so di=yi-(ax^2i+bxi+c). Then i take the sum of the square of the residuals. &(a,b,c)=E di^2=E((ax^2i+bxi+c))^2 and then I am lost after that!

Wait, I just spotted an error here. Might be just a typo on your part, but since

di = yi-(axi^2+bxi+c)

then

di^2 = ( yi - (axi^2+bxi+c))^2

not ((axi^2+bxi+c))^2
 
Yes you are correct Redbelly98. Ok so i differentiated with respect to a, b, and c then rearranged to get 3 equations.
1.aEx^4+bEx^3+cEx^2=Eyx^2
2.aEx^3+bEx^2+cEx=Exy
3.aEx^2+bEx+cn=Ey Where E is a summation. Now my problem is how do i define these into expressions for the three coefficients in terms of sums Sx, Sy, Sxx, etc. And how do i know how many of these S terms i will need and how do i define them. Defining them being where do i get the x,y, xx, xy, yy, etc from? Thank you all for who contributed.
 
Redbelly 98, Thank you for your help your amazing!