finds the pseudoinverse of a rectangular matrix.
Details and Options
- PseudoInverse works on both symbolic and numerical matrices.
- For a square matrix, PseudoInverse gives the Moore–Penrose inverse.
- For numerical matrices, PseudoInverse is based on SingularValueDecomposition.
- PseudoInverse[m,Tolerance->t] specifies that singular values smaller than t times the maximum singular value should be dropped.
- With the default setting Tolerance->Automatic, singular values are dropped when they are less than 100 times 10-p, where p is Precision[m].
- For non‐singular square matrices M, the pseudoinverse M(-1) is equivalent to the standard inverse.
Examplesopen allclose all
Basic Examples (1)
A matrix has a pseudoinverse even if it is singular:
m is a 4×3 matrix:
Compute using exact arithmetic:
Compute using machine arithmetic:
Compute using 24‐digit precision arithmetic:
Compute the pseudoinverse for a random complex 3×2 matrix:
Generalizations & Extensions (1)
m is a 16×16 Hilbert matrix:
Some singular values are below the default tolerance for machine precision:
Compute the pseudoinverse with the default tolerance:
It is not a true inverse since some singular values were considered to be effectively zero:
Compute the pseudoinverse with no tolerance:
Even though no singular values were considered zero, it is worse due to numerical error:
Here is some data:
Construct a design matrix for fitting to a line:
Get the coefficients for a linear least‐squares fit:
This is the same as the result given by Fit:
Properties & Relations (3)
For a nonsingular matrix, the pseudoinverse is the same as the inverse:
For p = PseudoInverse[m], x = p.b gives the minimum norm x that minimizes :
Adding any vector in the NullSpace of m will leave the residual unchanged:
The minimum is at :
PseudoInverse satisfies the Moore–Penrose equations [more info]:
Introduced in 1988
Updated in 2003