Home > Matrix & Vector calculators > SVD - Singular Value Decomposition example

17. SVD - Singular Value Decomposition example ( Enter your problem )
  1. Example `[[4,0],[3,-5]]`
  2. Example `[[1,0,1,0],[0,1,0,1]]`
  3. Example `[[1,1,1],[-1,-3,-3],[2,4,4]]`
  4. Example `[[2,3],[4,10]]`
Other related methods
  1. Transforming matrix to Row Echelon Form
  2. Transforming matrix to Reduced Row Echelon Form
  3. Rank of matrix
  4. Characteristic polynomial of matrix
  5. Eigenvalues
  6. Eigenvectors (Eigenspace)
  7. Triangular Matrix
  8. LU decomposition using Gauss Elimination method of matrix
  9. LU decomposition using Doolittle's method of matrix
  10. LU decomposition using Crout's method of matrix
  11. Diagonal Matrix
  12. Cholesky Decomposition
  13. QR Decomposition (Gram Schmidt Method)
  14. QR Decomposition (Householder Method)
  15. LQ Decomposition
  16. Pivots
  17. Singular Value Decomposition (SVD)
  18. Moore-Penrose Pseudoinverse
  19. Power Method for dominant eigenvalue
  20. determinants using Sarrus Rule
  21. determinants using properties of determinants
  22. Row Space
  23. Column Space
  24. Null Space

3. Example `[[1,1,1],[-1,-3,-3],[2,4,4]]`
(Previous example)
18. Moore-Penrose Pseudoinverse
(Next method)

4. Example `[[2,3],[4,10]]`





Find SVD - Singular Value Decomposition ...
`[[2,3],[4,10]]`


Solution:
`A = `
`2``3`
`4``10`


Here we are trying to find out two solutions using `A*A'` and `A'*A`


`1^"st"` Solution using `A*A'` for normalized vectors `u_i`

`A * A'`
`A^T` = 
`2``3`
`4``10`
T
 = 
`2``4`
`3``10`


`A×(A^T)`=
`2``3`
`4``10`
×
`2``4`
`3``10`


=
`2×2+3×3``2×4+3×10`
`4×2+10×3``4×4+10×10`


=
`4+9``8+30`
`8+30``16+100`


=
`13``38`
`38``116`
`A * A' = `
`13``38`
`38``116`


Find Eigen vector for `A * A'`

`|A * A'-lamdaI|=0`

 `(13-lamda)`  `38` 
 `38`  `(116-lamda)` 
 = 0


`:.(13-lamda) × (116-lamda) - 38 × 38=0`

`:.(1508-129lamda+lamda^2)-1444=0`

`:.(lamda^2-129lamda+64)=0`

`:.(lamda-0.4980469)(lamda-128.5019531)=0`

`:.(lamda-0.4980469)=0 or(lamda-128.5019531)=0 `

`:.` The eigenvalues of the matrix `A * A'` are given by `lamda=0.4980469,128.5019531`,

1. Eigenvectors for `lamda=128.5019531`




1. Eigenvectors for `lamda=128.5019531`

`A * A'-lamdaI = `
1338
38116
 - `128.5019531` 
10
01


 = 
1338
38116
 - 
128.50195310
0128.5019531

 = 
`-115.5019531``38`
`38``-12.5019531`


Now, reduce this matrix
`R_1 larr R_1-:-115.5019531`

 = 
`1``-0.32899877`
`38``-12.5019531`


`R_2 larr R_2-38xx R_1`

 = 
`1``-0.32899877`
`0``0`


The system associated with the eigenvalue `lamda=128.5019531`

`(A * A'-128.5019531I)`
`x_1`
`x_2`
 = 
`1``-0.32899877`
`0``0`
 
`x_1`
`x_2`
 = 
`0`
`0`


`=>x_1-0.32899877x_2=0`

`=>x_1=0.32899877x_2`

`:.` eigenvectors corresponding to the eigenvalue `lamda=128.5019531` is

`v=`
`0.32899877x_2`
`x_2`


Let `x_2=1`

`v_1=`
`0.32899877`
`1`
`v_1=`
`0.32899877`
`1`


2. Eigenvectors for `lamda=0.4980469`




2. Eigenvectors for `lamda=0.4980469`

`A * A'-lamdaI = `
1338
38116
 - `0.4980469` 
10
01


 = 
1338
38116
 - 
0.49804690
00.4980469

 = 
`12.5019531``38`
`38``115.5019531`


Now, reduce this matrix
interchanging rows `R_1 harr R_2`

 = 
`38``115.5019531`
`12.5019531``38`


`R_1 larr R_1-:38`

 = 
`1``3.03952508`
`12.5019531``38`


`R_2 larr R_2-12.5019531xx R_1`

 = 
`1``3.03952508`
`0``0`


The system associated with the eigenvalue `lamda=0.4980469`

`(A * A'-0.4980469I)`
`x_1`
`x_2`
 = 
`1``3.03952508`
`0``0`
 
`x_1`
`x_2`
 = 
`0`
`0`


`=>x_1+3.03952508x_2=0`

`=>x_1=-3.03952508x_2`

`:.` eigenvectors corresponding to the eigenvalue `lamda=0.4980469` is

`v=`
`-3.03952508x_2`
`x_2`


Let `x_2=1`

`v_2=`
`-3.03952508`
`1`
`v_2=`
`-3.03952508`
`1`


For Eigenvector-1 `(0.32899877,1)`, Length L = `sqrt(0.32899877^2+1^2)=1.05272987`

So, normalizing gives `u_1=(0.32899877/1.05272987,1/1.05272987)=(0.31251964,0.9499113)`

For Eigenvector-2 `(-3.03952508,1)`, Length L = `sqrt((-3.03952508)^2+1^2)=3.19979886`

So, normalizing gives `u_2=((-3.03952508)/3.19979886,1/3.19979886)=(-0.9499113,0.31251964)`


`2^"nd"` Solution using `A'*A` for normalized vectors `v_i`

`A' * A`
`A^T` = 
`2``3`
`4``10`
T
 = 
`2``4`
`3``10`


`(A^T)×A`=
`2``4`
`3``10`
×
`2``3`
`4``10`


=
`2×2+4×4``2×3+4×10`
`3×2+10×4``3×3+10×10`


=
`4+16``6+40`
`6+40``9+100`


=
`20``46`
`46``109`
`A' * A = `
`20``46`
`46``109`


Find Eigen vector for `A' * A`

`|A' * A-lamdaI|=0`

 `(20-lamda)`  `46` 
 `46`  `(109-lamda)` 
 = 0


`:.(20-lamda) × (109-lamda) - 46 × 46=0`

`:.(2180-129lamda+lamda^2)-2116=0`

`:.(lamda^2-129lamda+64)=0`

`:.(lamda-0.4980469)(lamda-128.5019531)=0`

`:.(lamda-0.4980469)=0 or(lamda-128.5019531)=0 `

`:.` The eigenvalues of the matrix `A' * A` are given by `lamda=0.4980469,128.5019531`,

1. Eigenvectors for `lamda=128.5019531`




1. Eigenvectors for `lamda=128.5019531`

`A' * A-lamdaI = `
2046
46109
 - `128.5019531` 
10
01


 = 
2046
46109
 - 
128.50195310
0128.5019531

 = 
`-108.5019531``46`
`46``-19.5019531`


Now, reduce this matrix
`R_1 larr R_1-:-108.5019531`

 = 
`1``-0.4239555`
`46``-19.5019531`


`R_2 larr R_2-46xx R_1`

 = 
`1``-0.4239555`
`0``0`


The system associated with the eigenvalue `lamda=128.5019531`

`(A' * A-128.5019531I)`
`x_1`
`x_2`
 = 
`1``-0.4239555`
`0``0`
 
`x_1`
`x_2`
 = 
`0`
`0`


`=>x_1-0.4239555x_2=0`

`=>x_1=0.4239555x_2`

`:.` eigenvectors corresponding to the eigenvalue `lamda=128.5019531` is

`v=`
`0.4239555x_2`
`x_2`


Let `x_2=1`

`v_1=`
`0.4239555`
`1`
`v_1=`
`0.4239555`
`1`


2. Eigenvectors for `lamda=0.4980469`




2. Eigenvectors for `lamda=0.4980469`

`A' * A-lamdaI = `
2046
46109
 - `0.4980469` 
10
01


 = 
2046
46109
 - 
0.49804690
00.4980469

 = 
`19.5019531``46`
`46``108.5019531`


Now, reduce this matrix
interchanging rows `R_1 harr R_2`

 = 
`46``108.5019531`
`19.5019531``46`


`R_1 larr R_1-:46`

 = 
`1``2.35873811`
`19.5019531``46`


`R_2 larr R_2-19.5019531xx R_1`

 = 
`1``2.35873811`
`0``0`


The system associated with the eigenvalue `lamda=0.4980469`

`(A' * A-0.4980469I)`
`x_1`
`x_2`
 = 
`1``2.35873811`
`0``0`
 
`x_1`
`x_2`
 = 
`0`
`0`


`=>x_1+2.35873811x_2=0`

`=>x_1=-2.35873811x_2`

`:.` eigenvectors corresponding to the eigenvalue `lamda=0.4980469` is

`v=`
`-2.35873811x_2`
`x_2`


Let `x_2=1`

`v_2=`
`-2.35873811`
`1`
`v_2=`
`-2.35873811`
`1`


For Eigenvector-1 `(0.4239555,1)`, Length L = `sqrt(0.4239555^2+1^2)=1.08615757`

So, normalizing gives `v_1=(0.4239555/1.08615757,1/1.08615757)=(0.39032597,0.92067673)`

For Eigenvector-2 `(-2.35873811,1)`, Length L = `sqrt((-2.35873811)^2+1^2)=2.56196126`

So, normalizing gives `v_2=((-2.35873811)/2.56196126,1/2.56196126)=(-0.92067673,0.39032597)`


`1^"st"` SVD Solution using `A*A'`

`:. Sigma = `
`sqrt(128.5019531)``0`
`0``sqrt(0.4980469)`
`=`
`11.3358702``0`
`0``0.70572438`


`:. U = ``[u_1,u_2]``=`
`0.31251964``-0.9499113`
`0.9499113``0.31251964`


`V` is found using formula `v_i=1/sigma_i A^T*u_i`

`:. V = `
`0.39032597``-0.92067676`
`0.92067673``0.39032589`



`2^"nd"` SVD Solution using `A'*A`

`:. Sigma = `
`sqrt(128.5019531)``0`
`0``sqrt(0.4980469)`
`=`
`11.3358702``0`
`0``0.70572438`


`:. V = ``[v_1,v_2]``=`
`0.39032597``-0.92067673`
`0.92067673``0.39032597`


`U` is found using formula `u_i=1/sigma_i A*v_i`

`:. U = `
`0.31251965``-0.94991128`
`0.9499113``0.31251971`




Verify `1^"st"` Solution `A = U Sigma V^T`


`U×Sigma`=
`0.312519644``-0.949911297`
`0.949911297``0.312519644`
×
`11.335870196``0`
`0``0.705724383`


=
`0.312519644×11.335870196-0.949911297×0``0.312519644×0-0.949911297×0.705724383`
`0.949911297×11.335870196+0.312519644×0``0.949911297×0+0.312519644×0.705724383`


=
`3.542682118+0``0-0.670375564`
`10.768071161+0``0+0.220552733`


=
`3.542682118``-0.670375564`
`10.768071161``0.220552733`


`(U × Sigma)×(V^T)`=
`3.542682118``-0.670375564`
`10.768071161``0.220552733`
×
`0.390325966``0.920676731`
`-0.920676762``0.390325893`


=
`3.542682118×0.390325966-0.670375564×-0.920676762``3.542682118×0.920676731-0.670375564×0.390325893`
`10.768071161×0.390325966+0.220552733×-0.920676762``10.768071161×0.920676731+0.220552733×0.390325893`


=
`1.38280082+0.617199204``3.261664991-0.261664941`
`4.203057778-0.203057776``9.913912555+0.086087442`


=
`2.000000024``3.000000051`
`4.000000002``9.999999998`


`1^"st"` Solution is possible.

`1^"st"` Solution is possible.


Verify `2^"nd"` Solution `A = U Sigma V^T`


`U×Sigma`=
`0.312519645``-0.949911277`
`0.949911299``0.312519711`
×
`11.335870196``0`
`0``0.705724383`


=
`0.312519645×11.335870196-0.949911277×0``0.312519645×0-0.949911277×0.705724383`
`0.949911299×11.335870196+0.312519711×0``0.949911299×0+0.312519711×0.705724383`


=
`3.542682129+0``0-0.67037555`
`10.768071183+0``0+0.22055278`


=
`3.542682129``-0.67037555`
`10.768071183``0.22055278`


`(U × Sigma)×(V^T)`=
`3.542682129``-0.67037555`
`10.768071183``0.22055278`
×
`0.390325965``0.92067673`
`-0.92067673``0.390325965`


=
`3.542682129×0.390325965-0.67037555×-0.92067673``3.542682129×0.92067673-0.67037555×0.390325965`
`10.768071183×0.390325965+0.22055278×-0.92067673``10.768071183×0.92067673+0.22055278×0.390325965`


=
`1.382800821+0.617199169``3.261664998-0.261664983`
`4.203057776-0.203057812``9.913912565+0.086087477`


=
`1.99999999``3.000000015`
`3.999999963``10.000000042`


`2^"nd"` Solution is possible.

`2^"nd"` Solution is possible.



This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then Submit Here



3. Example `[[1,1,1],[-1,-3,-3],[2,4,4]]`
(Previous example)
18. Moore-Penrose Pseudoinverse
(Next method)





Share this solution or page with your friends.


 
Copyright © 2023. All rights reserved. Terms, Privacy
 
 

.