GenQR: Generalized QR decomposition

View source: R/GenQR.R

GenQRR Documentation

Generalized QR decomposition

Description

Matrix X decomposed as Q and R (X=QR) where columns of Q are orthonormal. Ordinary QR or SVD may be used.

Usage

GenQR(x, doSVD = FALSE, findR = TRUE, makeunique = findR, tol = 1e-07)

Arguments

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().

Details

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.

Value

List with Q and R or just Q

Author(s)

Øyvind Langsrud

Examples

   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)

RegSDC documentation built on Aug. 19, 2022, 9:08 a.m.

Related to GenQR in RegSDC...