java.lang.Object
dev.nm.algebra.linear.matrix.doubles.matrixtype.dense.DenseMatrix
dev.nm.algebra.linear.matrix.doubles.operation.positivedefinite.MatthewsDavies
All Implemented Interfaces:
Matrix, MatrixAccess, MatrixRing, MatrixTable, Densifiable, AbelianGroup<Matrix>, Monoid<Matrix>, Ring<Matrix>, Table, DeepCopyable

public class MatthewsDavies extends DenseMatrix
Matthews and Davies propose the following way to coerce a non-positive definite Hessian matrix to become symmetric, positive definite. An LDL decomposition is performed on the non-positive definite matrix. The zero and negative entries are then replaced by the smallest positive entry in the diagonal matrix.
  • Constructor Details

    • MatthewsDavies

      public MatthewsDavies(Matrix H)
      Constructs a symmetric, positive definite matrix using the Matthews-Davies algorithm. This implementation replaces all zero or negative entries on the diagonal by the smallest positive entry on the diagonal. If all entries in the diagonal are negative, D becomes an identity matrix.
      Parameters:
      H - a non-positive definite matrix
  • Method Details

    • L

      Gets the lower triangular matrix L in the LDL decomposition.
      Returns:
      L
    • Lt

      public UpperTriangularMatrix Lt()
      Gets the transpose of the lower triangular matrix L in the LDL decomposition. The transpose is upper triangular.
      Returns:
      Lt
    • D

      public DiagonalMatrix D()
      Gets the diagonal matrix D in the LDL decomposition.
      Returns:
      D
    • Dhat

      public DiagonalMatrix Dhat()
      Gets the modified diagonal matrix which is positive definite.
      Returns:
      D^