Calculating Line of Best Fit: Least Squares Method

  • Thread starter Thread starter EngNoob
  • Start date Start date
  • Tags Tags
    Fit Line
AI Thread Summary
The discussion revolves around calculating a line of best fit using the least squares method, specifically focusing on the construction of the ATA matrix. The user has created a 2x2 matrix and is confused about how to derive the element 26 in the ATA matrix from their data. After some clarification, it is noted that the element represents the sum of squares of the t values, which is calculated as the sum of t squared, not simply multiplying the sum of t by itself. The user acknowledges their misunderstanding regarding the notation and successfully resolves their confusion. The discussion highlights the importance of correctly interpreting matrix operations in the least squares fitting process.
EngNoob
Messages
32
Reaction score
0
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 textbook has the inverse matrix, and the matrix of co-ordinates used to create the origional matrix, and i don't get how the anser is established

Any help most appreciated
 
Physics news on Phys.org
EngNoob said:
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 textbook has the inverse matrix, and the matrix of co-ordinates used to create the origional matrix, and i don't get how the anser is established

Any help most appreciated

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?
 
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,

[1][0]
[1][1]
[1][3]
[1][4]

and have another matrix b

[0]
[1]
[2]
[5]

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

[4][8]
[8][26]

What i don't understand, is how does the 26 get their?

The forumula says sum t^2, or 8 x 8, which is 64. 8 doesn't 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, can't figure out from the data where 26 comes from?

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

Perform the design matrix product (A^{T}A) yourself, and I think you'll see.
 
Spot on, i have the answer now, i was been a little thick, (t) t meaning transpose right, thanks...
 
Since ##px^9+q## is the factor, then ##x^9=\frac{-q}{p}## will be one of the roots. Let ##f(x)=27x^{18}+bx^9+70##, then: $$27\left(\frac{-q}{p}\right)^2+b\left(\frac{-q}{p}\right)+70=0$$ $$b=27 \frac{q}{p}+70 \frac{p}{q}$$ $$b=\frac{27q^2+70p^2}{pq}$$ From this expression, it looks like there is no greatest value of ##b## because increasing the value of ##p## and ##q## will also increase the value of ##b##. How to find the greatest value of ##b##? Thanks
Back
Top