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

From ApCoCoAWiki
(Added reference to SingularValues)
m (replaced <quotes> tag by real quotes)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
   <command>
+
   {{Version|1}}
 +
<command>
 
     <title>Num.SVD</title>
 
     <title>Num.SVD</title>
 
     <short_description>Computes the singular value decomposition of a matrix.</short_description>
 
     <short_description>Computes the singular value decomposition of a matrix.</short_description>
Line 22: Line 23:
 
-------------------------------
 
-------------------------------
 
[Mat([
 
[Mat([
   [<quotes>-0.473</quotes>, <quotes>-0.666</quotes>, <quotes>-0.575</quotes>],
+
   ["-0.473", "-0.666", "-0.575"],
   [<quotes>-0.415</quotes>, <quotes>-0.407</quotes>, <quotes>0.813</quotes>],
+
   ["-0.415", "-0.407", "0.813"],
   [<quotes>-0.776</quotes>, <quotes>0.624</quotes>, <quotes>-0.084</quotes>]
+
   ["-0.776", "0.624", "-0.084"]
 
]), Mat([
 
]), Mat([
   [<quotes>33.091</quotes>, <quotes>17.047</quotes>, <quotes>3.365</quotes>]
+
   ["33.091", "17.047", "3.365"]
 
]), Mat([
 
]), Mat([
   [<quotes>-0.579</quotes>, <quotes>-0.266</quotes>, <quotes>-0.424</quotes>, <quotes>-0.642</quotes>],
+
   ["-0.579", "-0.266", "-0.424", "-0.642"],
   [<quotes>0.755</quotes>, <quotes>0.119</quotes>, <quotes>-0.159</quotes>, <quotes>-0.624</quotes>],
+
   ["0.755", "0.119", "-0.159", "-0.624"],
   [<quotes>-0.265</quotes>, <quotes>0.423</quotes>, <quotes>0.750</quotes>, <quotes>-0.431</quotes>],
+
   ["-0.265", "0.423", "0.750", "-0.431"],
   [<quotes>-0.153</quotes>, <quotes>0.857</quotes>, <quotes>-0.480</quotes>, <quotes>0.100</quotes>]
+
   ["-0.153", "0.857", "-0.480", "0.100"]
 
])]
 
])]
 
-------------------------------
 
-------------------------------
Line 37: Line 38:
 
     </description>
 
     </description>
 
     <seealso>
 
     <seealso>
       <see>Introduction to CoCoAServer</see>
+
       <see>ApCoCoA-1:Introduction to CoCoAServer|Introduction to CoCoAServer</see>
       <see>Num.QR</see>
+
       <see>ApCoCoA-1:Num.QR|Num.QR</see>
       <see>Num.SingularValues</see>
+
       <see>ApCoCoA-1:Num.SingularValues|Num.SingularValues</see>
       <see>Num.EigenValues</see>
+
       <see>ApCoCoA-1:Num.EigenValues|Num.EigenValues</see>
       <see>Num.EigenValuesAndVectors</see>
+
       <see>ApCoCoA-1:Num.EigenValuesAndVectors|Num.EigenValuesAndVectors</see>
       <see>Num.EigenValuesAndAllVectors</see>
+
       <see>ApCoCoA-1:Num.EigenValuesAndAllVectors|Num.EigenValuesAndAllVectors</see>
 
     </seealso>
 
     </seealso>
 
     <types>
 
     <types>
Line 51: Line 52:
 
     <key>svd</key>
 
     <key>svd</key>
 
     <key>num.svd</key>
 
     <key>num.svd</key>
     <wiki-category>Package_numerical</wiki-category>
+
     <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