# PseudoInverse Matrix (G Dataflow)

Last Modified: January 9, 2017

Finds the pseudoinverse matrix of an input matrix by using singular value decomposition.

Use this node when the Inverse Matrix node cannot compute the inverse of a matrix, such as for rectangular or singular matrices.  ## matrix

A rectangular matrix.

This input accepts a 2D array of double-precision, floating point numbers or 2D array of complex double-precision, floating point numbers.

This input also accepts square matrices, but Inverse Matrix can more efficiently calculate the actual inverse of a square matrix as long as the matrix is nonsingular.

Default: Empty array ## error in

Error conditions that occur before this node runs. The node responds to this input according to standard error behavior.

Default: No error ## tolerance

A level such that the number of singular values greater than this level is the rank of the input matrix.

If this input is negative, this node uses the following equation to determine the actual tolerance:

$\text{tolerance}=\text{\hspace{0.17em}}\text{max(}m,\text{\hspace{0.17em}}n\right)*‖A‖*\epsilon$

where

• A represents the input matrix
• m represents the number of rows in A
• n represents the number of columns in A
• $‖A‖$ is the 2-norm of A
• $\epsilon$ is the smallest floating point number that can be represented by type double

Default: -1 ## pseudoinverse matrix

The pseudoinverse matrix of the input matrix. ## error out

Error information. The node produces this output according to standard error behavior.

## Algorithm for Calculating the PseudoInverse Matrix

The m-by-n matrix A+ is called the pseudoinverse of matrix A if A+ satisfies the following four Moore-Penrose conditions:

• A A+ A = A
• A+ A A+ = A+
• A A+ is a symmetric matrix
• A+ A is a symmetric matrix

This node computes the pseudoinverse matrix A+ using the SVD algorithm. For example, assume the singular value decomposition of A equals USV*. Then A+ = VS+U*. You can calculate the pseudoinverse matrix of a diagonal matrix S by taking the reciprocal of each element on the diagonal. When the elements are smaller than the tolerance, this node sets the reciprocals to zero.

The pseudoinverse provides a least-squares solution to a system of linear equations. For example, for a linear system Ax = b, the following equation is the least-squares solution: x = A+b.

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported