What is the difference between Gram-Smith QR decomposition procedure and qr.m function in Matlab?
9 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Osama Al-Shalali
il 28 Set 2020
Commentato: Christine Tobler
il 22 Ott 2020
Hi everyone!
I want to know what is the differnce between the Gram-Smith procedure and qr.m function in matlab. Why there is a fourth coulmn resulting from using qr.m function? The photo is attached for the Gram-Smith procedure .Any help will be so appreciated.
The code is
A=[1 -2 -1; 2 0 1; 2 -4 2;4 0 0];
[Q,R] = qr(A)
The result is
Q =
-0.2000 0.4000 0.8000 -0.4000
-0.4000 -0.2000 -0.4000 -0.8000
-0.4000 0.8000 -0.4000 0.2000
-0.8000 -0.4000 0.2000 0.4000
R =
-5.0000 2.0000 -1.0000
0 -4.0000 1.0000
0 0 -2.0000
0 0 0

0 Commenti
Risposta accettata
Christine Tobler
il 28 Set 2020
MATLAB's QR decomposition is computed using Householder transformations, which is generally more numerically advantageous.
9 Commenti
f
il 22 Ott 2020
Modificato: f
il 22 Ott 2020
Just a tiny detail: Matlab's qr does not ensure that det(Q)=1. The determinant of Q may be 1 or -1; it is data-dependent, since it is (-1)^(number_of_nontrivial_reflectors_used). So it cannot be used in a straightforward way to determine the sign of det(A).
Christine Tobler
il 22 Ott 2020
Good point, det(R) will only tell you the absolute value of the original matrix, otherwise you would have to construct the complete Q matrix to compute the sign of its determinant.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Linear Algebra in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!