Class Matrix.Cholesky

java.lang.Object
smile.math.matrix.fp32.Matrix.Cholesky
All Implemented Interfaces:
Serializable
Enclosing class:
Matrix

public static class Matrix.Cholesky extends Object implements Serializable
The Cholesky decomposition of a symmetric, positive-definite matrix. When it is applicable, the Cholesky decomposition is roughly twice as efficient as the LU decomposition for solving systems of linear equations.

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.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final Matrix
    The Cholesky decomposition.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    det()
    Returns the matrix determinant.
    Returns the inverse of matrix.
    float
    Returns the log of matrix determinant.
    float[]
    solve(float[] b)
    Solves the linear system A * x = b.
    void
    Solves the linear system A * X = B.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • lu

      public final Matrix lu
      The Cholesky decomposition.
  • Constructor Details

    • Cholesky

      public Cholesky(Matrix lu)
      Constructor.
      Parameters:
      lu - the lower/upper triangular part of matrix contains the Cholesky factorization.
  • Method Details

    • det

      public float det()
      Returns the matrix determinant.
      Returns:
      the matrix determinant.
    • logdet

      public float logdet()
      Returns the log of matrix determinant.
      Returns:
      the log of matrix determinant.
    • inverse

      public Matrix inverse()
      Returns the inverse of matrix.
      Returns:
      the inverse of matrix.
    • solve

      public float[] solve(float[] b)
      Solves the linear system A * x = b.
      Parameters:
      b - the right hand side of linear systems.
      Returns:
      the solution vector.
    • solve

      public void solve(Matrix B)
      Solves the linear system A * X = B.
      Parameters:
      B - the right hand side of linear systems. On output, B will be overwritten with the solution matrix.