1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Deriving The Quad. Eq. Using least squares.

  1. Aug 31, 2008 #1
    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.
     
  2. jcsd
  3. Aug 31, 2008 #2

    Doc Al

    User Avatar

    Staff: Mentor

    The method is called "completing the square" (not least squares). Google it!
     
  4. Aug 31, 2008 #3
    Really, my professor said that its the least squares method. Is it the same thing i assume then. I appreciate it very much doc.
     
  5. Aug 31, 2008 #4

    Redbelly98

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    No, they are different. "Least squares" is a method of fitting a best line or other equation to data.

    Are you looking for a quadratic equation that fits some data, or are you trying to solve for x in

    a x2 + b x + c = 0
     
  6. Aug 31, 2008 #5
    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.
     
  7. Aug 31, 2008 #6

    Redbelly98

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    Okay, so you are fitting a quadratic equation to some data.

    You must make some attempt at a solution before we can help you (PF rules). You might look at how fitting a linear equation using least squares works, and go from there.
     
  8. Aug 31, 2008 #7
    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 im lost after that!!!
     
  9. Sep 1, 2008 #8

    Redbelly98

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    So far so good.

    Next step is to take partial derivatives of & with respect to a, b, and c.
     
  10. Sep 1, 2008 #9

    Doc Al

    User Avatar

    Staff: Mentor

    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.)
     
  11. Sep 1, 2008 #10

    Redbelly98

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    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
     
  12. Sep 1, 2008 #11
    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.
     
  13. Sep 1, 2008 #12

    Redbelly98

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    You have 3 equations in the 3 unknowns (a, b, and c are the unknowns), so use standard techniques for solving linear systems of equations.

    Sx is Ex, Sxx is Ex^2, and Sxy is Exy, aren't they?
     
  14. Sep 1, 2008 #13
    Redbelly 98, Thank you for your help your amazing!!!
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Deriving The Quad. Eq. Using least squares.
  1. Least Squares (Replies: 1)

  2. Least squares (Replies: 8)

  3. Least Squares (Replies: 3)

Loading...