for some numbers ri ii denoting the corresponding upper triangular matrix [ri by rwe have in matrix notationr qr [ [ ar pp which yields qr decomposition the qr decomposition can be used to efficiently solve least-squares problemsthis will be shown shortly it can also be used to calculate the determinant of the matrix awhenever is square namelydet(adet(qdet(rdet( )and since is triangularits determinant is the product of its diagonal elements there exist various improvements of the gram-schmidt process (for examplethe householder transformation [ ]that not only improve the numerical stability of the qr decompositionbut also can be applied even when is not full rank an important application of the qr decomposition is found in solving the least-squares problem in ( ntimeminp kxb yk br for some rnxp (modelmatrix using the defining properties of the pseudo-inverse in definition one can show that kxxy yk kxb yk for any in other wordsb : minimizes kxb yk if we have the qr decomposition qrthen numerically stable way to calculate with an ( ncost is via (qr) rqy rqy if has full column rankthen rr- note that while the qr decomposition is the method of choice for solving the ordinary least-squares regression problemthe sherman-morrison recursion is the method of choice for solving the regularized least-squares (or ridgeregression problem singular value decomposition singular value decomposition one of the most useful matrix decompositions is the singular value decomposition (svdtheorem singular value decomposition any (complexmatrix matrix admits unique decomposition usvwhere and are unitary matrices of dimension and nrespectivelyand is real diagonal matrix if is realthen and are both orthogonal matrices proofwithout loss of generality we can assume that (otherwise consider the transpose of athen aa is positive semidefinite hermitian matrixbecause haavvi vaav kavk for all henceaa has non-negative real eigenvaluesl