GenQR | R Documentation |
Matrix X decomposed as Q and R (X=QR) where columns of Q are orthonormal. Ordinary QR or SVD may be used.
GenQR(x, doSVD = FALSE, findR = TRUE, makeunique = findR, tol = 1e-07)
x |
Matrix to be decomposed |
doSVD |
When TRUE SVD instead of QR |
findR |
When FALSE only Q returned |
makeunique |
When TRUE force uniqueness by positive diagonal elements (QR) or by column sums (SVD) |
tol |
As input to qr or, in the case of svd(), similar as input to MASS::ginv(). |
To handle dependency a usual decomposition of X is PX=QR where P is a permutation matrix. This function returns RP^T as R. When SVD, Q=U and R=SV^T.
List with Q and R or just Q
Øyvind Langsrud
GenQR(matrix(rnorm(15),5,3)) GenQR(matrix(rnorm(15),5,3)[,c(1,2,1,3)]) GenQR(matrix(rnorm(15),5,3)[,c(1,2,1,3)],TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.