Pseudoinverse Calculator
Test cases replayed : 3 of 3 match · Methodology · No outside source listed
Enter a 3×2 matrix A (three rows, two columns) whose two columns are not multiples of each other to get its 2×3 pseudoinverse.
Result
A⁺ row 1, column 1
det(AᵀA) (0 means dependent columns: not covered)
- A⁺ row 1, column 2
- A⁺ row 1, column 3
- A⁺ row 2, column 1
- A⁺ row 2, column 2
- A⁺ row 2, column 3
Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
- A row 1, column 1: enter a number.
- A row 1, column 2: enter a number.
- A row 2, column 1: enter a number.
- A row 2, column 2: enter a number.
- A row 3, column 1: enter a number.
- A row 3, column 2: enter a number.
- Read the result: A⁺ row 1, column 1; the panel also shows det(AᵀA) (0 means dependent columns: not covered), A⁺ row 1, column 2, A⁺ row 1, column 3, A⁺ row 2, column 1, A⁺ row 2, column 2 and A⁺ row 2, column 3.
How this calculator works
The Moore-Penrose pseudoinverse (E. H. Moore 1920, R. Penrose 1955) is the unique matrix A⁺ with AA⁺A = A, A⁺AA⁺ = A⁺ and AA⁺, A⁺A symmetric. When the columns of A are linearly independent it equals A⁺ = (AᵀA)⁻¹Aᵀ, a left inverse: A⁺A = I.
Here AᵀA is the 2×2 matrix [[p, q], [q, s]] with p and s the sums of squares of each column and q their dot product; its inverse is [[s, −q], [−q, p]] ÷ (ps − q²). Multiplying by Aᵀ gives A⁺. The least-squares solution of Ax = b is x = A⁺b.
The formula
| Symbol | Meaning |
|---|---|
| A row 1, column 1 | |
| A row 1, column 2 | |
| A row 2, column 1 | |
| A row 2, column 2 | |
| A row 3, column 1 | |
| A row 3, column 2 | |
| det(AᵀA) (0 means dependent columns: not covered) | |
| A⁺ row 1, column 1 |
Worked example
| A row 1, column 1 | 1 |
|---|---|
| A row 1, column 2 | 2 |
| A row 2, column 1 | 3 |
| A row 2, column 2 | 4 |
| A row 3, column 1 | 5 |
| A row 3, column 2 | 6 |
| det(AᵀA) (0 means dependent columns: not covered) | 24 |
|---|---|
| A⁺ row 1, column 2 | -0.3333 |
| A⁺ row 1, column 3 | 0.6667 |
| A⁺ row 2, column 1 | 1.0833 |
| A⁺ row 2, column 2 | 0.3333 |
| A⁺ row 2, column 3 | -0.4167 |
A⁺ row 1, column 1 -1.3333
Each step uses the unrounded value of the step before it; figures on this page are rounded for display.
Frequently asked questions
What is the pseudoinverse used for?
Solving an overdetermined system Ax = b in the least-squares sense: x = A⁺b minimizes the length of Ax − b.
What if the two columns are proportional?
Then det(AᵀA) = 0 and the formula (AᵀA)⁻¹Aᵀ does not apply; this calculator shows — rather than a value.