Matrix pseudoinverse
Enter rows separated by semicolons and values separated by commas or spaces.
About the pseudoinverse calculator
The Moore-Penrose pseudoinverse extends the idea of a matrix inverse to rectangular matrices and to systems that do not have an ordinary unique inverse. It is written A+ and is the unique matrix satisfying four consistency conditions involving A, A+, and their transposes. For an invertible square matrix, the pseudoinverse is exactly the ordinary inverse. For a tall or wide full-rank matrix, it provides the natural inverse-like transformation needed in least-squares and minimum-norm calculations.
This calculator accepts a matrix written row by row. Separate entries with commas or spaces and separate rows with semicolons. For a matrix with at least as many rows as columns and independent columns, it evaluates (A transpose A) inverse times A transpose. For a matrix with more columns than rows and independent rows, it evaluates A transpose times (A A transpose) inverse. Both formulas are standard full-rank forms of the Moore-Penrose inverse. Pivoted Gauss-Jordan elimination is used for the required square inverse.
A common application is an overdetermined linear system A x = b, where there are more equations than unknowns and no vector satisfies every equation exactly. Multiplying b by A+ returns the least-squares solution that minimizes the squared residual. In an underdetermined full-row-rank system, A+ returns the exact solution with the smallest Euclidean norm. These properties make pseudoinverses useful in regression, signal processing, control systems, robotics, numerical optimization, data fitting, and machine learning.
Rank matters. The convenient normal-equation formulas require independent columns or independent rows. A rank-deficient matrix makes A transpose A or A A transpose singular, so this implementation reports that limitation instead of returning an unstable value. A general singular-value decomposition can handle rank deficiency by inverting only singular values above a numerical tolerance. For large, ill-conditioned, or rank-deficient problems, use a dedicated numerical library with an SVD-based routine and inspect its tolerance settings.
Floating-point arithmetic also affects results. The calculator rounds displayed entries to six decimal places, while calculations retain JavaScript double precision. Very large differences in scale can amplify rounding error because normal equations square the condition number. Rescaling columns can help, but professional numerical work should favor QR or SVD methods. For classroom examples and compact full-rank matrices, this calculator offers a transparent way to compute and inspect the pseudoinverse without manually carrying out several matrix multiplications and elimination steps.
Pseudoinverse calculator FAQ
How is a pseudoinverse different from an inverse?
An ordinary inverse exists only for a nonsingular square matrix. The Moore-Penrose pseudoinverse is defined for rectangular matrices as well and agrees with the inverse when one exists.
What does the pseudoinverse solve?
It gives a least-squares solution for inconsistent overdetermined systems. For underdetermined systems, it selects the solution with minimum Euclidean norm.
Does this calculator support singular matrices?
It supports rectangular and square matrices with full row or column rank. Rank-deficient matrices require an SVD-based method and are reported rather than approximated unsafely.
How should I format a matrix?
Use commas or spaces between values in a row and semicolons between rows. Every row must contain the same number of numeric entries.
Why are results rounded?
The display is rounded to six decimal places for readability. Internal calculations use double-precision floating-point numbers, though ill-conditioned matrices can still lose accuracy.