nimble.calculate.pseudoInverse

nimble.calculate.pseudoInverse(aObj)

Compute the (Moore-Penrose) pseudo-inverse of a nimble Base object.

Calculate a generalized inverse of a matrix using singular-value decomposition solver.

Parameters:

aObj (nimble Base object.) – Square object to be pseudo-inverted.

Returns:

aPInv (nimble Base object.) – Pseudo-inverse of the object aObj

Raises:

InvalidArgumentType – If aObj is not a nimble Base Object. If aObj elements types are not supported.

Examples

>>> lst = [[1, 2], [3, 4]]
>>> X = nimble.data(lst)
>>> X
<Matrix 2pt x 2ft
     0  1
   ┌─────
 0 │ 1  2
 1 │ 3  4
>
>>> pseudoInverse(X)
<Matrix 2pt x 2ft
       0       1
   ┌───────────────
 0 │ -2.000   1.000
 1 │  1.500  -0.500
>