solve.svd.Matrix(a, b, tol=0, transpose=F)
svd.Matrix
, representing the singular-value decomposition
of a matrix.
transpose=T
The number of rows of
b
must equal the
number of rows of the matrix underlying
a
, while if
transpose=F
the number
of rows of
b
must equal the number of columns of the matrix underlying
a
.
tol
.
By default,
tol
= 0.
a
is to be used for the solve or inverse operation.
The default is to use the untransposed matrix.
A
is the matrix whose singular-value decomposition is represented by
a
,
an object of class
"Matrix"
is returned that is the minimum l2 norm
least-squares solution
x
to the system of equations A %*% x = b if
b
is
present; otherwise the pseudo-inverse of
A
is returned.
Attributes include a copy of the call to
solve
, the rank of the matrix
assumed in order to obtain the solution,
and the infinity 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 <- svd(a) # singular-value decomp of a t(a) %*% (a %*% solve(a,b) - b) # residual for normal equations (solve(a) %*% b) - solve(a,b)