Low-rank approximation explained

In mathematics, low-rank approximation refers to the process of approximating a given matrix by a matrix of lower rank. More precisely, it is a minimization problem, in which the cost function measures the fit between a given matrix (the data) and an approximating matrix (the optimization variable), subject to a constraint that the approximating matrix has reduced rank. The problem is used for mathematical modeling and data compression. The rank constraint is related to a constraint on the complexity of a model that fits the data. In applications, often there are other constraints on the approximating matrix apart from the rank constraint, e.g., non-negativity and Hankel structure.

Low-rank approximation is closely related to numerous other techniques, including principal component analysis, factor analysis, total least squares, latent semantic analysis, orthogonal regression, and dynamic mode decomposition.

Definition

Given

l{S}:

np
R

\toRm x

,
np
p\inR
,

\|\|

, and

r

,

minimizeover\widehatp\|p-\widehatp\|subjectto\operatorname{rank}(l{S}(\widehatp))\leqr.

Applications

Basic low-rank approximation problem

The unstructured problem with fit measured by the Frobenius norm, i.e.,

minimizeover\widehatD\|D-\widehatD\|Fsubjectto\operatorname{rank}(\widehatD)\leqr

has an analytic solution in terms of the singular value decomposition of the data matrix. The result is referred to as the matrix approximation lemma or Eckart–Young–Mirsky theorem. This problem was originally solved by Erhard Schmidt[1] in the infinite dimensional context of integral operators (although his methods easily generalize to arbitrary compact operators on Hilbert spaces) and later rediscovered by C. Eckart and G. Young.[2] L. Mirsky generalized the result to arbitrary unitarily invariant norms.[3] Let

D=U\SigmaV\top\inRm x ,m\geqn

be the singular value decomposition of

D

, where

\Sigma=:\operatorname{diag}(\sigma1,\ldots,\sigmam)

is the

m x m

rectangular diagonal matrix with the singular values

\sigma1\geq\ldots\geq\sigmam

. For a given

r\in\{1,...,m-1\}

, partition

U

,

\Sigma

, and

V

as follows:

U=:\begin{bmatrix}U1&U2\end{bmatrix},\Sigma=:\begin{bmatrix}\Sigma1&0\ 0&\Sigma2\end{bmatrix},andV=:\begin{bmatrix}V1&V2\end{bmatrix},

where

U1

is

m x r

,

\Sigma1

is

r x r

, and

V1

is

r x n

. Then the rank-

r

matrix, obtained from the truncated singular value decomposition

\widehatD*=U1\Sigma1

\top
V
1

,

is such that

\|D-\widehat

*\|
D
F

=min\operatorname{rank(\widehatD)\leqr}\|D-\widehatD\|F=

2
\sqrt{\sigma
r+1

++

2
\sigma
m}.
The minimizer

\widehatD*

is unique if and only if

\sigmar+1\sigmar

.

Proof of Eckart–Young–Mirsky theorem (for spectral norm)

Let

A\inRm x

be a real (possibly rectangular) matrix with

m\leqn

. Suppose that

A=U\SigmaV\top

is the singular value decomposition of

A

. Recall that

U

and

V

are orthogonal matrices, and

\Sigma

is an

m x n

diagonal matrix with entries

(\sigma1,\sigma2,,\sigmam)

such that

\sigma1\geq\sigma2\geq\geq\sigmam\geq0

.

We claim that the best rank-

k

approximation to

A

in the spectral norm, denoted by

\|\|2

, is given by

Ak:=

k
\sum
i=1

\sigmaiui

\top
v
i

where

ui

and

vi

denote the

i

th column of

U

and

V

, respectively.

First, note that we have

\|A-Ak\|2=

\color{red
\left\|\sum
i=1

{n}}\sigmaiui

\top
v
i

-

\color{red
\sum
i=1

{k}}\sigmaiui

\top\right\|
v
2

=\left\|\sumi=\color{red{k+1}}n\sigmaiui

\top
v
i

\right\|2=\sigmak+1

Therefore, we need to show that if

Bk=XY\top

where

X

and

Y

have

k

columns then

\|A-Ak\|2=\sigmak+1\leq\|A-Bk\|2

.

Since

Y

has

k

columns, then there must be a nontrivial linear combination of the first

k+1

columns of

V

, i.e.,

w=\gamma1v1+ … +\gammak+1vk+1,

such that

Y\topw=0

. Without loss of generality, we can scale

w

so that

\|w\|2=1

or (equivalently)
2+ …
\gamma
1
2
+\gamma
k+1

=1

. Therefore,

\|A-Bk\|

2
2

\geq\|(A-Bk)w\|

2
2

=

2
\|Aw\|
2

=

2\geq
\gamma
k+1
2.
\sigma
k+1

The result follows by taking the square root of both sides of the above inequality.

Proof of Eckart–Young–Mirsky theorem (for Frobenius norm)

Let

A\inRm x

be a real (possibly rectangular) matrix with

m\leqn

. Suppose that

A=U\SigmaV\top

is the singular value decomposition of

A

.

We claim that the best rank

k

approximation to

A

in the Frobenius norm, denoted by

\|\|F

, is given by

Ak=

k
\sum
i=1

\sigmaiui

\top
v
i

where

ui

and

vi

denote the

i

th column of

U

and

V

, respectively.

First, note that we have

\|A-Ak\|

2
F

=

n
\left\|\sum
i=k+1

\sigmaiuiv

\top
i
2
\right\|
F

=

n
\sum
i=k+1
2
\sigma
i

Therefore, we need to show that if

Bk=XY\top

where

X

and

Y

have

k

columns then

\|A-Ak\|

2\leq
i

\|A-Bk\|

2.
F

By the triangle inequality with the spectral norm, if

A=A'+A''

then

\sigma1(A)\leq\sigma1(A')+\sigma1(A'')

. Suppose

A'k

and

A''k

respectively denote the rank

k

approximation to

A'

and

A''

by SVD method described above. Then, for any

i,j\geq1

\begin{align} \sigmai(A')+\sigmaj(A'')&=\sigma1(A'-A'i-1)+\sigma1(A''-A''j-1)\\ &\geq\sigma1(A-A'i-1-A''j-1)\\ &\geq\sigma1(A-Ai+j-2)    (since{\rmrank}(A'i-1+A''j-1)\leqi+j-2))\\ &=\sigmai+j-1(A). \end{align}

Since

\sigmak+1(Bk)=0

, when

A'=A-Bk

and

A''=Bk

we conclude that for

i\geq1,j=k+1

\sigmai(A-Bk)\geq\sigmak+i(A).

Therefore,

\|A-Bk\|

2
F

=

n
\sum
i=1

\sigmai(A-B

2
k)

\geq

2
\sum
i(A)

=\|A-Ak\|

2,
F

as required.

Weighted low-rank approximation problems

The Frobenius norm weights uniformly all elements of the approximation error

D-\widehatD

. Prior knowledge about distribution of the errors can be taken into account by considering the weighted low-rank approximation problem

minimizeover\widehatD\operatorname{vec}(D-\widehatD)\topW\operatorname{vec}(D-\widehatD) subjectto\operatorname{rank}(\widehatD)\leqr,

where

vec(A)

vectorizes the matrix

A

column wise and

W

is a given positive (semi)definite weight matrix.

The general weighted low-rank approximation problem does not admit an analytic solution in terms of the singular value decomposition and is solved by local optimization methods, which provide no guarantee that a globally optimal solution is found.

In case of uncorrelated weights, weighted low-rank approximation problem also can be formulated in this way:[4] [5] for a non-negative matrix

W

and a matrix

A

we want to minimize

\sumi,j(Wi,j(Ai,j-Bi,j))2

over matrices,

B

, of rank at most

r

.

Entry-wise Lp low-rank approximation problems

Let

\|A\|p=\left(\sumi,j

p|\right)
|A
i,j

1/p

. For

p=2

, the fastest algorithm runs in

nnz(A)+npoly(k/\epsilon)

time.[6] [7] One of the important ideas been used is called Oblivious Subspace Embedding (OSE), it is first proposed by Sarlos.[8]

For

p=1

, it is known that this entry-wise L1 norm is more robust than the Frobenius norm in the presence of outliers and is indicated in models where Gaussian assumptions on the noise may not apply. It is natural to seek to minimize

\|B-A\|1

.[9] For

p=0

and

p\geq1

, there are some algorithms with provable guarantees.[10] [11]

Distance low-rank approximation problem

Let

P=\{p1,\ldots,pm\}

and

Q=\{q1,\ldots,qn\}

be two point sets in an arbitrary metric space. Let

A

represent the

m x n

matrix where

Ai,j=dist(pi,qi)

. Such distances matrices are commonly computed in software packages and have applications to learning image manifolds, handwriting recognition, and multi-dimensional unfolding. In an attempt to reduce their description size,[12] [13] one can study low rank approximation of such matrices.

Distributed/Streaming low-rank approximation problem

The low-rank approximation problems in the distributed and streaming setting has been considered in.[14]

Image and kernel representations of the rank constraints

Using the equivalences

\operatorname{rank}(\widehatD)\leqr\iff thereareP\in\Rm x andL\in\Rr x suchthat\widehatD=PL

and

\operatorname{rank}(\widehatD)\leqr\iff thereisfullrowrankR\in\RmsuchthatR\widehatD=0

the weighted low-rank approximation problem becomes equivalent to the parameter optimization problems

minimizeover\widehatD,PandL\operatorname{vec}\top(D-\widehatD)W\operatorname{vec}(D-\widehatD) subjectto\widehatD=PL

and

minimizeover\widehatDandR\operatorname{vec}\top(D-\widehatD)W\operatorname{vec}(D-\widehatD) subjecttoR\widehatD=0andRR\top=Ir,

where

Ir

is the identity matrix of size

r

.

Alternating projections algorithm

The image representation of the rank constraint suggests a parameter optimization method in which the cost function is minimized alternatively over one of the variables (

P

or

L

) with the other one fixed. Although simultaneous minimization over both

P

and

L

is a difficult biconvex optimization problem, minimization over one of the variables alone is a linear least squares problem and can be solved globally and efficiently.

The resulting optimization algorithm (called alternating projections) is globally convergent with a linear convergence rate to a locally optimal solution of the weighted low-rank approximation problem. Starting value for the

P

(or

L

) parameter should be given. The iteration is stopped when a user defined convergence condition is satisfied.

Matlab implementation of the alternating projections algorithm for weighted low-rank approximation:

function [dh, f] = wlra_ap(d, w, p, tol, maxiter)[m, n] = size(d); r = size(p, 2); f = inf;for i = 2:maxiter % minimization over L bp = kron(eye(n), p); vl = (bp' * w * bp) \ bp' * w * d(:); l = reshape(vl, r, n); % minimization over P bl = kron(l', eye(m)); vp = (bl' * w * bl) \ bl' * w * d(:); p = reshape(vp, m, r); % check exit condition dh = p * l; dd = d - dh; f(i) = dd(:)' * w * dd(:); if abs(f(i - 1) - f(i)) < tol, break, endendfor

Variable projections algorithm

The alternating projections algorithm exploits the fact that the low rank approximation problem, parameterized in the image form, is bilinear in the variables

P

or

L

. The bilinear nature of the problem is effectively used in an alternative approach, called variable projections.[15]

Consider again the weighted low rank approximation problem, parameterized in the image form. Minimization with respect to the

L

variable (a linear least squares problem) leads to the closed form expression of the approximation error as a function of

P

f(P)=\sqrt{\operatorname{vec}\top(D)(W-W(InP)((InP)\topW(InP))-1(InP)\topW )\operatorname{vec}(D)}.

The original problem is therefore equivalent to the nonlinear least squares problem of minimizing

f(P)

with respect to

P

. For this purpose standard optimization methods, e.g. the Levenberg-Marquardt algorithm can be used.

Matlab implementation of the variable projections algorithm for weighted low-rank approximation:

function [dh, f] = wlra_varpro(d, w, p, tol, maxiter)prob = optimset; prob.solver = 'lsqnonlin';prob.options = optimset('MaxIter', maxiter, 'TolFun', tol); prob.x0 = p; prob.objective = @(p) cost_fun(p, d, w);[p, f ] = lsqnonlin(prob); [f, vl] = cost_fun(p, d, w); dh = p * reshape(vl, size(p, 2), size(d, 2));

function [f, vl] = cost_fun(p, d, w)bp = kron(eye(size(d, 2)), p);vl = (bp' * w * bp) \ bp' * w * d(:);f = d(:)' * w * (d(:) - bp * vl); The variable projections approach can be applied also to low rank approximation problems parameterized in the kernel form. The method is effective when the number of eliminated variables is much larger than the number of optimization variables left at the stage of the nonlinear least squares minimization. Such problems occur in system identification, parameterized in the kernel form, where the eliminated variables are the approximating trajectory and the remaining variables are the model parameters. In the context of linear time-invariant systems, the elimination step is equivalent to Kalman smoothing.

A Variant: convex-restricted low rank approximation

Usually, we want our new solution not only to be of low rank, but also satisfy other convex constraints due to application requirements. Our interested problem would be as follows,

minimizeover\widehatp\|p-\widehatp\|subjectto\operatorname{rank}(l{S}(\widehatp))\leqrand g(\widehatp)\leq0

This problem has many real world applications, including to recover a good solution from an inexact (semidefinite programming) relaxation. If additional constraint

g(\widehatp)\leq0

is linear, like we require all elements to be nonnegative, the problem is called structured low rank approximation.[16] The more general form is named convex-restricted low rank approximation.

This problem is helpful in solving many problems. However, it is challenging due to the combination of the convex and nonconvex (low-rank) constraints. Different techniques were developed based on different realizations of

g(\widehatp)\leq0

. However, the Alternating Direction Method of Multipliers (ADMM) can be applied to solve the nonconvex problem with convex objective function, rank constraints and other convex constraints,[17] and is thus suitable to solve our above problem. Moreover, unlike the general nonconvex problems, ADMM will guarantee to converge a feasible solution as long as its dual variable converges in the iterations.

See also

References

External links

Notes and References

  1. E. Schmidt, Zur Theorie der linearen und nichtlinearen Integralgleichungen, Math. Annalen 63 (1907), 433-476.
  2. C. Eckart, G. Young, The approximation of one matrix by another of lower rank. Psychometrika, Volume 1, 1936, Pages 211–8.
  3. L. Mirsky, Symmetric gauge functions and unitarily invariant norms, Q.J. Math. 11 (1960), 50-59.
  4. Weighted Low-Rank Approximations. ICML'03 . Srebro. Nathan. Jaakkola. Tommi. 2003.
  5. Weighted Low Rank Approximations with Provable Guarantees. STOC '16 Proceedings of the forty-eighth annual ACM symposium on Theory of Computing. Razenshteyn. Ilya. Song. Zhao. Woodruff. David P.. 2016.
  6. Low Rank Approximation and Regression in Input Sparsity Time . STOC '13 Proceedings of the forty-fifth annual ACM symposium on Theory of Computing. Clarkson. Kenneth L.. Woodruff. David P.. 2013. 1207.6365.
  7. OSNAP: Faster numerical linear algebra algorithms via sparser subspace embeddings . FOCS '13 . Nelson . Jelani . Nguyen. Huy L. . 2013. 1211.1002.
  8. Improved approximation algorithms for large matrices via random projections . FOCS'06 . Sarlos . Tamas . 2006.
  9. Low Rank Approximation with Entrywise L1-Norm Error. STOC '17 Proceedings of the forty-ninth annual ACM symposium on Theory of Computing. Song. Zhao. Woodruff. David P.. Zhong. Peilin. 2017. 1611.00898.
  10. Approximation Algorithms for L0-Low Rank Approximation . NIPS'17 . Bringmann. Karl . Kolev . Pavel . Woodruff. David P.. 2017. 1710.11253 .
  11. Algorithms for Lp Low-Rank Approximation . ICML'17 . Chierichetti . Flavio . Gollapudi . Sreenivas . Kumar . Ravi . Lattanzi . Silvio . Panigrahy . Rina . Woodruff. David P.. 2017. 1705.06730 .
  12. Sublinear Time Low-Rank Approximation of Distance Matrices . NeurIPS . Bakshi . Ainesh L.. Woodruff. David P.. 2018. 1809.06986.
  13. Sample-Optimal Low-Rank Approximation of Distance Matrices . COLT . Indyk . Piotr . Vakilian. Ali. Wagner. Tal. Woodruff. David P.. 2019.
  14. Optimal Principal Component Analysis in Distributed and Streaming Models . STOC . Boutsidis . Christos . Woodruff . David P. . Zhong . Peilin . 2016. 1504.06729.
  15. G. Golub and V. Pereyra, Separable nonlinear least squares: the variable projection method and its applications, Institute of Physics, Inverse Problems, Volume 19, 2003, Pages 1-26.
  16. structured low-rank approximation. 10.1016/S0024-3795(02)00505-0 . 366. Linear Algebra and Its Applications. 157–172. 2003 . Chu . Moody T. . Funderlic . Robert E. . Plemmons . Robert J. . free .
  17. Web site: A General System for Heuristic Solution of Convex Problems over Nonconvex Sets.