Finding orthonormal set using Gram-Schmidt and least squares

In summary: Thanks!I think I understand now. The orthonormal set (Q) is equal to the space A=QR. But since Q is orthogonal, the solution to the least squares problem is x=(QR)^{T}b. But that doesn't seem to be the answer I'm getting. Can you help me solve for x(hat)?
  • #1
tatianaiistb
47
0

Homework Statement



A) Find an orthonormal set q1, q2, q3 for which q1,q2 span the column space A [1 1; 2, -1; -2,4] (this is a 3x2 matrix).

B) Which fundamental subspace contains q3?

C) What is the least-squares solution of Ax=b if b=[1 2 7]T?

Homework Equations



Gram-Schmidt

The Attempt at a Solution



A) So I figured out q1, q2, and q3 using Gram-Schmidt process. These are q1 = [1/3 2/3 -2/3]T, q2 = [2/3 1/3 2/3]T, and q3 = +-[-2/3 2/3 1/3]T

B) Don't know how to determine this

C) For the least square, since they are orthonormal sets, I used the formula x= [q1Tb; q2Tb] However, I'm not getting the right answer. In addition, I tried doing it the long way using the formula x=(ATA)-1ATb, I'm getting even different numbers... Please help!
 
Physics news on Phys.org
  • #2
You found the orthonormal set (Q), but that is not equal to A. What is A equal to?
 
  • #3
[1 1
2 -1 = A
-2 4]

I'm now only having trouble with part C. Thanks!
 
  • #4
Yes, I understand. But there is another way to represent [itex]A[/itex] using the orthogonal basis that you constructed and another factor of [itex]A[/itex]. This factor, call it [itex]R[/itex], is an upper right triangular matrix. [itex]R[/itex] is constructed such that [itex]QR = A[/itex]. We note [itex]Q[/itex] is orthogonal so [itex]Q^{T} = Q[/itex]. Thus, using this factorization for [itex]A[/itex] in the normal equations yields a linear triangualr system for solving the Least Squares problem.
 
  • #5
I should add that, as part of the construction of Q, you will have already computed the elements of R.
 
  • #6
Thanks Theo! I do understand about A=QR and the construction of it. But I don't understand how that can help me finding x(hat), which is the least-squares solution.

What I was thinking is that x(hat)=Q^T*b because Q has already orthonormal vectors.

I'm getting that x(hat) = (-3 6 3)^T, but it says the solution is supposed to be x(hat) = [1 2]^T which they supposedly got from q1^Tb and q2^Tb. However, if I multiply the very same q's I got (which I was confirmed are correct) by the given b, I'm not getting the given answer. So I'm going in circles... Any help?
 
  • #7
Firstly, let me make a correction to one of my previous posts (post #4).

We note [itex]Q[/itex] is orthogonal so [itex]Q^{T}=Q[/itex].

should read

We note [itex]Q[/itex] is orthogonal so [itex]Q^{T}=Q^{-1}[/itex].

Secondly, return to the Normal equations for the Least Squares solution:

[tex]
A^{T}A \, x = A^{T} \, b
[/tex]
Now substitute the factor expresion for [itex]A[/itex], ie, [itex]A=QR[/itex]
[tex](QR)^{T}(QR)\,x = (QR)^{T}b[/tex]
[tex]R^{T}(Q^{T}Q)\,R\,x = R^{T}Q^{T}b[/tex]
[tex]R^{T}R\,x = R^{T}Q^{T}b[/tex]
since [itex]Q^{T}Q=I[/itex]. Now pre-multiply both sides by [itex]R^{-T}[/itex] to yield
[tex]R\,x = Q^{T}b[/tex]
It is this system that you need to solve for [itex]x[/itex] to yield the Least Squares solution. Remember, just because you found the orthogonal basis for [itex]A[/itex] doesn't mean its equal to [itex]A[/itex] . There is a certain amount of translation and rotation of that basis to yield that [itex]A[/itex] (hence the [itex]R[/itex] factor).

Remember, [itex]R[/itex] is triangular, so a simple backsolve operation will yield the solution (no need to compute [itex]R^{-1}[/itex]).
 

FAQ: Finding orthonormal set using Gram-Schmidt and least squares

1. What is an orthonormal set?

An orthonormal set is a set of vectors in a vector space that are all mutually perpendicular (orthogonal) and have a magnitude of 1 (normalized).

2. How do you find an orthonormal set using Gram-Schmidt?

To find an orthonormal set using Gram-Schmidt, you start with a set of linearly independent vectors and use the Gram-Schmidt process to orthogonalize and normalize them. This involves subtracting the projections of each vector onto the previous vectors in the set, and then dividing by the magnitude to normalize.

3. What is the purpose of using Gram-Schmidt in finding an orthonormal set?

The purpose of using Gram-Schmidt is to convert a set of linearly independent vectors into an orthonormal set, which can make certain calculations and proofs easier. It is also used in many applications, such as signal processing and data compression.

4. Can the Gram-Schmidt process always find an orthonormal set?

No, the Gram-Schmidt process can only find an orthonormal set if the original set of vectors is linearly independent. If the original set is linearly dependent, the process will fail.

5. How is least squares used in finding an orthonormal set?

Least squares is used in finding an orthonormal set to minimize the error between the original set of vectors and the orthonormal set. This is done by finding the least squares solution, which is the closest approximation to the original set using the orthonormal set.

Similar threads

Replies
2
Views
784
Replies
16
Views
2K
Replies
1
Views
1K
Replies
14
Views
2K
Replies
1
Views
2K
Replies
3
Views
2K
Replies
5
Views
8K
Back
Top