|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.math3.linear.RectangularCholeskyDecomposition
public class RectangularCholeskyDecomposition
Calculates the rectangular Cholesky decomposition of a matrix.
The rectangular Cholesky decomposition of a real symmetric positive semidefinite matrix A consists of a rectangular matrix B with the same number of rows such that: A is almost equal to BBT, depending on a user-defined tolerance. In a sense, this is the square root of A.
The difference with respect to the regular CholeskyDecomposition
is that rows/columns may be permuted (hence the rectangular shape instead
of the traditional triangular shape) and there is a threshold to ignore
small diagonal elements. This is used for example to generate correlated
random n-dimensions vectors
in a p-dimension subspace (p < n).
In other words, it allows generating random vectors from a covariance
matrix that is only positive semidefinite, and not positive definite.
Rectangular Cholesky decomposition is not suited for solving
linear systems, so it does not provide any decomposition solver
.
Constructor Summary | |
---|---|
RectangularCholeskyDecomposition(RealMatrix matrix)
Decompose a symmetric positive semidefinite matrix. |
|
RectangularCholeskyDecomposition(RealMatrix matrix,
double small)
Decompose a symmetric positive semidefinite matrix. |
Method Summary | |
---|---|
int |
getRank()
Get the rank of the symmetric positive semidefinite matrix. |
RealMatrix |
getRootMatrix()
Get the root of the covariance matrix. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RectangularCholeskyDecomposition(RealMatrix matrix) throws NonPositiveDefiniteMatrixException
Note: this constructor follows the linpack method to detect dependent columns by proceeding with the Cholesky algorithm until a nonpositive diagonal element is encountered.
matrix
- Symmetric positive semidefinite matrix.
NonPositiveDefiniteMatrixException
- if the matrix is not
positive semidefinite.public RectangularCholeskyDecomposition(RealMatrix matrix, double small) throws NonPositiveDefiniteMatrixException
matrix
- Symmetric positive semidefinite matrix.small
- Diagonal elements threshold under which columns are
considered to be dependent on previous ones and are discarded.
NonPositiveDefiniteMatrixException
- if the matrix is not
positive semidefinite.Method Detail |
---|
public RealMatrix getRootMatrix()
B
such that
the covariance matrix is equal to B.BT
getRank()
public int getRank()
getRootMatrix()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |