Class SingularValueDecomposition

Constructors

Properties

condition: number
diagonal: number[]
diagonalMatrix: Matrix
leftSingularVectors: Matrix
norm2: number
rank: number
rightSingularVectors: Matrix
threshold: number

Methods

  • Get the inverse of the matrix. We compute the inverse of a matrix using SVD when this matrix is singular or ill-conditioned. Example : var svd = SingularValueDecomposition(A); var inverseA = svd.inverse();

    Returns Matrix

    • The approximation of the inverse of the matrix.
  • Solve a problem of least square (Ax=b) by using the SVD. Useful when A is singular. When A is not singular, it would be better to use qr.solve(value). Example : We search to approximate x, with A matrix shape m*n, x vector size n, b vector size m (m > n). We will use : var svd = SingularValueDecomposition(A); var x = svd.solve(b);

    Parameters

    • value: Matrix

      Matrix 1D which is the vector b (in the equation Ax = b).

    Returns Matrix

    • The vector x.