The pseudoinverse of a matrix is defined as:

Why do we even care? Matrix inversion is only defined for square matrices. If isn’t square, we run the risk of finding infinitely many solutions or none at all. Pseudoinverses allow us to approximate the best inverse solution.

The Moore-Penrose pseudoinverse is a practical algorithm for computing a pseudoinverse matrix via singular value decomposition, where:

where are the SVD of . The pseudoinverse is computed by taking the reciprocal of its elements then transposing it.

If we have infinitely many solutions, MP gives us a solution that minimises the Euclidean norm. If we have no solution, MP gives us the for which is as close to possible to in terms of the norm of .