## `linalg::pseudoInverse` -- Moore-Penrose inverse of a matrix

#### Introduction

`linalg::pseudoInverse``(A)` computes the Moore-Penrose inverse of A.

#### Call(s)

`linalg::pseudoInverse(A)`

#### Parameters

`A` | - | a matrix of category `Cat::Matrix`

#### Returns

a matrix of the same domain type as `A`, or the value `FAIL`.

#### Related Functions

`_invert`

#### Details

- If the Moore-Penrose inverse of `A` does not exist, then `FAIL` is returned.
- The component ring of the matrix `A` must be a field, i.e., a domain of category `Cat::Field`.

#### Example 1

The 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       |
              +-                                                  -+

#### Background

- For an invertible matrix A, the Moore-Penrose inverse B of A coincides with the inverse of A. In general, only A*B*A=A and B*A*B=B holds.

  If A is of dimension m x n, then B is of dimension n x m.

- The computation of the Moore-Penrose inverse requires the existence of a scalar product on the vector space Kn, where K is the coefficient field of the matrix A. This is only the case for some fields K in theory, but `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.

#### Changes

- new function

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000