solve.qr.Matrix(a, b, tol=0)
qr.Matrix
, representing the QR decomposition of a matrix.
transpose=T
The number of rows of
b
must equal the
number of rows of
a
, while if
transpose=F
the number of rows of
b
must
equal the number of columns of
a
.
tol
is negative, no
condition estimation is done. Otherwise, the reciprocal one norm condition
estimate is computed and the solve or inverse computation is done only if
the condition estimate is greater than
tol
. By default
tol = 0
.
a
is to be used in the solve or inverse operation.
The default is to use the untransposed matrix.
The method does not allow a solve using the transpose of an
underdetermined system.
A
is the matrix whose QR decomposition is represented by
a
,
an object of class
Matrix"
is returned that is a least-squares solution
x
to the system of equations A %*% x = b if
A
has at least as many rows
as columns and a basic solution to the system of equations if
A
has fewer
rows than columns. If
b
is not supplied, the pseudo-inverse of
A
is
returned.
Attributes include a copy of the call to
solve
,
and the one norm reciprocal condition estimate if
tol
is nonnegative.
Can be used for matrices that are rank-deficient, i.e., whose rank is less than their minimum dimension.
Golub, G. H., and C. F. Van Loan (1989), Matrix Computations, 2nd edition, Johns Hopkins, Baltimore.
m <- sample(1:9, 1); n <- sample(1:9, 1) a <- Matrix( sample(-9:9, m*n, replace = T), nrow = m, ncol = n) b <- rnorm(m) z <- qr(a) # QR decomposition of a if (m > n) t(a) %*% (a %*% solve(a,b) - b) else a %*% solve(a,b) - b