Skip to content
FiftyCalc Free calculators for all 50 states

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

Sample figures

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.

Pseudoinverse Calculator

A row 1, column 1: enter a number. Prefilled example: 1.

A row 1, column 2: enter a number. Prefilled example: 2.

A row 2, column 1: enter a number. Prefilled example: 3.

A row 2, column 2: enter a number. Prefilled example: 4.

A row 3, column 1: enter a number. Prefilled example: 5.

A row 3, column 2: enter a number. Prefilled example: 6.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. A row 1, column 1: enter a number.
  2. A row 1, column 2: enter a number.
  3. A row 2, column 1: enter a number.
  4. A row 2, column 2: enter a number.
  5. A row 3, column 1: enter a number.
  6. A row 3, column 2: enter a number.
  7. 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

  1. Det=(a112+a212+a312)×(a122+a222+a322)−(a11×a12+a21×a22+a31×a32)2
  2. P11={(a122+a222+a322)×a11−(a11×a12+a21×a22+a31×a32)×a12Detif Det≠0No result for these inputsotherwise
Symbols used in the formula
SymbolMeaning
a11A row 1, column 1
a12A row 1, column 2
a21A row 2, column 1
a22A row 2, column 2
a31A row 3, column 1
a32A row 3, column 2
Detdet(AᵀA) (0 means dependent columns: not covered)
P11A⁺ row 1, column 1

Worked example

A row 1, column 11
A row 1, column 22
A row 2, column 13
A row 2, column 24
A row 3, column 15
A row 3, column 26
det(AᵀA) (0 means dependent columns: not covered)24
A⁺ row 1, column 2-0.3333
A⁺ row 1, column 30.6667
A⁺ row 2, column 11.0833
A⁺ row 2, column 20.3333
A⁺ row 2, column 3-0.4167
  1. Det=(12+32+52)×(22+42+62)−(1×2+3×4+5×6)2=24
  2. P11=(22+42+62)×1−(1×2+3×4+5×6)×224=−1.33333

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.

Related calculators