solve A * A^T *x = b by QR factorization
2 views (last 30 days)
Show older comments
Hi guys,
I would like to solve the following system in Matlab with QR factorization of A^T
A * A^T *x = b
with A \in R^(m x n) , x \in R^m and b \in R^m. In my case is n>m.
I know how to do a QR factorization of A and solve Ax=b. I hope you can help me solve my problem.
0 Comments
Answers (1)
John D'Errico
on 29 Dec 2018
Can you solve this in two steps? Thus, if you know
A*A' * x = b
Does the associative law apply to matrix multiplication? (Yes.)
Then is it not true that this is just:
A* (A' * x) = b
Now, I could swear I recall you telling us that you already knew how to solve PART of that problem. That is, can you solve the problem
A*y = b
So IF you did that, then what could you say about y? How is y related to x?
Now solve the resulting problem. Even better, you already have a factorization for A', since you have a factorization of A. That is, if
A = Q*R
then just take the transpose. What is the transpose of the product of two matrices? Use a search engine if you do not know that already.
4 Comments
John D'Errico
on 30 Dec 2018
Edited: John D'Errico
on 30 Dec 2018
To show that MATLAB does know how to solve triangular systems efficiently, here is an example:
A = rand(5000);
[L,U] = lu(A);
b = rand(5000,1);
timeit(@() U\(L\b))
ans =
0.26981
timeit(@() A\b)
ans =
2.6015
Once you have R from the QR, the solve itself is quite efficient.
See Also
Categories
Find more on Linear Algebra in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!