LinearAlgebra - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Linear Algebra : LinearAlgebra Package : Eigenvalues : LinearAlgebra/SingularValues

LinearAlgebra

  

SingularValues

  

compute the singular values of a Matrix

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

SingularValues(A, out, c, t, options, outopts)

Parameters

A

-

Matrix, list; Matrix whose singular values are required

out

-

(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

c

-

(optional) BooleanOpt(conjugate); specifies whether to use the Hermitian transpose in the case of non-floating-point data

t

-

(optional) BooleanOpt(thin); 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.

options

-

(optional); constructor options for the result object(s)

outopts

-

(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

Description

• 

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.TransposeA (conjugate=false) or A.HermitianTransposeA (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.

  

 

U

left singular vectors

S

singular values

Vt

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](..).

Examples

withLinearAlgebra:

ARandomMatrix5,3,datatype=float

A:=55.58.21.67.94.25.77.7.40.70.12.97.13.53.43.

(1)

SingularValuesA,output='list'

157.836196052456,117.916483181125,93.9225117311403,0.,0.

(2)

B,tauq,taupBidiagonalFormA,output='NAG'

B,tauq,taup:=136.05881081356057.86208428081950.1720434733722000.350677363240685108.9812993156781.819502439766240.4030172682019820.462622084679374117.8886975626490.3663793347290740.1540536311684740.4812713476860890.06804187644968520.4919024479197470.282894860406543,1.404236959526031.351607304880811.524795137273310.0.,1.942503910796530.0.0.0.

(3)

SSingularValuesB,tauq,taup,outputoptions'S'=readonly

S:=157.836196052456117.91648318112593.92251173114030.0.

(4)

U,VtSingularValuesA,output='U','Vt':

U.DiagonalMatrixS1..3,5,3.Vt

55.000000000000058.000000000000021.000000000000067.94.000000000000025.000000000000077.00000000000007.0000000000000240.000000000000070.000000000000012.000000000000097.000000000000013.000000000000053.000000000000043.0000000000000

(5)

AMatrix3,2,1.0,2.0,1.0,2.1,2.0,4.1

A:=1.02.01.02.12.04.1

(6)

SingularValuesA,output='U'

0.4001788175315170.7117047004662340.5773502691896360.4162649418308020.7024173722718410.5773502691896160.8164437593623190.009287328194417850.577350269189626

(7)

SingularValuesA,output='U',thin

0.4001788175315170.7117047004662340.4162649418308020.7024173722718410.8164437593623190.00928732819441785

(8)

See Also

LinearAlgebra[Eigenvalues]

Matrix

RootOf

Vector

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam