Computes the LQ decomposition of a matrix.
lq(X)
A
L
An
Q
An
The returned values satisfy X = L %*% t(Q)
, up to
numerical precision.
If lq
computes the LQ decomposition of
qr2
for the related QR decomposition.
# NOT RUN {
X <- matrix(stats::rnorm(12), nrow = 3)
lq_X <- lq(X)
L <- lq_X$L
Q <- lq_X$Q
L
Q
trim(t(Q) %*% Q)
trim(X - L%*%t(Q))
# }
Run the code above in your browser using DataLab