|
JMSLTM Numerical Library 4.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.imsl.math.SVD
Singular Value Decomposition (SVD) of a
rectangular matrix of type double
.
SVD
is based on the LINPACK routine SSVDC
; see
Dongarra et al. (1979).
Let n be the number of rows in A
and let p be the number of columns in
A. For any
n x p matrix
A, there exists an n x n
orthogonal matrix U and a p x p
orthogonal matrix V such that
where , and . The scalars are called the singular values of A. The columns of U are called the left singular vectors of A. The columns of V are called the right singular vectors of A.
The estimated rank of A is the number of
that is larger than a tolerance .
If is the parameter tol
in the
program, then
The Moore-Penrose generalized inverse of the matrix is computed by partitioning the matricies U, V and as , and where the "1" matrices are k by k. The Moore-Penrose generalized inverse is .
Nested Class Summary | |
static class |
SVD.DidNotConvergeException
The iteration did not converge |
Constructor Summary | |
SVD(double[][] a)
Construct the singular value decomposition of a rectangular matrix with default tolerance. |
|
SVD(double[][] a,
double tol)
Construct the singular value decomposition of a rectangular matrix with a given tolerance. |
Method Summary | |
int |
getInfo()
Returns convergence information about S, U, and V. |
int |
getRank()
Returns the rank of the matrix used to construct this instance. |
double[] |
getS()
Returns the singular values. |
double[][] |
getU()
Returns the left singular vectors. |
double[][] |
getV()
Returns the right singular vectors. |
double[][] |
inverse()
Compute the Moore-Penrose generalized inverse of a real matrix. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SVD(double[][] a) throws SVD.DidNotConvergeException
a
- a double
matrix for which the singular value decomposition
is to be computed
IllegalArgumentException
- is thrown when the row lengths of
input matrix a are not equal (i.e. the matrix edges are "jagged")
SVD.DidNotConvergeException
public SVD(double[][] a, double tol) throws SVD.DidNotConvergeException
tol
is positive, then a singular value is
considered negligible if the singular value is less than or equal to
tol
. If tol
is negative, then a singular value is considered negligible
if the singular value is less than or equal to the absolute value of the product of
tol
and the infinity norm of the input matrix. In the latter case, the
absolute value of tol
generally contains an estimate of the level of
the relative error in the data.
a
- a double
matrix for which the singular value decomposition
is to be computedtol
- a double
scalar containing the tolerance used
to determine when a singular value is negligible
IllegalArgumentException
- is thrown when the row lengths of
input matrix a are not equal (for example, the matrix edges
are "jagged")
SVD.DidNotConvergeException
- is thrown when the rank cannot be determined
because convergence was not obtained for all singular valuesMethod Detail |
public int getInfo()
public int getRank()
int
scalar containing the rank of the matrix used to
construct this instance. The estimated rank of the input matrix is the number
of singular values which are larger than a tolerance.public double[] getS()
double
array containing the singular values of the matrixpublic double[][] getU()
double
matrix containing the left singular vectorspublic double[][] getV()
double
matrix containing the right singular vectorspublic double[][] inverse()
double
matrix containing the generalized inverse of the
matrix used to construct this instance
|
JMSLTM Numerical Library 4.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |