Options
All
  • Public
  • Public/Protected
  • All
Menu

ml-matrix

Index

Type aliases

MatrixDimension

MatrixDimension: "row" | "column"

MaybeMatrix

MaybeMatrix: AbstractMatrix | number[][]

ScalarOrMatrix

ScalarOrMatrix: number | MaybeMatrix

Functions

correlation

covariance

determinant

inverse

  • Computes the inverse of a matrix.

    Parameters

    • matrix: MaybeMatrix

      Matrix to invert.

    • Optional useSVD: boolean

      Use the singular value decomposition to compute the inverse. Default: false.

    Returns Matrix

linearDependencies

  • Creates a matrix which represents the dependencies between rows. If a row is a linear combination of others rows, the result will be a row with the coefficients of this combination. For example : for A = [[2, 0, 0, 1], [0, 1, 6, 0], [0, 3, 0, 1], [0, 0, 1, 0], [0, 1, 2, 0]], the result will be [[0, 0, 0, 0, 0], [0, 0, 0, 4, 1], [0, 0, 0, 0, 0], [0, 0.25, 0, 0, -0.25], [0, 1, 0, -4, 0]]

    Parameters

    Returns Matrix

    • The matrix which represents the dependencies between rows.

pseudoInverse

  • Returns inverse of a matrix if it exists or the pseudoinverse.

    Parameters

    • matrix: MaybeMatrix
    • Optional threshold: number

      Threshold for taking inverse of singular values. Default: Number.EPSILON.

    Returns Matrix

    • The (pseudo)inverted matrix.

solve

wrap