Linear Algebra: Least Squares and vectors

In summary: That length is, of course, calculated by the dot product of v- w with itself and taking the square root of that. The length of that vector is [itex]\sqrt{\frac{61}{26^2}+\frac{103}{26^2}+\frac{62}{26^2}}= \frac{\sqrt{61^2+ 103^2+ 62^2}}{26}= \frac{\sqrt{94133}}{26}[/tex] In summary, to find the vector in subspace S that is closest to v, we use the dot product and the length of the projection of v onto S. We can then write v as the sum of a vector in
  • #1
kamui8899
15
0
Hi, I was working on a problem and I can't figure out what I'm supposed to do.

It reads, find the vector in subspace S that is closest to v; write v as the sum of a vector in S and a vector in S^a; and find the distance from v to S.

S spanned by {(1,3,4)} v = (2,-5,1)

Ok, what I did was I used some equation to find a least squares solution to Ax = b, where b is v and A is S.

So I took S and multiplied it by (1,3,4) and obtained 26.

And I then multiplied v by (1,3,4) and obtained -17

So the equation became:

26x = -17

x = -17/26

So when I multiply what I obtained for x and the vector that spans S together, I should get the point closest to v in/on S right?

Now, to find v as a sum of a vector in S and a vector in S^a, I just did the gram schmidt process.

Its long so instead of writing it out I'll just give you my answer:
(1/156)(414,-474,-252)

This vector is orthogonal to the vector that spans S, the dot product is 0.

So, assuming all of that is correct, I reached the point where I have to tell how far v is from S. I know where they're closest, when the vector in S is multiplied by the constant we obtained for x (-17/26). I have an orthogonal vector to S, but what am I supposed to do now? How do I write v as a sum of vectors in S and S^a , and how do I find the distance?
 
Last edited:
Physics news on Phys.org
  • #2
kamui8899 said:
Hi, I was working on a problem and I can't figure out what I'm supposed to do.
It reads, find the vector in subspace S that is closest to v; write v as the sum of a vector in S and a vector in S^a; and find the distance from v to S.
S spanned by {(1,3,4)} v = (2,-5,1)
Ok, what I did was I used some equation to find a least squares solution to Ax = b, where b is v and A is S.
So I took S and multiplied it by (1,3,4) and obtained 26.
S is a subspace. How do you multiply a vector times a subspace??

And I then multiplied v by (1,3,4) and obtained -17
?? The dot product of (1,3,4) and (2,-5,1) is 2- 15+ 4= -9.
So the equation became:
26x = -17
x = -17/26
So when I multiply what I obtained for x and the vector that spans S together, I should get the point closest to v in/on S right?
Now, to find v as a sum of a vector in S and a vector in S^a, I just did the gram schmidt process.
Its long so instead of writing it out I'll just give you my answer:
(1/156)(414,-474,-252)
This vector is orthogonal to the vector that spans S, the dot product is 0.
So, assuming all of that is correct, I reached the point where I have to tell how far v is from S. I know where they're closest, when the vector in S is multiplied by the constant we obtained for x (-17/26). I have an orthogonal vector to S, but what am I supposed to do now? How do I write v as a sum of vectors in S and S^a , and how do I find the distance?

I can't make heads or tails out of what you are doing. Since S is spanned by a single vector, it is a straight line in R3. What you are really doing is projecting v onto that straight line.
I suspect that when you say "So I took S and multiplied it by (1,3,4) and obtained 26" what you really did was take the dot product of (1,3,4) (I'm going to call that "u") with itself, getting 26 as the square of its length. Okay, you want that because the length of the projection of v onto S is the dot product of u with v divided by the length of v:
[tex]\frac{-9}{\sqrt{26}}[/tex].

The projection vector is a unit vector in the direction of (1,3,4), which is just (1,3,4) divided by [itex]\sqrt{26}[/itex] times that: That is
[tex]\frac{-9}{26}(1,3,4)= \left(\frac{-9}{26},\frac{-27}{26},\frac{-36}{26}\right)[/tex]
I'm going to call that "w".
Since w is the orthogonal projection of v in S, v- w is orthogonal to S.
v-w=[itex]\left(2+\frac{9}{26},-5+\frac{27}{26},1+\frac{36}{26}\right)= \left(\frac{61}{26},-\frac{103}{26},\frac{62}{26}\right)[/tex]

The length of that vector is the "distance" from v to its orthogonal projection on S, w.
 

What is least squares in linear algebra?

Least squares is a method in linear algebra used to find the best fit line or plane for a set of data points. It minimizes the squared differences between the predicted values and the actual values, hence the name "least squares". This method is commonly used in regression analysis and data modeling.

What are the applications of least squares in real life?

Least squares has various applications in different fields. In engineering, it is used in signal processing, control systems, and optimization problems. In finance, it is used in stock market analysis and portfolio management. It is also used in data mining, image processing, and machine learning.

What is a vector in linear algebra?

A vector in linear algebra is a mathematical object that has both magnitude and direction. It is represented by an arrow pointing from an initial point to a terminal point. Vectors are often used to represent physical quantities such as velocity, force, and displacement in physics.

How are vectors used in linear algebra?

Vectors are used in linear algebra to represent and manipulate data and equations in a concise and efficient manner. They are also used to describe geometric transformations such as rotations and translations. In addition, vectors are used to solve systems of linear equations and perform operations in vector spaces.

What is the dot product of two vectors?

The dot product of two vectors is a mathematical operation that results in a scalar quantity. It is calculated by multiplying the corresponding components of the two vectors and summing the products. The dot product is often used to find the angle between two vectors or to project one vector onto another.

Similar threads

  • Calculus and Beyond Homework Help
Replies
14
Views
591
  • Calculus and Beyond Homework Help
Replies
0
Views
449
  • Calculus and Beyond Homework Help
Replies
4
Views
1K
  • Calculus and Beyond Homework Help
Replies
24
Views
793
  • Calculus and Beyond Homework Help
Replies
7
Views
409
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
  • Calculus and Beyond Homework Help
Replies
4
Views
1K
  • Calculus and Beyond Homework Help
Replies
3
Views
929
  • Calculus and Beyond Homework Help
Replies
4
Views
1K
  • Calculus and Beyond Homework Help
Replies
5
Views
5K
Back
Top