selectedQr {multipleDL} | R Documentation |
QR Decomposition Preserving Selected Columns
Description
Runs a matrix through the QR decomposition and returns the transformed matrix and the forward and inverse transforming matrices
R, Rinv
. If columns of the input matrix X
are centered the QR transformed matrix will be orthogonal.
This is helpful in understanding the transformation and in scaling prior distributions on the transformed scale.
not
can be specified to keep selected columns as-is.
cornerQr
leaves the last column of X
alone (possibly after centering).
When not
is specified, the square transforming matrices have appropriate identity submatrices inserted
so that recreation of original X
is automatic.
Usage
selectedQr(X, not = NULL, corner = FALSE, center = TRUE)
Arguments
X |
a numeric matrix |
not |
an integer vector specifying which columns of |
corner |
set to |
center |
set to |
Value
list with elements X, R, Rinv, xbar
where xbar
is the vector of means (vector of zeros if center=FALSE
)
@export