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

In summary, the conversation is about using the Least Square Fitting approach to calculate the best line of fit. The person is stuck on the Inverse matrix part and is asking for help or resources to understand it better. They mention using matrices and comparing their results to Maple, but do not show their work. Eventually, they figure out that they need to transpose matrix A to get all the values for the determinant and inverse.
  • #1
EngNoob
38
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
  • #2
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".
 
  • #3
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
 
  • #4
Since you refuse to show us what you did I can only suggest one thing: have you considered reducing fractions?
 
  • #5
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.
 

1. What is the Least Square Fitting Line method?

The Least Square Fitting Line method is a mathematical technique used to find the best-fit line for a set of data points. It minimizes the sum of the squared vertical distances between the data points and the line.

2. How is the Least Square Fitting Line calculated?

The Least Square Fitting Line is calculated by finding the slope and intercept of the line that minimizes the sum of the squared vertical distances between the data points and the line. This is typically done using a regression analysis or by solving the least squares equations.

3. What is the purpose of using the Least Square Fitting Line method?

The purpose of using the Least Square Fitting Line method is to find the line of best fit for a set of data points. This allows us to make predictions and draw conclusions based on the relationship between the variables represented by the data points.

4. What are the assumptions made when using the Least Square Fitting Line method?

The assumptions made when using the Least Square Fitting Line method are that the data points are randomly and independently sampled, the relationship between the variables is linear, and the errors in the data are normally distributed.

5. What are the limitations of the Least Square Fitting Line method?

The limitations of the Least Square Fitting Line method include the assumption of a linear relationship between variables, the sensitivity to outliers, and the inability to handle non-linear relationships between variables. It also assumes that the errors in the data are normally distributed, which may not always be the case.

Similar threads

Replies
4
Views
1K
  • General Math
Replies
19
Views
5K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
1K
  • Programming and Computer Science
Replies
4
Views
636
  • General Math
Replies
2
Views
2K
Replies
10
Views
3K
Replies
1
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
16
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
13
Views
1K
Replies
11
Views
2K
Back
Top