The singular value decomposition (SVD) is an important matrix
factorization technique that provides a numerically stable matrix
decomposition that can be used for a variety of purposes such as to obtain low-rank approximations to matrices and to perform pseudo-inverses of non-square matrices to find the solution of a system
of equations
Generally, we are interested in analyzing a large data set
For many systems $$ n \gg m
where $$ U \in \mathbb{C}^{n\times n} $$ and $$ V \in \mathbb{C}^{m\times m} $$ are unitary matrices with orthonormal columns, and $$ \mathrm{\Sigma} \in \mathbb{C}^{n\times m} $$ is a matrix with real, non-negative entries on the diagonal and zeros off the diagonal.
When $$ n \geq m
\mathrm{X} = \mathrm{U\Sigma V}^* = \left[\begin{array}{ll} \hat{U} & \hat{U}^{\perp} \end{array}\right]\left[\begin{array}{c} \hat{\Sigma} \ 0 \end{array}\right] \mathrm{V}^* = \hat{U}\hat{\Sigma}\hat{V}^* $$
We consder the image of a guy with beautiful landscape behind as shown below This image has 8192 by 5461 pixels.
Original | Gray |
---|---|
![]() |
![]() |
We apply the svd code on this image:
- install necessary files in requirements.txt
- run the svd.py
- The plots below show truncation of the columns to when r = 5, 10, 20
r =5 | r =10 | r=20 |
---|---|---|
![]() |
![]() |
![]() |
Plot the diagonal singular values:
-
Run the scd_analysis.py code
The result
Singular values | Cummulatve Singular Values |
---|---|
![]() |
![]() |
Test for around 90% of the cummulative energy where r = 1200. we get:
The above steps can be done in the matlab file. Just by running SVD_1.m
.That's all. Thank You