Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/notebooks/Chapter 18 - The Singular Value Decomposition.ipynb
Views: 449
The Singular Values
We have discussed what Spectral Decomposition which can decompose any symmetric matrices unconditionally into three special matrices.However only square matrices have eigenvalues and vectors, however we want to extend a similar concept for any matrices.
If is an matrix, then and are both symmetric and orthogonally diagonalizable.
Compute eigenvalues and eigenvectors of .
Check if is an orthonormal matrix.
The square roots of eigenvalues of are called singular values of , denoted by in decreasing order.
We can also show that singular values of are the lengths of vectors , where is the eigenvalue of .
The length of is
where and 's are eigenvalues of .
Singular Value Decomposition
Singular Value Decomposition (SVD) is probably the most important decomposition technique in the history of linear algebra, it combines all the theory we discussed, then culminate at this point.
is a matrix. However and are symmetric matrices,then both are orthogonally diagonalizable.
where is a diagonal matrix with all eigenvalues of and is a diagonal matrix with all eigenvalues of .
Because both and are symmetric, then and .
We have implicitly shown the singular value decompositions above, one of the most important concept in linear algebra.
The SVD theory guarantees that any matrix , no matter its ranks or shapes, can be unconditionally decomposed into three special matrices.
So next question: what is ?
It is an main diagonal matrix, with all singular values on the main diagonal. Rewrite
Post-multiply both sides by
This is the matrix version of , but here the matrix of interest is rather than . Similarly it can be written with singular values
Because and are not unique, we tend to standardize the solution by arranging .
Why we only arrange singular values? Because it is the rank of , so is the rank of . Explicitly looks like
We can do the same for and get
or
We have shown why holds.
To perfomr a SVD on , we just need two equations and this is also a mannual procedure to decompose any matrix.
Here's an example, let's say we have we have a data set
Give it a decomposition
Let's say we want to reduce in to .
Reformulate SVD
Rewrite
vector version is
There two implications from the equation above: can be decomposed into
We can compute by using