public class CholeskyDecomposition
extends java.lang.Object
The Cholesky decomposition is mainly used for the numerical solution of linear equations. The Cholesky decomposition is also commonly used in the Monte Carlo method for simulating systems with multiple correlated variables: The matrix of inter-variable correlations is decomposed, to give the lower-triangular L. Applying this to a vector of uncorrelated simulated shocks, u, produces a shock vector Lu with the covariance properties of the system being modeled.
Unscented Kalman filters commonly use the Cholesky decomposition to choose a set of so-called sigma points. The Kalman filter tracks the average state of a system as a vector x of length n and covariance as an n-by-n matrix P. The matrix P is always positive semi-definite, and can be decomposed into L*L'. The columns of L can be added and subtracted from the mean x to form a set of 2n vectors called sigma points. These sigma points completely capture the mean and covariance of the system state.
If the matrix is not positive definite, an exception will be thrown out from the method decompose().
| Constructor and Description |
|---|
CholeskyDecomposition(DenseMatrix A)
Constructor.
|
CholeskyDecomposition(double[][] A)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
double |
det()
Returns the matrix determinant
|
double[][] |
getL()
Returns lower triangular factor.
|
DenseMatrix |
inverse()
Returns the matrix inverse.
|
static CholeskyDecomposition |
newInstance(double[][] L)
Constructor.
|
void |
solve(DenseMatrix B)
Solve the linear system A * X = B.
|
void |
solve(DenseMatrix B,
DenseMatrix X)
Solve the linear system A * X = B.
|
void |
solve(double[] b)
Solve the linear system A * x = b.
|
void |
solve(double[] b,
double[] x)
Solve the linear system A * x = b.
|
public CholeskyDecomposition(double[][] A)
A - square, symmetric matrix. Only the lower triangular part
will be used in the decomposition. The user can just store this half part
to save space.java.lang.IllegalArgumentException - if the matrix is not positive definite.public CholeskyDecomposition(DenseMatrix A)
A - square symmetric matrix. Only the lower triangular part
will be used in the decomposition. The user can just store this half part
to save space.java.lang.IllegalArgumentException - if the matrix is not positive definite.public static CholeskyDecomposition newInstance(double[][] L)
L - decomposition matrix.public double[][] getL()
public double det()
public DenseMatrix inverse()
public void solve(double[] b)
b - the right hand side of linear systems. On output, b will be
overwritten with solution vector.public void solve(double[] b,
double[] x)
b - the right hand side of linear systems.x - the solution vector.public void solve(DenseMatrix B)
B - the right hand side of linear systems.public void solve(DenseMatrix B, DenseMatrix X)
B - the right hand side of linear systems.X - the solution matrix.