1. Limited time only! Sign up for a free 30min personal 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!

Homework Help: Least Squares solution and residuals

  1. Aug 3, 2011 #1
    1. The problem statement, all variables and given/known data

    Solve the following linear equations simultaneously by the Least Squares solution and calculate the residuals.

    2. Relevant equations

    3x + 2y + z = 5

    x + 6y - z = -7

    x - y + 2z = 3

    5x - 2y = 1

    3. The attempt at a solution

    This is a question from this guy at work who is studying to be a surveyor. He knows me as the "Maths Genius" because I recently finished high school and got Valedictorian. He is really old and doesn't really get computers/internet. However I didn't learn this sort of thing in high school, and after watching this [http://www.youtube.com/watch?v=8mAZYv5wIcE]khanacademy[/test] vid, I only understood the Matrix forms but know nothing of the A transpose. Any help is appreciated.
  2. jcsd
  3. Aug 4, 2011 #2


    User Avatar
    Homework Helper

    The transpose of a matrix A is a matrix formed from A by interchanging the rows and columns such that row i of matrix A becomes column i of the transposed matrix. The transpose of A is denoted by AT. Multiplying a matrix A with its transposed you get a square matrix.

  4. Aug 4, 2011 #3
    Hey ehild,

    Thanks for the information. I found a bit more info on AT and I understand that part of it now. But I still don't understand the rest. A friend of mine is in his first year at uni and has dealt with some of it but doesn't know anything about the Least squares method or how to calculate residuals. Any info is appreciated, even something to point me in the right direction. I am happy to learn :smile:
  5. Aug 4, 2011 #4


    User Avatar
    Homework Helper

    This least squares problem is more general than the method used for curve fitting and I am familiar with. Try to read:

    http://www.mathworks.com/moler/leastsquares.pdf [Broken]

    Last edited by a moderator: May 5, 2017
  6. Aug 4, 2011 #5

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    If you have access to EXCEL (or similar open-source spreadsheets) you can solve this directly using the Solver Tool: you want to minimize (3x+2y+z-5)^2+ ... +(5x-2y-1)^2, by varying x, y and z. Solver can handle such problems readily, up to a few hundred variables and equations.

Share this great discussion with others via Reddit, Google+, Twitter, or Facebook