compute the singular values of a Matrix
SingularValues(A, out, c, t, options, outopts)
Matrix, list; Matrix whose singular values are required
(optional) equation of the form output = obj where obj is one of 'U', 'S', 'Vt', or 'list', or a list containing one or more of these names; selects result objects to compute
(optional) equation of the form conjugate=true or false; specifies whether to use the Hermitian transpose in the case of non-floating-point data
(optional) equation of the form thin=true or false; specifies whether the number of left or right singular vectors computed is at most the minimum of the row and column dimensions of Matrix A.
(optional) constructor options for the result object(s)
(optional) equation(s) of the form outputoptions[o]=list where o is one of 'U', 'S', or 'Vt'; constructor options for the specified result object
The SingularValues(A) function returns the singular values of Matrix A in a column Vector.
The singular values are equal to the square roots of the (real) eigenvalues of A·Transpose⁡A (when conjugate=false) or A·HermitianTranspose⁡A (when conjugate=true, the default). Since this product is either real-symmetric or Hermitian, and positive semi-definite, the eigenvalues are all real and non-negative, and so their square roots are also purely real.
Computation of the left and right singular Vectors (as columns of Matrices) may only be requested for a Matrix A whose entries can be evaluated to purely floating-point values.
The singular values S together with the left singular Vectors as columns of Matrix U and the right singular Vectors as rows of Matrix Vt satisfy U·SS·Vt=A. Matrix SS has the entries of S along its main diagonal.
If the thin option is not supplied or is given as thin=false and if Matrix A has dimensions n x p then Matrix U has dimensions n x n, Matrix Vt has dimensions p x p, and Matrix SS has dimensions n x p.
If the thin option is given as thin or thin=true and if k is the minimum of n and p the dimensions of A then Matrix U has dimensions n x k and Matrix Vt has dimensions k x p.
For non-floating-point Matrices, in the case that the left and right singular Vectors are not requested, the singular values are returned in indexed RootOf form (as opposed to explicit radicals).
If A is a list, then the elements of the list are taken as the Matrix factors of the Matrix A, due to some prefactorization. These factors are interpreted, uniquely, as follows:
A list of Matrix, Vector[column], Vector[column] items, [B,tauq,taup], is interpreted as the result of calling BidiagonalForm with the output='NAG' option.
The output option (out) determines the content of the returned expression sequence.
Depending on what is included in the output option, an expression sequence containing one or more of the items U (the left singular vectors), S (the singular values), or Vt (the right singular vectors) can be returned. If out is given as output=[...], that is, providing a list of objects to return, the objects are returned in the same order as specified in the list. If the list output object is specified, the singular values are returned as a list. This output object cannot be specified with any other output object(s).
The options option provides additional information (readonly, shape, storage, order, datatype, and attributes) to the Vector constructor that builds the result. These options may also be provided in the form outputoptions[o]=[...], where [...] represents a Maple list. If a constructor option is provided in both the calling sequence directly and in an outputoptions[o] option, the latter takes precedence (regardless of the order).
The following list indicates permissible values for index [o] of outputoptions with their corresponding meaning.
left singular vectors
right singular vectors
This function is part of the LinearAlgebra package, and so it can be used in the form SingularValues(..) only after executing the command with(LinearAlgebra). However, it can always be accessed through the long form of the command by using LinearAlgebra[SingularValues](..).
A ≔ RandomMatrix⁡5,3,datatype=float
B,tauq,taup ≔ BidiagonalForm⁡A,output='NAG'
S ≔ SingularValues⁡B,tauq,taup,outputoptions'S'=readonly
U,Vt ≔ SingularValues⁡A,output='U','Vt':
A ≔ Matrix⁡3,2,1.0,2.0,1.0,2.1,2.0,4.1
Download Help Document