# Low-rank approximation

In mathematics, low-rank approximation 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:

## Definition

Given

• structure specification ${\displaystyle {\mathcal {S}}:\mathbb {R} ^{n_{p}}\to \mathbb {R} ^{m\times n}}$,
• vector of structure parameters ${\displaystyle p\in \mathbb {R} ^{n_{p}}}$,
• norm ${\displaystyle \|\cdot \|}$, and
• desired rank ${\displaystyle r}$,
${\displaystyle {\text{minimize}}\quad {\text{over }}{\widehat {p}}\quad \|p-{\widehat {p}}\|\quad {\text{subject to}}\quad \operatorname {rank} {\big (}{\mathcal {S}}({\widehat {p}}){\big )}\leq r.}$

## Basic low-rank approximation problem

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

${\displaystyle {\text{minimize}}\quad {\text{over }}{\widehat {D}}\quad \|D-{\widehat {D}}\|_{\text{F}}\quad {\text{subject to}}\quad \operatorname {rank} {\big (}{\widehat {D}}{\big )}\leq r}$

has 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.[4] Let

${\displaystyle D=U\Sigma V^{\top }\in \mathbb {R} ^{m\times n},\quad m\leq n}$

be the singular value decomposition of ${\displaystyle D}$ and partition ${\displaystyle U}$, ${\displaystyle \Sigma =:\operatorname {diag} (\sigma _{1},\ldots ,\sigma _{m})}$, and ${\displaystyle V}$ as follows:

${\displaystyle U=:{\begin{bmatrix}U_{1}&U_{2}\end{bmatrix}},\quad \Sigma =:{\begin{bmatrix}\Sigma _{1}&0\\0&\Sigma _{2}\end{bmatrix}},\quad {\text{and}}\quad V=:{\begin{bmatrix}V_{1}&V_{2}\end{bmatrix}},}$

where ${\displaystyle \Sigma _{1}}$ is ${\displaystyle r\times r}$, ${\displaystyle U_{1}}$ is ${\displaystyle m\times r}$, and ${\displaystyle V_{1}}$ is ${\displaystyle n\times r}$. Then the rank-${\displaystyle r}$ matrix, obtained from the truncated singular value decomposition

${\displaystyle {\widehat {D}}^{*}=U_{1}\Sigma _{1}V_{1}^{\top },}$

is such that

${\displaystyle \|D-{\widehat {D}}^{*}\|_{\text{F}}=\min _{\operatorname {rank} ({\widehat {D}})\leq r}\|D-{\widehat {D}}\|_{\text{F}}={\sqrt {\sigma _{r+1}^{2}+\cdots +\sigma _{m}^{2}}}.}$

The minimizer ${\displaystyle {\widehat {D}}^{*}}$ is unique if and only if ${\displaystyle \sigma _{r+1}\neq \sigma _{r}}$.

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

Let ${\displaystyle A\in \mathbb {R} ^{m\times n}}$ be a real (possibly rectangular) matrix with ${\displaystyle m\geq n}$. Suppose that

${\displaystyle A=U\Sigma V^{\top }}$

is the singular value decomposition of ${\displaystyle A}$. Recall that ${\displaystyle U}$ and ${\displaystyle V}$ are orthogonal matrices, and ${\displaystyle \Sigma }$ is an ${\displaystyle m\times n}$ diagonal matrix with entries ${\displaystyle (\sigma _{1},\sigma _{2},\cdots ,\sigma _{n})}$ such that ${\displaystyle \sigma _{1}\geq \sigma _{2}\geq \cdots \geq \sigma _{n}\geq 0}$.

We claim that the best rank ${\displaystyle k}$ approximation to ${\displaystyle A}$ in the spectral norm, denoted by ${\displaystyle \|\cdot \|_{2}}$, is given by

${\displaystyle A_{k}=\sum _{i=1}^{k}\sigma _{i}u_{i}v_{i}^{\top }}$

where ${\displaystyle u_{i}}$and ${\displaystyle v_{i}}$ denote the ${\displaystyle i}$th column of ${\displaystyle U}$ and ${\displaystyle V}$, respectively.

First, note that we have

${\displaystyle \|A-A_{k}\|_{2}=\left\|\sum _{i=k+1}^{n}\sigma _{i}u_{i}v_{i}^{\top }\right\|_{2}=\sigma _{k+1}}$

Therefore, we need to show that if ${\displaystyle B_{k}=XY^{\top }}$ where ${\displaystyle X}$ and ${\displaystyle Y}$ have ${\displaystyle k}$ columns then ${\displaystyle \|A-A_{k}\|_{2}=\sigma _{k+1}\leq \|A-B_{k}\|_{2}}$.

Since ${\displaystyle Y}$ has ${\displaystyle k}$ columns, then there must be a linear combination of the first ${\displaystyle k+1}$ columns of ${\displaystyle V}$, i.e.,

${\displaystyle w=\gamma _{1}v_{1}+\cdots +\gamma _{k+1}v_{k+1},}$

such that ${\displaystyle Y^{\top }w=0}$. Without loss of generality, we can scale ${\displaystyle w}$ so that ${\displaystyle \|w\|_{2}=1}$ or (equivalently) ${\displaystyle \gamma _{1}^{2}+\cdots +\gamma _{k+1}^{2}=1}$. Therefore,

${\displaystyle \|A-B_{k}\|_{2}^{2}\geq \|(A-B_{k})w\|_{2}^{2}=\|Aw\|_{2}^{2}=\gamma _{1}^{2}\sigma _{1}^{2}+\cdots +\gamma _{k+1}^{2}\sigma _{k+1}^{2}\geq \sigma _{k+1}^{2}.}$

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 ${\displaystyle A\in \mathbb {R} ^{m\times n}}$ be a real (possibly rectangular) matrix with ${\displaystyle m\geq n}$. Suppose that

${\displaystyle A=U\Sigma V^{\top }}$

is the singular value decomposition of ${\displaystyle A}$.

We claim that the best rank ${\displaystyle k}$ approximation to ${\displaystyle A}$ in the Frobenius norm, denoted by ${\displaystyle \|\cdot \|_{F}}$, is given by

${\displaystyle A_{k}=\sum _{i=1}^{k}\sigma _{i}u_{i}v_{i}^{\top }}$

where ${\displaystyle u_{i}}$ and ${\displaystyle v_{i}}$ denote the ${\displaystyle i}$th column of ${\displaystyle U}$ and ${\displaystyle V}$, respectively.

First, note that we have

${\displaystyle \|A-A_{k}\|_{F}^{2}=\left\|\sum _{i=k+1}^{n}\sigma _{i}u_{i}v_{i}^{\top }\right\|_{F}^{2}=\sum _{i=k+1}^{n}\sigma _{i}^{2}}$

Therefore, we need to show that if ${\displaystyle B_{k}=XY^{\top }}$ where ${\displaystyle X}$ and ${\displaystyle Y}$ have ${\displaystyle k}$ columns then

${\displaystyle \|A-A_{k}\|_{F}^{2}=\sum _{i=k+1}^{n}\sigma _{i}^{2}\leq \|A-B_{k}\|_{F}^{2}.}$

By the triangle inequality with the spectral norm, if ${\displaystyle A=A'+A''}$ then ${\displaystyle \sigma _{1}(A)\leq \sigma _{1}(A')+\sigma _{1}(A'')}$. Suppose ${\displaystyle A'_{k}}$ and ${\displaystyle A''_{k}}$ respectively denote the rank ${\displaystyle k}$ approximation to ${\displaystyle A'}$ and ${\displaystyle A''}$ by SVD method described above. Then, for any ${\displaystyle i,j\geq 1}$

{\displaystyle {\begin{aligned}\sigma _{i}(A')+\sigma _{j}(A'')&=\sigma _{1}(A'-A'_{i-1})+\sigma _{1}(A''-A''_{j-1})\\&\geq \sigma _{1}(A-A'_{i-1}-A''_{j-1})\\&\geq \sigma _{i+j-1}(A).\end{aligned}}}

Since ${\displaystyle \sigma _{k+1}(B_{k})=0}$, when ${\displaystyle A'=A-B_{k}}$ and ${\displaystyle A''=B_{k}}$ we conclude that for ${\displaystyle i\geq 1,j=k+1}$

${\displaystyle \sigma _{i}(A-B_{k})\geq \sigma _{k+i}(A).}$

Therefore,

${\displaystyle \|A-B_{k}\|_{F}^{2}=\sum _{i=1}^{n}\sigma _{i}(A-B_{k})^{2}\geq \sum _{i=k+1}^{n}\sigma _{i}(A)^{2}=\|A-A_{k}\|_{F}^{2},}$

as required.

## Weighted low-rank approximation problems

The Frobenius norm weights uniformly all elements of the approximation error ${\displaystyle D-{\widehat {D}}}$. Prior knowledge about distribution of the errors can be taken into account by considering the weighted low-rank approximation problem

${\displaystyle {\text{minimize}}\quad {\text{over }}{\widehat {D}}\quad \operatorname {vec} ^{\top }(D-{\widehat {D}})W\operatorname {vec} (D-{\widehat {D}})\quad {\text{subject to}}\quad \operatorname {rank} ({\widehat {D}})\leq r,}$

where ${\displaystyle vec(A)}$ vectorizes the matrix ${\displaystyle A}$ column wise and ${\displaystyle 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.

Inspired by Netflix prize application, weighted low-rank approximation problem also can be formulated in this way [5] : for a non-negative matrix ${\displaystyle W}$ and a matrix ${\displaystyle A}$ we seek to minimize ${\displaystyle \sum _{i,j}(W_{i,j}(A_{i,j}-B_{i,j}))^{2}}$.

## Entry-wise L1 low-rank approximation problems

Let ${\displaystyle \|A\|_{1}=\sum _{i,j}|A_{i,j}|}$. 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 ${\displaystyle \|B-A\|_{1}}$ [6].

## Image and kernel representations of the rank constraints

Using the equivalences

${\displaystyle \operatorname {rank} ({\widehat {D}})\leq r\quad \iff \quad {\text{there are }}P\in \mathbb {R} ^{m\times r}{\text{ and }}L\in \mathbb {R} ^{r\times n}{\text{ such that }}{\widehat {D}}=PL}$

and

${\displaystyle \operatorname {rank} ({\widehat {D}})\leq r\quad \iff \quad {\text{there is full row rank }}R\in \mathbb {R} ^{m-r\times m}{\text{ such that }}R{\widehat {D}}=0}$

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

${\displaystyle {\text{minimize}}\quad {\text{over }}{\widehat {D}},P{\text{ and }}L\quad \operatorname {vec} ^{\top }(D-{\widehat {D}})W\operatorname {vec} (D-{\widehat {D}})\quad {\text{subject to}}\quad {\widehat {D}}=PL}$

and

${\displaystyle {\text{minimize}}\quad {\text{over }}{\widehat {D}}{\text{ and }}R\quad \operatorname {vec} ^{\top }(D-{\widehat {D}})W\operatorname {vec} (D-{\widehat {D}})\quad {\text{subject to}}\quad R{\widehat {D}}=0\quad {\text{and}}\quad RR^{\top }=I_{r},}$

where ${\displaystyle I_{r}}$ is the identity matrix of size ${\displaystyle 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 (${\displaystyle P}$ or ${\displaystyle L}$) with the other one fixed. Although simultaneous minimization over both ${\displaystyle P}$ and ${\displaystyle 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 ${\displaystyle P}$ (or ${\displaystyle 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, end
end

## 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 ${\displaystyle P}$ or ${\displaystyle L}$. The bilinear nature of the problem is effectively used in an alternative approach, called variable projections.[7]

Consider again the weighted low rank approximation problem, parameterized in the image form. Minimization with respect to the ${\displaystyle L}$ variable (a linear least squares problem) leads to the closed form expression of the approximation error as a function of ${\displaystyle P}$

${\displaystyle f(P)={\sqrt {\operatorname {vec} ^{\top }(D){\Big (}W-W(I_{n}\otimes P){\big (}(I_{n}\otimes P)^{\top }W(I_{n}\otimes P){\big )}^{-1}(I_{n}\otimes P)^{\top }W{\Big )}\operatorname {vec} (D)}}.}$

The original problem is therefore equivalent to the nonlinear least squares problem of minimizing ${\displaystyle f(P)}$ with respect to ${\displaystyle 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,

${\displaystyle {\text{minimize}}\quad {\text{over }}{\widehat {p}}\quad \|p-{\widehat {p}}\|\quad {\text{subject to}}\quad \operatorname {rank} {\big (}{\mathcal {S}}({\widehat {p}}){\big )}\leq r{\text{ and }}g({\widehat {p}})\leq 0}$

This problem can find tons of real applications, including to recover a good solution from an inexact (semidefinite programming) relaxation. If additional constraint ${\displaystyle g({\widehat {p}})\leq 0}$ is linear, like we require all elements to be nonnegative, the problem is called structured low rank approximation.[8] And the more general form is named as convex-restricted low rank approximation.[9]

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 ${\displaystyle g({\widehat {p}})\leq 0}$. 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,[10] 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

## References

1. ^ I. Markovsky, Structured low-rank approximation and its applications, Automatica, Volume 44, Issue 4, April 2008, Pages 891–909. doi:10.1016/j.automatica.2007.09.011
2. ^ I. Markovsky, J. C. Willems, S. Van Huffel, B. De Moor, and R. Pintelon, Application of structured total least squares for system identification and model reduction. IEEE Transactions on Automatic Control, Volume 50, Number 10, 2005, pages 1490–1500.
3. ^ I. Markovsky, Low-Rank Approximation: Algorithms, Implementation, Applications, Springer, 2012, ISBN 978-1-4471-2226-5
4. ^ C. Eckart, G. Young, The approximation of one matrix by another of lower rank. Psychometrika, Volume 1, 1936, Pages 211–8. doi:10.1007/BF02288367
5. ^ Razenshteyn, Ilya; Song, Zhao; Woodruff, David P. (2016). Weighted Low Rank Approximations with Provable Guarantees. STOC '16 Proceedings of the forty-eighth annual ACM symposium on Theory of Computing.
6. ^ Song, Zhao; Woodruff, David P.; Zhong, Peilin (2017). Low Rank Approximation with Entrywise L1-Norm Error (PDF). STOC '17 Proceedings of the forty-ninth annual ACM symposium on Theory of Computing.
7. ^ 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.
8. ^ "structured low-rank approximation". Linear Algebra and its Applications. 366: 157–172. doi:10.1016/S0024-3795(02)00505-0.
9. ^ Zhang, Ying (2015). "restricted low-rank approximation". arXiv: [cs.NA].
10. ^ "A General System for Heuristic Solution of Convex Problems over Nonconvex Sets" (PDF).
• M. T. Chu, R. E. Funderlic, R. J. Plemmons, Structured low-rank approximation, Linear Algebra and its Applications, Volume 366, 1 June 2003, Pages 157–172 doi:10.1016/S0024-3795(02)00505-0