Report

Help us improve this tool

Pseudoinverse Calculator

Calculate the Moore-Penrose pseudoinverse of any rectangular or square matrix with step-by-step SVD, rank calculation, and identity property verification.

O M T

What is the Moore-Penrose Pseudoinverse?

In linear algebra, a square matrix $A$ has an ordinary inverse $A^{-1}$ only when its determinant is non-zero (full rank). When a matrix is rectangular ($m \times n$ where $m \ne n$) or square but singular (determinant zero), the standard matrix inverse does not exist. The Moore-Penrose pseudoinverse, denoted as $A^+$, generalizes the matrix inverse to any matrix of real or complex numbers. If you are working with non-singular square matrices, you can also use our matrix inverse calculator or explore curve fitting with our linear regression calculator.

The pseudoinverse was independently discovered by E. H. Moore in 1920 and Roger Penrose in 1955. For an $m \times n$ matrix $A$, the pseudoinverse $A^+$ has dimension $n \times m$ and uniquely satisfies the four Moore-Penrose equations:

  1. $A A^+ A = A$: $A A^+$ acts as the identity on the column space of $A$.
  2. $A^+ A A^+ = A^+$: $A^+$ is a weak inverse of $A$.
  3. $(A A^+)^T = A A^+$: The product $A A^+$ is an orthogonal projection matrix onto the column space of $A$.
  4. $(A^+ A)^T = A^+ A$: The product $A^+ A$ is an orthogonal projection matrix onto the row space of $A$.

Formulas and Calculation Methods

1. Square Invertible Matrices ($m = n = \text{rank}(A)$)

When $A$ is square and non-singular, its pseudoinverse coincides exactly with the ordinary matrix inverse:

$$A^+ = A^{-1}$$

2. Full Column Rank ($m > n$ and $\text{rank}(A) = n$)

When $A$ has more rows than columns (a "tall" matrix) and linearly independent columns, the square matrix $A^T A$ is invertible. In this case, $A^+$ acts as a left inverse ($A^+ A = I_n$):

$$A^+ = (A^T A)^{-1} A^T$$

This formula is central to linear least-squares regression, finding the unique vector $x = A^+ b$ that minimizes the Euclidean norm $\|Ax - b\|_2$.

3. Full Row Rank ($m < n$ and $\text{rank}(A) = m$)

When $A$ has more columns than rows (a "wide" matrix) and linearly independent rows, the square matrix $A A^T$ is invertible. In this case, $A^+$ acts as a right inverse ($A A^+ = I_m$):

$$A^+ = A^T (A A^T)^{-1}$$

Among the infinitely many solutions to underdetermined linear system $Ax = b$, the solution $x = A^+ b$ gives the unique solution with minimal Euclidean norm $\|x\|_2$.

4. General Case via Singular Value Decomposition (SVD)

For arbitrary matrices, including rank-deficient matrices where neither $A^T A$ nor $A A^T$ is invertible, the pseudoinverse is computed using Singular Value Decomposition:

$$A = U \Sigma V^T \implies A^+ = V \Sigma^+ U^T$$

Here $U$ and $V$ are orthogonal matrices, and $\Sigma^+$ is formed by transposing $\Sigma$ and taking the reciprocal $1/\sigma_i$ of all strictly non-zero singular values while leaving zeros intact.

Step-by-Step Example

Let us find the pseudoinverse of the $3 \times 2$ matrix $A$:

$$A = \begin{pmatrix} 1 & 0 \\ 0 & 1 \\ 1 & 1 \end{pmatrix}$$
  1. Compute $A^T A$: $$\begin{pmatrix} 1 & 0 & 1 \\ 0 & 1 & 1 \end{pmatrix} \begin{pmatrix} 1 & 0 \\ 0 & 1 \\ 1 & 1 \end{pmatrix} = \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix}$$
  2. Compute $(A^T A)^{-1}$: The determinant is $(2)(2) - (1)(1) = 3$. $$(A^T A)^{-1} = \frac{1}{3} \begin{pmatrix} 2 & -1 \\ -1 & 2 \end{pmatrix}$$
  3. Multiply $(A^T A)^{-1} A^T$: $$A^+ = \frac{1}{3} \begin{pmatrix} 2 & -1 \\ -1 & 2 \end{pmatrix} \begin{pmatrix} 1 & 0 & 1 \\ 0 & 1 & 1 \end{pmatrix} = \frac{1}{3} \begin{pmatrix} 2 & -1 & 1 \\ -1 & 2 & 1 \end{pmatrix}$$

Frequently Asked Questions

What is the difference between a normal inverse and a pseudoinverse?

An ordinary inverse $A^{-1}$ only exists for square, non-singular matrices where $\det(A) \ne 0$. The Moore-Penrose pseudoinverse $A^+$ exists for every single matrix, regardless of shape or determinant. When $A$ is square and invertible, $A^+$ equals $A^{-1}$ exactly.

Is the pseudoinverse matrix always square?

No. The pseudoinverse $A^+$ always has transposed dimensions compared to original matrix $A$. If $A$ is an $m \times n$ matrix, then $A^+$ is an $n \times m$ matrix. It is square only when the input matrix $A$ is square.

What is the pseudoinverse of a zero matrix?

For a zero matrix $Z$ of dimensions $m \times n$, all singular values are zero. Therefore, its Moore-Penrose pseudoinverse is the transposed zero matrix $Z^T$ with dimensions $n \times m$.

How is the pseudoinverse used in least squares regression?

In overdetermined linear systems $Ax = b$ where no exact solution exists, setting $x = A^+ b$ yields the unique least-squares solution that minimizes the sum of squared residuals $\|Ax - b\|^2$.

Does $(A^+)^+ = A$ always hold?

Yes. The pseudoinverse operation is an involution: taking the pseudoinverse of $A^+$ returns the original matrix $A$. Similarly, $(A^T)^+ = (A^+)^T$.