class SingularValueDecomposition (View source)

For an m-by-n matrix A with m >= n, the singular value decomposition is an m-by-n orthogonal matrix U, an n-by-n diagonal matrix S, and an n-by-n orthogonal matrix V so that A = USV'.

The singular values, sigma[$k] = S[$k][$k], are ordered so that sigma[0] >= sigma[1] >= ... >= sigma[n-1].

The singular value decompostion always exists, so the constructor will never fail. The matrix condition number and the effective numerical rank can be computed from this decomposition.

Methods

__construct(mixed $Arg)

Construct the singular value decomposition.

getU()

Return the left singular vectors.

getV()

Return the right singular vectors.

array
getSingularValues()

Return the one-dimensional array of singular values.

getS()

Return the diagonal matrix of singular values.

float
norm2()

Two norm.

float
cond()

Two norm condition number.

int
rank()

Effective numerical matrix rank.

Details

__construct(mixed $Arg)

Construct the singular value decomposition.

Derived from LINPACK code.

Parameters

mixed $Arg Rectangular matrix

Matrix getU()

Return the left singular vectors.

Return Value

Matrix U

Matrix getV()

Return the right singular vectors.

Return Value

Matrix V

array getSingularValues()

Return the one-dimensional array of singular values.

Return Value

array diagonal of S

Matrix getS()

Return the diagonal matrix of singular values.

Return Value

Matrix S

float norm2()

Two norm.

Return Value

float max(S)

float cond()

Two norm condition number.

Return Value

float max(S)/min(S)

int rank()

Effective numerical matrix rank.

Return Value

int Number of nonnegligible singular values