Singular Value Decomposition
Lior Pachter
California Institute of Technology
1
Lecture 5
Caltech Bi/BE/CS183
Spring 2023
These slides are distributed under the CC BY 4.0 license
M = UΣVT
Recall: Singular Value Decomposition (Lecture 1)
2
This is the most important matrix decomposition for computational biology / data science / statistics !
Preliminaries
3
Recall: a matrix is code for a (linear) function
4
1 | 1 |
0 | 1 |
How a matrix describes (is code for) a function
5
1 | 1 |
0 | 1 |
1 |
0 |
=
1 |
0 |
How a matrix describes (is code for) a function
6
1 | 1 |
0 | 1 |
0 |
1 |
=
1 |
1 |
How a matrix describes (is code for) a function
7
1 | 1 |
0 | 1 |
4 |
2 |
=
6 |
2 |
M
(
)
x
The code depends on the choice of basis
8
1 | 1 |
0 | 1 |
4 |
2 |
=
6 |
2 |
M
(
)
x
A basis consists of a set of independent vectors that span a vector space.
The code depends on the choice of basis
9
0 | 1 |
1 | -1 |
A basis consists of a set of independent vectors that span a vector space.
Bases of a vector space
10
A simple matrix (linear transformation)
11
1 | 0 |
0 | 1 |
Another simple matrix (linear transformation)
12
2 | 0 |
0 | 1 |
What is singular value decomposition about?
13
Singular value decomposition
14
The meaning of singular values
15
Measuring directions of distortion
16
The meaning of singular vectors
17
Example from Holbrook, 2019
Higher dimensions
18
Example from Holbrook, 2019
A source of confusion: eigenvectors (or selfie vectors)
19
Example from Holbrook, 2019
Another example of selfie vectors and selfie values
20
Example from Holbrook, 2019
Don’t confuse (left and right) singular vectors with eigenvectors
21
right singular vector
scaled left singular vector
eigenvector
The SVD theorem
22
The singular vectors are mutually orthogonal
23
Example from Holbrook, 2019
Relevance of orthonormality of U and V
24
Relevance of orthonormality of U and V
25
Eigendecomposition
26
From SVD to eigendecomposition
27
From eigendecomposition to SVD
28
Recap: the (linear algebra) magic of SVD
29
Example from Holbrook, 2019
Summary
Singular vectors: the right singular vectors are orthonormal vectors whose image under the linear transformation corresponding to a matrix yields the directions (orthonormal left singular vectors) of the semi-axes of the ellipsoid formed as the image of the unit sphere.
Singular values: The sizes of the semi-axes of the ellipsoid which is the image nuder the linear transformation corresponding to a matrix.
SVD by eigendecomposition: the SVD of a matrix M can be computed by eigendecomposition of the matrix MTM. This observation is the first step towards the proof that the SVD exists.
SVD as a generalization of eigendecomposition: In some sense, SVD generalizes eigendecomposition. It can be thought of as saying that “every matrix is diagonal, provided one uses the proper bases for the domain and range spaces”- (Trefethen & Bau III, 1997).
30
T
T
Using SVD on matrices derived from measurements
31
Algorithms for singular value decomposition
32
Applications of singular value decomposition
33
Low-rank approximation
34
Example
35
The Eckart-Young theorem
36
Low rank approximation for gene expression analysis
37
Orly Alter
Low rank approximation for imputation
38
Adaptively-thresholded low-rank approximation (ALRA)
39
Factorization based imputation of expression in single-cell transcriptomic analysis
40
SVD pre-processing in a workflow to identify doublets
41
see Lecture 2
SVD and decomposition of the covariance matrix.
42
Eigendecomposition of the covariance matrix
43
SVD applications
SVD stability: the singular values of matrices are stable and do not change much if matrix entries are perturbed by small amounts.
SVD algorithms: SVDs of matrices can be computed by a variety of numerical linear algebra algorithms. While SVDs of very large matrices remain challenging to compute, SVD is tractable for typical single-cell RNA-seq datasets.
Low-rank approximation: SVD can be used to produce best (Eckart-Young theorem) low-rank approximations of matrices. SVD, by virtue of providing good low-rank approximations of matrices, can also be used for imputation.
Dimension reduction: SVD can be used for PCA to reduce dimension of high-dimensional datasets. This has numerous applications ranging from noise filtering to visualization.
44
Additional References
45