Questions about using matrices for finding best straight line by linear regression
In examples I have seen so far which show how to find a line which best fits a set of points, the equations are set out in a matrix form and so I am learning about matrices.
To simplify suppose we have thre points then the eqautions are
x1*m +c = y1
x2*m +c = y2
x3*m + c = y3
(m is the slope, c the offset)
in matrix form we can have
$\begin{bmatrix} x_1 & 1 \\ x_2 & 1 \\ x_3 & 1 \end{bmatrix} $ $\begin{bmatrix} m \\ c \end{bmatrix} $ = $\begin{bmatrix} y_1 \\ y_2 \\ y_3 \end{bmatrix} $
so say this is
X M = Y
Then to remove the X on the left side we need to multiply X by the inverse of X, and to do that we need X to be a square matrix. If X is n x 2 then we can multiply by a matrix D say which is 2 x n to give n x n.
In the examples I have seen D is chosen to be the transpose of X.
Question 1
Why use the transpose of X? couldn't we use any matrix within reason which is 2 x n?
Question 2
How does the whole think work anyhow considering that the measured points will not be exactly on the straight line so really we should write
x1*m +c = y1 + e1
x2*m +c = y2 + e2
x3*m + c = y3 + e3
where e is the error in y.
Is the assumption that if the errors were included in the calculation then they would average out to zero?
The same questions relate to finding the best circle for a set of measured points.
Answer
- The questioner was satisfied with and accepted the answer, or
- The answer was evaluated as being 100% correct by the judge.
-
Thank you Amas that's a very comprehensive answer in greater depth than I was expecting.
- answered
- 2590 views
- $10.00
Related Questions
- Consider the matrix, calculate a basis of the null space and column space
- Let $H$ be the subset of all 3x3 matrices that satisfy $A^T$ = $-A$. Carefully prove that $H$ is a subspace of $M_{3x3} $ . Then find a basis for $H$.
- Determine values of some constant which equate linear operators whose linear transformation is through a different basis of the same vector space.
- Functions, matrices, determinates, differentation questions.
- How to filter data with the appearance of a Sine wave to 'flattern' the peaks
- Find a vector parametric form and symmetric form, find minimal distance betwen L and P, consider vectors v and w.
- Linearly independent vector subsets.
- Find the values of a, for which the system is consistent. Give a geometric interpretation of the solution(s).
I don't understsand the last question, about the circle. Could you expand on it perhaps?
If you want to find the best circle fit you can adopt the same approach- Maybe I shouldn't have mentioned the ciircles! If the measured point is x,y and the arc centre is a,b and the radius is r then (x - a)^2 + (y - b)^2 = r^2 By expanding you can get the same sort of matrix arrangement but more columns for X. But again in examples I have seen the transpose of X is used to mltiply X, and again the errors in measured values are ignored.
Low bounty!
Maybe. The question seems to me like a simple one and it would take someone less than 5 minutes to read and less tha 5 minutes to answer. So that's $60 an hour. If I'm wrong I'll reconsider, but I'm not a mathemetician so my judgement is not good.