jax-js
    Preparing search index...
    • Return the least-squares solution to a linear equation.

      For overdetermined systems, this finds the x that minimizes norm(ax - b). For underdetermined systems, this finds the minimum-norm solution for x.

      This currently uses Cholesky decomposition to solve the normal equations, under the hood. The method is not as robust as QR or SVD.

      Parameters

      • a: ArrayLike

        coefficient matrix of shape (M, N)

      • b: ArrayLike

        right-hand side of shape (M,) or (M, K)

      Returns Array

      least-squares solution of shape (N,) or (N, K)