svd.Matrix(x, vectors, tune, workspace)
"Matrix"
. NAs not allowed.
x
, then
min(dim(x))
singular vectors will be computed.
The default is to return
min(dim(x))
left singular vectors
and
min(dim(x))
right singular vectors.
NB
,
NBMIN
,
NX
, and
NXSVD
, as described in
.laenv
.
The default is to use the settings in
.laenv
, which are initialized in
S-PLUS but may be changed by the user.
tune
specifications) is
included as part of the output attributes.
c( "svd.Matrix", "decomp")
.
Attributes include the dimensions of the underlying matrix
and a flag indicating whether or not the matrix is complex
(this information is lost if no singular vectors are requested),
as well as workspace information and a copy of the call to
svd.Matrix
.
Based on the functions dgesvd and zgesvd from LAPACK
(Anderson et al. 1994).
In order for
x
to be recovered from the SVD, the number of left and right
singular vectors need not exceed the minimum dimension of
x
.
Parameters in
tune
may affect performance and workspace requirements,
but the optimal settings are both machine and problem dependent.
Users may want to experiment with
tune
(see Anderson et al., p. 72-74)
to obtain improved performance.
The alleged optimal workspace can be smaller than the minimum allowed workspace. Anderson, E., et al. (1994). LAPACK User's Guide, 2nd edition, SIAM, Philadelphia.
A <- Matrix( rnorm(60), nrow = 12, ncol = 5) svd.A <- svd(A) # SVD of A rcond(svd.A) # reciprocal condition number of A b <- rnorm(12) solve(svd.A,b) # least-squares solution to Ax = b