Linear Algebra: Least Squares and vectors

Click For Summary
SUMMARY

The discussion focuses on solving a linear algebra problem involving least squares and vector projections. The subspace S is spanned by the vector (1, 3, 4), and the vector v is (2, -5, 1). The user correctly identifies the need to find the projection of v onto S, using the dot product to calculate necessary values. The final projection vector is derived as (-9/26)(1, 3, 4), and the distance from v to S is computed by determining the orthogonal vector from v to its projection.

PREREQUISITES
  • Understanding of vector spaces and subspaces
  • Familiarity with dot products and vector projections
  • Knowledge of the Gram-Schmidt process for orthogonalization
  • Basic concepts of least squares solutions in linear algebra
NEXT STEPS
  • Study the derivation of vector projections in R3 using dot products
  • Learn about the Gram-Schmidt process for creating orthogonal bases
  • Explore least squares methods in more complex linear systems
  • Investigate the geometric interpretation of projections in higher dimensions
USEFUL FOR

Students and professionals in mathematics, particularly those studying linear algebra, as well as data scientists and engineers working with vector spaces and optimization problems.

kamui8899
Messages
15
Reaction score
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
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]<br /> <br /> The length of that vector is the "distance" from v to its orthogonal projection on S, w.[/itex]
 

Similar threads

Replies
15
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 5 ·
Replies
5
Views
7K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 24 ·
Replies
24
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
4
Views
2K