PseudoInverse
✖
PseudoInverse
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.
Examples
open allclose allBasic Examples (5)Summary of the most common use cases
Find the pseudoinverse of an invertible matrix:

https://wolfram.com/xid/0rs0l2k2a-htoxr7

The pseudoinverse is merely the inverse:

https://wolfram.com/xid/0rs0l2k2a-tyzi8r

Find the pseudoinverse of a singular matrix:

https://wolfram.com/xid/0rs0l2k2a-dn2wo0

The determinant of is zero, so it does not have a true inverse:

https://wolfram.com/xid/0rs0l2k2a-8ssntl

For a pseudoinverse, both and
:

https://wolfram.com/xid/0rs0l2k2a-rvdqhc

However, in this particular case neither nor
is an identity matrix:

https://wolfram.com/xid/0rs0l2k2a-tuk8ac

Find the pseudoinverse of a rectangular matrix:

https://wolfram.com/xid/0rs0l2k2a-mrekcd

In this particular case, is an identity matrix:

https://wolfram.com/xid/0rs0l2k2a-6irvfh


https://wolfram.com/xid/0rs0l2k2a-zcejrl

Find the pseudoinverse of a row matrix:

https://wolfram.com/xid/0rs0l2k2a-nhxt3

Find the pseudoinverse of a zero matrix:

https://wolfram.com/xid/0rs0l2k2a-cffd0i

Scope (10)Survey of the scope of standard use cases
Basic Uses (6)
Find the pseudoinverse of a machine-precision matrix:

https://wolfram.com/xid/0rs0l2k2a-gzis3e

Pseudoinverse of a complex matrix:

https://wolfram.com/xid/0rs0l2k2a-bjja1q

Pseudoinverse of an exact matrix:

https://wolfram.com/xid/0rs0l2k2a-piv3b5

Pseudoinverse of an arbitrary-precision matrix:

https://wolfram.com/xid/0rs0l2k2a-p8sjhl

Compute a symbolic pseudoinverse:

https://wolfram.com/xid/0rs0l2k2a-gtn59g

The inversion of large machine-precision matrices is efficient:

https://wolfram.com/xid/0rs0l2k2a-dkq7nk

https://wolfram.com/xid/0rs0l2k2a-lx8juz

Special Matrices (4)
The pseudoinverse of a sparse matrix is returned as a normal matrix:

https://wolfram.com/xid/0rs0l2k2a-ocj3kf


https://wolfram.com/xid/0rs0l2k2a-fm3xwv


https://wolfram.com/xid/0rs0l2k2a-eordwx

When possible, the pseudoinverse of a structured matrix is returned as another structured matrix:

https://wolfram.com/xid/0rs0l2k2a-ebpduc


https://wolfram.com/xid/0rs0l2k2a-dhkxvx


https://wolfram.com/xid/0rs0l2k2a-wdjmwi


https://wolfram.com/xid/0rs0l2k2a-j45yx1

IdentityMatrix[n] is its own pseudoinverse:

https://wolfram.com/xid/0rs0l2k2a-8vb729

The pseudoinverse of IdentityMatrix[{m,n}] is a transposition:

https://wolfram.com/xid/0rs0l2k2a-pflv9c


https://wolfram.com/xid/0rs0l2k2a-89ddq0

Compute the pseudoinverse for HilbertMatrix:

https://wolfram.com/xid/0rs0l2k2a-q1l839

Options (1)Common values & functionality for each option
Tolerance (1)

https://wolfram.com/xid/0rs0l2k2a-g33jlv
Some singular values are below the default tolerance for machine precision:

https://wolfram.com/xid/0rs0l2k2a-hkuhvt

Compute the pseudoinverse with the default tolerance:

https://wolfram.com/xid/0rs0l2k2a-b0qgc0
It is not a true inverse since some singular values were considered to be effectively zero:

https://wolfram.com/xid/0rs0l2k2a-cgimnl

Compute the pseudoinverse with no tolerance:

https://wolfram.com/xid/0rs0l2k2a-h80yg5
Even though no singular values were considered zero, it is worse due to numerical error:

https://wolfram.com/xid/0rs0l2k2a-5olrz

Applications (8)Sample problems that can be solved with this function
Equation Solving (4)
Solve the following system of equations using PseudoInverse:

https://wolfram.com/xid/0rs0l2k2a-upikkb
Rewrite the system in matrix form:

https://wolfram.com/xid/0rs0l2k2a-zs7ify

The general solution is given by for an arbitrary vector
:

https://wolfram.com/xid/0rs0l2k2a-qytjf

Since the dropped out, the solution is unique, as can be verified using SolveValues:

https://wolfram.com/xid/0rs0l2k2a-tqujfz

Find all solutions of the following system of equations:

https://wolfram.com/xid/0rs0l2k2a-1c6b95

First, write the coefficient matrix , vector variable
and constant vector
:

https://wolfram.com/xid/0rs0l2k2a-vokjmu

https://wolfram.com/xid/0rs0l2k2a-se2owl

The general solution is given by for an arbitrary vector
:

https://wolfram.com/xid/0rs0l2k2a-m3h2nw


https://wolfram.com/xid/0rs0l2k2a-kyqgwy

Although there are three parameters, this solution represents a line:

https://wolfram.com/xid/0rs0l2k2a-1yawfd

This is because the null space of is one-dimensional:

https://wolfram.com/xid/0rs0l2k2a-ihejh6

Hence it is possible to reparameterize to eliminate two of the parameters:

https://wolfram.com/xid/0rs0l2k2a-dj3tes

This parameterization gives the answer in the same form as SolveValues:

https://wolfram.com/xid/0rs0l2k2a-14h576


Find the minimum Frobenius-norm solution to , with
and
as follows:

https://wolfram.com/xid/0rs0l2k2a-ziuqcu
The minimum norm solution is :

https://wolfram.com/xid/0rs0l2k2a-nmbplo

Compute the Frobenius norm of :

https://wolfram.com/xid/0rs0l2k2a-hoiqzn

As in the vector case, the general solution is given by , with
now an arbitrary matrix:

https://wolfram.com/xid/0rs0l2k2a-q66wu2


https://wolfram.com/xid/0rs0l2k2a-vk1bir

The minimum occurs when all the are zero, confirming that
is the minimum-norm solution:

https://wolfram.com/xid/0rs0l2k2a-eb2arl

In this case there is no solution to :

https://wolfram.com/xid/0rs0l2k2a-cmu0c9

https://wolfram.com/xid/0rs0l2k2a-g81vfi


An approximate solution that minimizes the norm of is given by
:

https://wolfram.com/xid/0rs0l2k2a-o6nyhb


https://wolfram.com/xid/0rs0l2k2a-g2o5mo

Compare to general minimization:

https://wolfram.com/xid/0rs0l2k2a-g5rxbt

A more general solution is given by :

https://wolfram.com/xid/0rs0l2k2a-5uz3ix


https://wolfram.com/xid/0rs0l2k2a-qusxb6

Although there are three parameters in , it represents a line:

https://wolfram.com/xid/0rs0l2k2a-107pgz

This is because the null space of is one-dimensional:

https://wolfram.com/xid/0rs0l2k2a-p5kqmy

Least Squares and Curve Fitting (4)
For the matrix and vector
that follow, find a vector
that minimizes
:

https://wolfram.com/xid/0rs0l2k2a-e4enjw
One solution, in this case unique, is given by :

https://wolfram.com/xid/0rs0l2k2a-s7lr4r

This result could also have been obtained using LeastSquares[m,b]:

https://wolfram.com/xid/0rs0l2k2a-2cpasl

Confirm the answer using Minimize:

https://wolfram.com/xid/0rs0l2k2a-w70jbo

For the matrices and
that follow, find a matrix
that minimizes
:

https://wolfram.com/xid/0rs0l2k2a-pqffuw
One solution, in this case unique, is given by :

https://wolfram.com/xid/0rs0l2k2a-ivgyxa

This result could also have been obtained using LeastSquares[m,b]:

https://wolfram.com/xid/0rs0l2k2a-zp70nm

Confirm the answer using Minimize:

https://wolfram.com/xid/0rs0l2k2a-4kcdw8

PseudoInverse can be used to find a best-fit curve to data. Consider the following data:

https://wolfram.com/xid/0rs0l2k2a-v42zji

Extract the and
coordinates from the data:

https://wolfram.com/xid/0rs0l2k2a-i4v6jo
Construct a design matrix, whose columns are and
, for fitting to a line
:

https://wolfram.com/xid/0rs0l2k2a-pkve26
Get the coefficients and
for a linear least‐squares fit:

https://wolfram.com/xid/0rs0l2k2a-7p26fs

Verify the coefficients using Fit:

https://wolfram.com/xid/0rs0l2k2a-480xbe

Plot the best-fit curve along with the data:

https://wolfram.com/xid/0rs0l2k2a-wzqna8

Find the best-fit parabola to the following data:

https://wolfram.com/xid/0rs0l2k2a-x7pawr

Extract the and
coordinates from the data:

https://wolfram.com/xid/0rs0l2k2a-w5dwto
Construct a design matrix, whose columns are ,
and
, for fitting to a line
:

https://wolfram.com/xid/0rs0l2k2a-bmqc8e
Get the coefficients ,
and
for a least‐squares fit:

https://wolfram.com/xid/0rs0l2k2a-z5bw8q

Verify the coefficients using Fit:

https://wolfram.com/xid/0rs0l2k2a-pp5xfy

Plot the best-fit curve along with the data:

https://wolfram.com/xid/0rs0l2k2a-04d0qo

Properties & Relations (14)Properties of the function, and connections to other functions
For a nonsingular matrix, the pseudoinverse is the same as the inverse:

https://wolfram.com/xid/0rs0l2k2a-g2efuw


https://wolfram.com/xid/0rs0l2k2a-hq2ojv

PseudoInverse is involutive, :

https://wolfram.com/xid/0rs0l2k2a-ci246w

https://wolfram.com/xid/0rs0l2k2a-zwdjpl

PseudoInverse commutes with Transpose, i.e :

https://wolfram.com/xid/0rs0l2k2a-r5artr

It also commutes with Conjugate, :

https://wolfram.com/xid/0rs0l2k2a-s204v

Hence it commutes with ConjugateTranspose, :

https://wolfram.com/xid/0rs0l2k2a-ee2zf9

PseudoInverse satisfies the Moore–Penrose equations [more info]:

https://wolfram.com/xid/0rs0l2k2a-p2fhsi

https://wolfram.com/xid/0rs0l2k2a-bs1pa5

https://wolfram.com/xid/0rs0l2k2a-bsvl0m

If MatrixRank[m] equals the number of columns of , then
:

https://wolfram.com/xid/0rs0l2k2a-0x2fwg


https://wolfram.com/xid/0rs0l2k2a-sgmkky

In particular, PseudoInverse[m] is a left-inverse of m:

https://wolfram.com/xid/0rs0l2k2a-n8bjnc

If MatrixRank[m] equals the number of rows of , then
:

https://wolfram.com/xid/0rs0l2k2a-s17ijx


https://wolfram.com/xid/0rs0l2k2a-c2g8j6

In particular, PseudoInverse[m] is a right-inverse of m:

https://wolfram.com/xid/0rs0l2k2a-t4cimv

For a diagonal matrix d, PseudoInverse[d] is the transpose with nonzero elements inverted:

https://wolfram.com/xid/0rs0l2k2a-d17ssz

If has the singular value decomposition
, then
:

https://wolfram.com/xid/0rs0l2k2a-v34myz

https://wolfram.com/xid/0rs0l2k2a-s69vp9


https://wolfram.com/xid/0rs0l2k2a-mdilnn

If a is an matrix and MatrixRank[a]==m, QRDecomposition will give the pseudoinverse:

https://wolfram.com/xid/0rs0l2k2a-zpyy8q


https://wolfram.com/xid/0rs0l2k2a-x6p50r

A normal matrix commutes with its pseudoinverse:

https://wolfram.com/xid/0rs0l2k2a-n714iw

https://wolfram.com/xid/0rs0l2k2a-nzl1fk


https://wolfram.com/xid/0rs0l2k2a-cvfe76

PseudoInverse[m] can be computed as , where
denotes DrazinInverse:

https://wolfram.com/xid/0rs0l2k2a-cceowv

https://wolfram.com/xid/0rs0l2k2a-ei7hch

LeastSquares and PseudoInverse can both be used to solve the least-squares problem:

https://wolfram.com/xid/0rs0l2k2a-h3z3e9

https://wolfram.com/xid/0rs0l2k2a-e5dgz8

gives the minimum norm
that minimizes the residual
:

https://wolfram.com/xid/0rs0l2k2a-lbfrc5

https://wolfram.com/xid/0rs0l2k2a-884c7

Verify that minimizes the residual:

https://wolfram.com/xid/0rs0l2k2a-9nhura

Adding any vector in the NullSpace of to
will leave the residual unchanged:

https://wolfram.com/xid/0rs0l2k2a-7iufp


https://wolfram.com/xid/0rs0l2k2a-c5eqo0

The minimum norm occurs at
, i.e when
:

https://wolfram.com/xid/0rs0l2k2a-b2f6yi

For a vector and a matrix
with empty nullspace,
equals ArgMin[Norm[m.x-b],x]:

https://wolfram.com/xid/0rs0l2k2a-c6zrbw

https://wolfram.com/xid/0rs0l2k2a-9lyuvk


https://wolfram.com/xid/0rs0l2k2a-fvs5bz

Wolfram Research (1988), PseudoInverse, Wolfram Language function, https://reference.wolfram.com/language/ref/PseudoInverse.html (updated 2003).
Text
Wolfram Research (1988), PseudoInverse, Wolfram Language function, https://reference.wolfram.com/language/ref/PseudoInverse.html (updated 2003).
Wolfram Research (1988), PseudoInverse, Wolfram Language function, https://reference.wolfram.com/language/ref/PseudoInverse.html (updated 2003).
CMS
Wolfram Language. 1988. "PseudoInverse." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2003. https://reference.wolfram.com/language/ref/PseudoInverse.html.
Wolfram Language. 1988. "PseudoInverse." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2003. https://reference.wolfram.com/language/ref/PseudoInverse.html.
APA
Wolfram Language. (1988). PseudoInverse. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PseudoInverse.html
Wolfram Language. (1988). PseudoInverse. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PseudoInverse.html
BibTeX
@misc{reference.wolfram_2025_pseudoinverse, author="Wolfram Research", title="{PseudoInverse}", year="2003", howpublished="\url{https://reference.wolfram.com/language/ref/PseudoInverse.html}", note=[Accessed: 16-April-2025
]}
BibLaTeX
@online{reference.wolfram_2025_pseudoinverse, organization={Wolfram Research}, title={PseudoInverse}, year={2003}, url={https://reference.wolfram.com/language/ref/PseudoInverse.html}, note=[Accessed: 16-April-2025
]}