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: Best Fit of Line

  1. Apr 8, 2008 #1
    I need to calculate a line of best fit, using...

    The least square fit method.

    I am upto the stage where i have created my matrix 2 x 2, and then i have invesed the matrix 2 x 2 and then got a fraction and a [2x2] matrix.

    Now i am stuck.

    The text book has the inverse matrix, and the matrix of co-ordinates used to create the origional matrix, and i dont get how the anser is established

    Any help most appreciated
  2. jcsd
  3. Apr 8, 2008 #2


    User Avatar
    Science Advisor

    This tells us nothing about what you have actually done. What points is the line supposed to fit? What matrices did you construct? What formula are you using?
  4. Apr 9, 2008 #3
    Ok, this was a very stupidly produced post, so sorry.

    Here is the data i have.

    I have a matrix, which is m x t,


    and have another matrix b


    Using the least square fit process, i need to establish an ATA Matrix or

    [ sum m ] [ sum t ]
    [ sum t ] [ sum t ^2 ]

    I have been given the answer to this as


    What i dont understand, is how does the 26 get their?

    The forumula says sum t^2, or 8 x 8, which is 64. 8 doesnt go into 26 either, so i am at a loss what i am doing wrong?

    Maybe i am using the wrong formula?

    The det(ATA) is 40, which would indicate the 26 should be there, however, cant figure out from the data where 26 comes from?

    Any help appreciated, and sorry for the weak post...
  5. Apr 10, 2008 #4
    That last element is sum(t^2), ie, the sum of squares.

    Perform the design matrix product ([itex]A^{T}A[/itex]) yourself, and I think you'll see.
  6. Apr 11, 2008 #5
    Spot on, i have the answer now, i was been a little thick, (t) t meaning transpose right, thanks....
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook