linalg::pseudoInverse --
Moore-Penrose inverse of a matrix
Introductionlinalg::pseudoInverse(A) computes the
Moore-Penrose inverse of A.
Call(s)linalg::pseudoInverse(A)
ParametersA |
- | a matrix of category Cat::Matrix |
Returnsa matrix of the same domain type as A, or the value
FAIL.
Related
Functions
DetailsA does not exist, then
FAIL is returned.A must be a field,
i.e., a domain of category Cat::Field.
Example
1The Moore-Penrose inverse of the 2 x 3 matrix:
>> A := Dom::Matrix(Dom::Complex)([[1, I, 3], [1, 3, 2]])
+- -+
| 1, I, 3 |
| |
| 1, 3, 2 |
+- -+
is the 3 x 2 matrix:
>> Astar := linalg::pseudoInverse(A)
+- -+
| 7/96 + 1/32 I, 1/24 - 1/32 I |
| |
| - 7/32 - 5/96 I, 5/16 + 7/96 I |
| |
| 7/24 + 1/16 I, 1/96 - 3/32 I |
+- -+
Note that in this example, only:
>> A * Astar
+- -+
| 1, 0 |
| |
| 0, 1 |
+- -+
yields the identity matrix, but not (see ``Backgrounds'' below):
>> Astar * A
+- -+
| 11/96, 3/32 - 1/48 I, 29/96 + 1/32 I |
| |
| 3/32 + 1/48 I, 95/96, - 1/32 - 1/96 I |
| |
| 29/96 - 1/32 I, - 1/32 + 1/96 I, 43/48 |
+- -+
BackgroundIf A is of dimension m x n, then B is of dimension n x m.
linalg::scalarProduct
works also for vectors over other fields (e.g. finite fields). The
computation of a Moore-Penrose inverse may fail in such cases.