How do I use Least Square Fitting to Calculate the Best Line of Fit?

EngNoob
Messages
32
Reaction score
0
Hey

I need to use the Least Square Fitting approach to calculating the best line of fit.

I have read loads, and can't seem to figure out how to get passed the Inverse matrix part?

Anyone know any good links, or can guide me on how to do least square fitting?

Thanks
 
Mathematics news on Phys.org
There are about a dozen different way of finding "least squares" lines, some of which use matrices. What matrix are finding an Inverse matrix for? What do you mean "get passed the inverse matrix".
 
Ok, here is what i have done

I have matrix "A" Matric "B".

Using Matrix "A" i can get "Matrix C"

I then inverse matrix "C", However, the numerical approach i am taking is giving me the wrong matrix where i compare it with a inverse from Maple

here is my matrix C

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

From this i get det (40)

I know the answer is

1/20 [13][-4]
[-4][ 2]

I however don't get this...

So i am stuck on inversing the matrix.

i get det C at 1/40 and not 1/20
 
Since you refuse to show us what you did I can only suggest one thing: have you considered reducing fractions?
 
Sorry...

I have solved this now...

I never transposed matrix "A" to for ATA, once i have transposed then i got all the values for the determinent and inverse and ultimatly the solution.

Matrix A and B:

[■(1&1@1&3@1&7@1&4)] [■(C@D)]= [■(3@8@5@7)]

Transpose A to produce ATA

A^T A= [■(1&1&1&1@1&3&7&4)] [■(1&1@1&3@1&7@1&4)]= [■(4&15@15&75)]


This is how i solved it. thanks again for the help.
 
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
Thread 'Imaginary Pythagorus'
I posted this in the Lame Math thread, but it's got me thinking. Is there any validity to this? Or is it really just a mathematical trick? Naively, I see that i2 + plus 12 does equal zero2. But does this have a meaning? I know one can treat the imaginary number line as just another axis like the reals, but does that mean this does represent a triangle in the complex plane with a hypotenuse of length zero? Ibix offered a rendering of the diagram using what I assume is matrix* notation...
Back
Top