Difference between revisions of "ApCoCoA-1:Num.SVD"

From ApCoCoAWiki
m (replaced <quotes> tag by real quotes)
 
(13 intermediate revisions by 4 users not shown)
Line 1: Line 1:
   <command>
+
   {{Version|1}}
     <title>Numerical.SVD</title>
+
<command>
     <short_description>singular value decomposition of a matrix</short_description>
+
     <title>Num.SVD</title>
 +
     <short_description>Computes the singular value decomposition of a matrix.</short_description>
 
<syntax>
 
<syntax>
$numerical.SVD(A:Matrix):[B:Matrix,C:Matrix,D:Matrix]
+
Num.SVD(A:MAT):[U:MAT,S:MAT,VT:MAT]
 
</syntax>
 
</syntax>
 
     <description>
 
     <description>
{{ApCoCoAServer}} Please also note that you will have to use an ApCoCoAServer with enabled BLAS/LAPACK support.
+
<em>Please note:</em> The function(s) explained on this page is/are using the <em>ApCoCoAServer</em>. You will have to start the ApCoCoAServer in order to use it/them.
 +
<par/>
 +
This command computes the singular value decomposition of the given matrix <tt>A</tt>. Let <tt>A</tt> be a <tt>(m x n)</tt> matrix. Then <tt>A</tt> is decomposed into the product of an orthogonal <tt>(m x m)</tt> matrix <tt>U</tt>, a transposed matrix <tt>VT</tt> of an orthogonal <tt>(n x n)</tt> matrix <tt>V</tt> and a real <tt>(m x n)</tt> matrix <tt>S</tt>, which contains the singular values of the matrix <tt>A</tt>.
  
This function returns a list of three matrices which form the singular
+
<itemize>
value decomposition of the input matrix.  The list produced is <formula>[U, S, VT]</formula>.
+
<item>@param <em>A</em> The matrix we want to decompose.</item>
 +
<item>@return A list of three matrices <tt>[U, S, VT]</tt> such that <tt>A=U*S*VT</tt>.</item>
 +
</itemize>
  
 +
<example>
 +
D:=[[1,2,7,18],[2,4,9,12],[23,8,9,10]];
 +
Dec(Num.SVD(D),3);
  
<example>
+
-- CoCoAServer: computing Cpu Time = 0
D:=Mat([[1,2,7,18],[2,4,9,12],[23,8,9,10]]);
 
$numerical.SVD(D);
 
 
-------------------------------
 
-------------------------------
 
[Mat([
 
[Mat([
   [-2608957845014309/4503599627370496, 3400715993947695/4503599627370496, -1196230415249177/4503599627370496, -5542055005031021/36028797018963968],
+
   ["-0.473", "-0.666", "-0.575"],
  [-4803191187447087/18014398509481984, 4289880920686871/36028797018963968, 3813211715037953/9007199254740992, 7724713654272699/9007199254740992],
+
   ["-0.415", "-0.407", "0.813"],
   [-7645273287337725/18014398509481984, -5741692259075309/36028797018963968, 3381220959856661/4503599627370496, -540919752203371/1125899906842624],
+
   ["-0.776", "0.624", "-0.084"]
   [-5789886178591733/9007199254740992, -2813340077166513/4503599627370496, -7780633724302695/18014398509481984, 3606131681355807/36028797018963968]
 
 
]), Mat([
 
]), Mat([
   [1164315100749939/35184372088832, 4798366071344577/281474976710656, 3788674137264815/1125899906842624]
+
   ["33.091", "17.047", "3.365"]
 
]), Mat([
 
]), Mat([
   [-8521591816535737/18014398509481984, -3744869794805223/9007199254740992, -6996513907843673/9007199254740992],
+
   ["-0.579", "-0.266", "-0.424", "-0.642"],
   [-3002889242741505/4503599627370496, -7337996657000815/18014398509481984, 2810636692253967/4503599627370496],
+
   ["0.755", "0.119", "-0.159", "-0.624"],
   [-5187087952406809/9007199254740992, 915526145687749/1125899906842624, -6091132379868651/72057594037927936]
+
  ["-0.265", "0.423", "0.750", "-0.431"],
 +
   ["-0.153", "0.857", "-0.480", "0.100"]
 
])]
 
])]
 
-------------------------------
 
-------------------------------
Line 32: Line 38:
 
     </description>
 
     </description>
 
     <seealso>
 
     <seealso>
       <see>Introduction to CoCoAServer</see>
+
       <see>ApCoCoA-1:Introduction to CoCoAServer|Introduction to CoCoAServer</see>
       <see>Numerical.QR</see>
+
       <see>ApCoCoA-1:Num.QR|Num.QR</see>
       <see>Numerical.EigenValues</see>
+
       <see>ApCoCoA-1:Num.SingularValues|Num.SingularValues</see>
       <see>Numerical.EigenValuesAndVectors</see>
+
      <see>ApCoCoA-1:Num.EigenValues|Num.EigenValues</see>
       <see>Numerical.EigenValuesAndAllVectors</see>
+
       <see>ApCoCoA-1:Num.EigenValuesAndVectors|Num.EigenValuesAndVectors</see>
 +
       <see>ApCoCoA-1:Num.EigenValuesAndAllVectors|Num.EigenValuesAndAllVectors</see>
 
     </seealso>
 
     </seealso>
 
     <types>
 
     <types>
       <type>cocoaserver</type>
+
       <type>apcocoaserver</type>
 +
      <type>matrix</type>
 
     </types>
 
     </types>
 
     <key>numerical.svd</key>
 
     <key>numerical.svd</key>
     <wiki-category>Package_numerical</wiki-category>
+
    <key>svd</key>
 +
    <key>num.svd</key>
 +
     <wiki-category>ApCoCoA-1:Package_numerical</wiki-category>
 
   </command>
 
   </command>

Latest revision as of 13:48, 29 October 2020

This article is about a function from ApCoCoA-1.

Num.SVD

Computes the singular value decomposition of a matrix.

Syntax

Num.SVD(A:MAT):[U:MAT,S:MAT,VT:MAT]

Description

Please note: The function(s) explained on this page is/are using the ApCoCoAServer. You will have to start the ApCoCoAServer in order to use it/them.

This command computes the singular value decomposition of the given matrix A. Let A be a (m x n) matrix. Then A is decomposed into the product of an orthogonal (m x m) matrix U, a transposed matrix VT of an orthogonal (n x n) matrix V and a real (m x n) matrix S, which contains the singular values of the matrix A.

  • @param A The matrix we want to decompose.

  • @return A list of three matrices [U, S, VT] such that A=U*S*VT.

Example

D:=[[1,2,7,18],[2,4,9,12],[23,8,9,10]];
Dec(Num.SVD(D),3);

-- CoCoAServer: computing Cpu Time = 0
-------------------------------
[Mat([
  ["-0.473", "-0.666", "-0.575"],
  ["-0.415", "-0.407", "0.813"],
  ["-0.776", "0.624", "-0.084"]
]), Mat([
  ["33.091", "17.047", "3.365"]
]), Mat([
  ["-0.579", "-0.266", "-0.424", "-0.642"],
  ["0.755", "0.119", "-0.159", "-0.624"],
  ["-0.265", "0.423", "0.750", "-0.431"],
  ["-0.153", "0.857", "-0.480", "0.100"]
])]
-------------------------------

See also

Introduction to CoCoAServer

Num.QR

Num.SingularValues

Num.EigenValues

Num.EigenValuesAndVectors

Num.EigenValuesAndAllVectors