File Exchange

image thumbnail


version 1.5 (7.12 KB) by

Factorize a matrix for pseudo-inverse calculation purpose



View License

Factorize a matrix for pseudo-inverse to solve the normal equation:

A*x = b

There are two advantages of pseudo-inverse compared to MATLAB pinv:
- PINV requires costly SVD
- PINV does not operated with sparse matrix.

The solution x minimize the 2-norm of the residual |Ax - b|.

In case of underdetermined system, i.e., rank(A) < length(x), the solution returned by pseudoinverse(A)*b is the least 2-norm among all solutions. Note that this property does *not* meet if backslash operator is used: x = A\b.

Method: Use QR factorization on both source and destination space. The factorized result is stored in object that can be used later to multiply with any target space vectors (RHS).

Inspired from FACTORIZE

Comments and Ratings (3)

Gert Kruger


One big problem with pseudo-inverse; it’s a discontinuous mapping of the data when the matrix is not full rank. In other words, the pseudo-inverse of a rank deficient matrix is sensitive to noisy data. See Golub , Matrix Computation 4th edition section 5.5.5. You need regularization.


dm (view profile)



Detect SuiteSparseQR package to carry out QR factorization on sparse matrix, not available for Matlab prior 2009B (?)


New methods supported: left/right multiplication, conjugate, transpose, and complex-transpose


Change the code structure (private function instead of static methods) for better compatible with older Matlab versions


New description + Iterative method with Tkhonov regularization

MATLAB Release
MATLAB 7.9 (R2009b)

Inspired: Free-knot spline approximation

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video