arXiv is now an independent nonprofit! Learn more
License: arXiv.org perpetual non-exclusive license
arXiv:1809.03285v1 [math.NA] 10 Sep 2018

SVD update methods for large matrices and applications Note: Dedicated to Mariano Gasca on the occasion of his 75th birthday with friendship and gratitude for long years of support and fruitful collaboration. Note: This work was partially supported by the Spanish Research Grant MTM2015-65433-P (MINECO/FEDER), by Gobierno de Aragón and Fondo Social Europeo. Journal: Linear Algebra and Its Applications

Juan Manuel Peña Email: jmpena@unizar.es Address: Depto. Matemática Aplicada, Fac. Ciencias, Universidad de Zaragoza, E–50009 Zaragoza, SPAIN.    Tomas Sauer Email: Tomas.Sauer@uni-passau.de Address: Lehrstuhl Mathematik mit Schwerpunkt Digitale Bildverarbeitung & FORWISS, Universität Passau, Fraunhofer IIS Reserch Group for Knowledge Based Image Processing, Innstr. 43, 94032 Passau, GERMANY.
Abstract

We consider the problem of updating the SVD when augmenting a “tall thin” matrix, i.e., a rectangular matrix Am×nA\in\mathbb{R}^{m\times n} with mnm\gg n. Supposing that an SVD of AA is already known, and given a matrix Bm×nB\in\mathbb{R}^{m\times n^{\prime}}, we derive an efficient method to compute and efficiently store the SVD of the augmented matrix [AB]m×(n+n)[AB]\in\mathbb{R}^{m\times(n+n^{\prime})}. This is an important tool for two types of applications: in the context of principal component analysis, the dominant left singular vectors provided by this decomposition form an orthonormal basis for the best linear subspace of a given dimension, while from the right singular vectors one can extract an orthonormal basis of the kernel of the matrix. We also describe two concrete applications of these concepts which motivated the development of our method and to which it is very well adapted.

Keywords: 
SVD , augmented matrix , PCA , Prony’s problem
MSC
65F30

1 Introduction

The singular value decomposition A=UΣVTA=U\Sigma V^{T} of a matrix Am×nA\in\mathbb{R}^{m\times n} is a useful and important tool in many applications and there exist algorithms and even toolboxes to perform this task numerically. Indeed, the matrices UU, VV, obtained in the decomposition give valuable information about AA in a compressed way: the singular vectors, the columns of the matrix UU, give best low dimensional approximations of the subspace generated by the columns of AA, while the matrix VV reliably detects the kernel of the matrix AA and therefore is the method of choice for numerical rank detection, see [1, 2].

In many applications, specifically in video processing or in the multivariate versions of Prony’s method, the full matrix AA is not known from the beginning, but is built by successively adding columns or blocks of columns; these added blocks can correspond to new measurements or can just be determined by the algorithm itself. What these applications have in common is that the columns of the matrices are large, i.e., mnm\gg n. This calls for reliable and efficient update algorithms for a matrix whose SVD is already known. Such an algorithm, due to Businger [3], is described in [4], however this algorithm, more precisely its transposed version to add columns, then assumes that mnm\leq n which means that it adds mostly redundant columns. In [5], Brand more recently gave a fast algorithm to update few dominant singular values of an augmented matrix which was used, for example, to perform background elimination in videos [6]. Brand’s method is based on an efficient way to perform rank 11 modifications, see [5, Sections 3 and 4.1], hence it would proceed columnwise to add a full block. In this paper, we give an algorithm that adds the columns simultaneously to a “tall and thin” matrix, but always computes the full SVD in an efficient way, and point out the connections to PCA based video analysis and Prony’s method.

In the latter, the main numerical problem in the algorithms presented in [7, 8] is to determine reliably the nullspaces of sequences of matrices that are generated by successively adding blocks of columns. Adding these columns corresponds to extending a symmetric H–basis for an ideal, and treating them in a symmetric way and not attaching them in some order is of great importance for the numerical performance of such algorithms. In other words, we have to determine the nullspaces of sequences

B0,[B0B1],[B0B1B2],,B_{0},\quad[B_{0}\,B_{1}],\quad[B_{0}\,B_{1}\,B_{2}],\dots,

where, depending on the algorithm used, BjB_{j} can be a single column or a block of several columns. Clearly, the rank of these matrices is increasing which is, however, not captured by a naive application of Matlab’s rank command to the augmented matrices. Since numerical rank computations are usually based on a singular value decomposition (SVD) of the matrix, we aim for a method which uses an already existing SVD of a given matrix AkA_{k} to compute the SVD of the column augmented Ak+1=[AkBk]A_{k+1}=[A_{k}\,B_{k}] in an efficient, numerically stable and reliable way.

Though the concrete method we develop and investigate here is new, the problem itself has been considered before. Indeed, Updating methods for rank revealing factorizations have been considered by Stewart [9] in a very similar context, namely for the MUSIC algorithm [10] that solves Prony’s problem in one variable in the context of multisource radar signal processing. Other approaches for updating SVD and QR algorithm can be found in [11] and [12], respectively. Incremental methods for dominant singular subspaces were also considered in [13], where only some dominant singular vectors were computed. In contrast to that, our approach aims to always compute the full thin SVD of the matrix which is especially needed for kernel computations.

The layout of the paper is as follows. In Section 2 we present our method to update the SVD and analyze its computational cost. Section 3 presents a corresponding thresholding strategy, which is designed ensure that increasing ranks are detected properly. Section 4 presents two applications for which the augmented SVD method is very well suited: to Principal Component Analysis of videos in Subsection 4.3 and to the already mentioned solution of Prony’s problem in several variables, see Subsection 4.4.

2 Updating decompositions – idea and details

We are considering processes that determine matrices Akd×nkA_{k}\in\mathbb{R}^{d\times n_{k}}, k=1,2,k=1,2,\dots, by the iterative block column extension

Ak+1=[AkBk],Bkd×mk,mk:=nk+1nk,A_{k+1}=\left[A_{k}\,B_{k}\right],\qquad B_{k}\in\mathbb{R}^{d\times m_{k}},\qquad m_{k}:=n_{k+1}-n_{k}, (1)

where nkdn_{k}\leq d, usually nkdn_{k}\ll d, and want to compute a rank revealing decomposition or an SVD for Ak+1A_{k+1} in an efficient and numerically stable way from that of AkA_{k}.

We begin with the SVD and adapt an idea to our needs which is referenced in [4], as Businger’s method [3]. The exposition in [4], however, extends a matrix with more rows than columns by adding a further row and it is mentioned in passing that adding of columns can be done by transposition. Then, however, the matrix should have more columns than rows which is not the case in our situation. Nevertheless, the basic idea can be adapted.

To that end, we assume that we already computed a decomposition

Ak=UkΣkVkT,rankAk=:rknkd,A_{k}=U_{k}\Sigma_{k}V_{k}^{T},\qquad{\mathop{\rm rank\,}\nolimits}A_{k}=:r_{k}\leq n_{k}\leq d, (2)

with orthogonal matrices

Ukd×d,Vknk×nk,U_{k}\in\mathbb{R}^{d\times d},\qquad V_{k}\in\mathbb{R}^{n_{k}\times n_{k}}, (3)

and the diagonal matrix

Σk=[Σk0rk×(nkrk)0(drk)×rk0(drk)×(nkrk)]d×nk,Σkrk×rk,\Sigma_{k}=\left[\begin{array}[]{cc}\Sigma_{k}^{\prime}&0_{r_{k}\times(n_{k}-r_{k})}\\ 0_{(d-r_{k})\times r_{k}}&0_{(d-r_{k})\times(n_{k}-r_{k})}\end{array}\right]\in\mathbb{R}^{d\times n_{k}},\qquad\Sigma_{k}^{\prime}\in\mathbb{R}^{r_{k}\times r_{k}}, (4)

where Σk\Sigma_{k}^{\prime} has strictly positive diagonal values.

Remark 2.1

Due to (3), the factorization is formally not a “slim” or “economic” decomposition of AkA_{k}. Such a decomposition would be of the form

Ak=UΣVT,Ud×rk,Σrk×rk,Vrk×nk,A_{k}=U\Sigma V^{T},\qquad U\in\mathbb{R}^{d\times r_{k}},\,\Sigma\in\mathbb{R}^{r_{k}\times r_{k}},\,V\in\mathbb{R}^{r_{k}\times n_{k}},

with all diagonal elements of σ\sigma being positive.

Note, however, that in (2) the last drkd-r_{k} columns of UU and the last nkrkn_{k}-r_{k} columns ov VV are irrelevant for the validity of the decomposition, hence it is not unique. We will later describe how to represent one such decomposition with a memory effort that only exceeds that of a thin representation by rk(rk+nk)r_{k}(r_{k}+n_{k}) elements. This is negligible in the case when dnkd\gg n_{k} and has the advantage that we always compute a full orthonormal basis of the kernel of AkA_{k}, which was motivated by its importance for the Prony application.

In what follows, we first deduce the updating method in a general fashion and give the numerically efficient implementations of the crucial steps afterwards. To that end, we define in a straightforward way,

X:=UkTAk+1[Vk00I]=UkT[AkBk][Vk00I]=[Σk|UkTBk]X:=U_{k}^{T}A_{k+1}\left[\begin{array}[]{cc}V_{k}&0\\ 0&I\end{array}\right]=U_{k}^{T}[A_{k}\,B_{k}]\left[\begin{array}[]{cc}V_{k}&0\\ 0&I\end{array}\right]=\left[\Sigma_{k}\,|\,U_{k}^{T}B_{k}\right]

and observe that

X=[Σk000]=[Σk000]Pk=:[ΣkY00Y0]PkX=\left[\begin{array}[]{ccc}\Sigma_{k}^{\prime}&0&*\\ 0&0&*\end{array}\right]=\left[\begin{array}[]{ccc}\Sigma_{k}^{\prime}&*&0\\ 0&*&0\end{array}\right]\,P_{k}=:\left[\begin{array}[]{ccc}\Sigma_{k}^{\prime}&Y^{\prime}&0\\ 0&Y&0\end{array}\right]\,P_{k} (5)

for the permutation matrix

Pk=[Irk0000Inkrk0Imk0]nk+1×nk+1,P_{k}=\left[\begin{array}[]{ccc}I_{r_{k}}&0&0\\ 0&0&I_{n_{k}-r_{k}}\\ 0&I_{m_{k}}&0\end{array}\right]\in\mathbb{R}^{n_{k+1}\times n_{k+1}},

that permutes the last nk+1rkn_{k+1}-r_{k} columns. Next, we apply a QR method with column pivoting on the matrix Y(drk)×mkY\in\mathbb{R}^{(d-r_{k})\times m_{k}}, finding a permutation Pmk×mkP\in\mathbb{R}^{m_{k}\times m_{k}} and a decomposition

Y=Q~[R~0]P,Q~(drk)×(drk),R~mk×mk,Y=\widetilde{Q}\,\left[\begin{array}[]{c}\widetilde{R}\\ 0\end{array}\right]\,P,\qquad\widetilde{Q}\in\mathbb{R}^{(d-r_{k})\times(d-r_{k})},\quad\widetilde{R}\in\mathbb{R}^{m_{k}\times m_{k}}, (6)

where, as usually in rank revealing factorizations, column pivoting ensures that the entries of R~=[r~ij:i,j=1,,mk]\widetilde{R}=\left[\tilde{r}_{ij}:i,j=1,\dots,m_{k}\right] satisfy

|r~11||r~mk,mk|and|r~jj||r~j|,j,j=1,,mk.|\tilde{r}_{11}|\geq\cdots\geq|\tilde{r}_{m_{k},m_{k}}|\qquad\text{and}\qquad|\tilde{r}_{jj}|\geq|\tilde{r}_{j\ell}|,\quad\ell\geq j,\,j=1,\dots,m_{k}. (7)

Defining the orthogonal matrix

Q=[Irk×rk00Q~]d×d,Q=\left[\begin{array}[]{cc}I_{r_{k}\times r_{k}}&0\\ 0&\widetilde{Q}\end{array}\right]\in\mathbb{R}^{d\times d},

the decomposition (6) yields that

QT[YY]=[YQ~TY]=[YPTR~0]P.Q^{T}\left[\begin{array}[]{c}Y^{\prime}\\ Y\end{array}\right]=\left[\begin{array}[]{c}Y^{\prime}\\ \widetilde{Q}^{T}Y\end{array}\right]=\left[\begin{array}[]{c}Y^{\prime}P^{T}\\ \widetilde{R}\\ 0\end{array}\right]P. (8)

The computation of the matrix R~\widetilde{R} from (6) is also the starting point for a thresholding algorithm to be described in the next section. Substituting (8) into (5) we then also get

QTX=[ΣkYPT00R~0000][IrkPInkrk]Pk=[ΣkYPT00R~0000]PkPk,Q^{T}X=\left[\begin{array}[]{ccc}\Sigma_{k}^{\prime}&Y^{\prime}P^{T}&0\\ 0&\widetilde{R}&0\\ 0&0&0\end{array}\right]\left[\begin{array}[]{ccc}I_{r_{k}}\\ &P\\ &&I_{n_{k}-r_{k}}\end{array}\right]P_{k}=\left[\begin{array}[]{ccc}\Sigma_{k}^{\prime}&Y^{\prime}P^{T}&0\\ 0&\widetilde{R}&0\\ 0&0&0\end{array}\right]P_{k}^{\prime}P_{k}, (9)

with the block diagonal permutation

Pk:=[IrkPInkrk]P_{k}^{\prime}:=\left[\begin{array}[]{ccc}I_{r_{k}}&&\\ &P\\ &&I_{n_{k}-r_{k}}\end{array}\right]

that satisfies

PkPk=[IPI][III]=[IPI].P_{k}^{\prime}P_{k}=\left[\begin{array}[]{ccc}I&&\\ &P\\ &&I\end{array}\right]\left[\begin{array}[]{ccc}I&&\\ &&I\\ &I&\end{array}\right]=\left[\begin{array}[]{ccc}I&&\\ &&P\\ &I&\end{array}\right].

Therefore, using the abbreviation pk:=rk+mkp_{k}:=r_{k}+m_{k}, rk+1pknk+1r_{k+1}\leq p_{k}\leq n_{k+1}, we obtain another upper triangular matrix of relatively small size:

QTX(PkPk)T=[ΣkYPT00R~0000]=:[Rk+1000],Rk+1pk×pk.Q^{T}X(P_{k}^{\prime}P_{k})^{T}=\left[\begin{array}[]{ccc}\Sigma_{k}^{\prime}&Y^{\prime}P^{T}&0\\ 0&\widetilde{R}&0\\ 0&0&0\end{array}\right]=:\left[\begin{array}[]{cc}R_{k+1}&0\\ 0&0\end{array}\right],\qquad R_{k+1}\in\mathbb{R}^{p_{k}\times p_{k}}. (10)

Next, we compute a singular value decomposition of Rk+1R_{k+1} as

Rk+1=U~[Σk+1000]V~T,U~,V~pk×pk,Σk+1rk+1×rk+1,R_{k+1}=\widetilde{U}\,\left[\begin{array}[]{cc}\Sigma_{k+1}^{\prime}&0\\ 0&0\end{array}\right]\widetilde{V}^{T},\qquad\qquad\widetilde{U},\widetilde{V}\in\mathbb{R}^{p_{k}\times p_{k}},\;\Sigma_{k+1}^{\prime}\in\mathbb{R}^{r_{k+1}\times r_{k+1}}, (11)

where Σk+1\Sigma_{k+1}^{\prime} has strictly positive singular values that can be controlled by means of the thresholding strategies in the next section. This also determines the rank rk+1r_{k+1} of Ak+1A_{k+1}.

These results can be recombined into an efficient SVD of the d×nk+1d\times n_{k+1} matrix

QT\displaystyle Q^{T} X(PkPk)T\displaystyle X(P_{k}^{\prime}P_{k})^{T}
=[U~00Idpk][Σk+1000(drk+1)×(nk+1rk+1)][V~T00Ink+1pk].\displaystyle=\left[\begin{array}[]{cc}\widetilde{U}&0\\ 0&I_{d-p_{k}}\\ \end{array}\right]\left[\begin{array}[]{cc}\Sigma_{k+1}^{\prime}&0\\ 0&0_{(d-r_{k+1})\times(n_{k+1}-r_{k+1})}\end{array}\right]\left[\begin{array}[]{cc}\widetilde{V}^{T}&0\\ 0&I_{n_{k+1}-p_{k}}\end{array}\right].

Since pk=rk+mknk+1p_{k}=r_{k}+m_{k}\leq n_{k+1} with equality iff rk=nkr_{k}=n_{k}, i.e., iff AkA_{k} has full rank, we can always assume that

U~,V~nk+1×nk+1,\widetilde{U},\widetilde{V}\in\mathbb{R}^{n_{k+1}\times n_{k+1}},

so that the storage requirement for these matrices is at most nk+12n_{k+1}^{2}. Note, however, that the matrices in (2) are now patterned in different ways and that only their overall dimensions coincide. Combining all decompositions, finally gives

Ak+1=UkX[VkT00I]\displaystyle A_{k+1}=U_{k}X\left[\begin{array}[]{cc}V_{k}^{T}&0\\ 0&I\end{array}\right]
=\displaystyle= UkQ[U~00I][Σk+1000][V~T00I]PkPk[VkT00I]\displaystyle U_{k}Q\left[\begin{array}[]{cc}\widetilde{U}&0\\ 0&I\end{array}\right]\left[\begin{array}[]{cc}\Sigma_{k+1}^{\prime}&0\\ 0&0\end{array}\right]\left[\begin{array}[]{cc}\widetilde{V}^{T}&0\\ 0&I\end{array}\right]\,P_{k}^{\prime}P_{k}\,\left[\begin{array}[]{cc}V_{k}^{T}&0\\ 0&I\\ \end{array}\right]
=:\displaystyle=: Uk+1Σk+1Vk+1T,\displaystyle U_{k+1}\Sigma_{k+1}V_{k+1}^{T},

with the update rules

Uk+1\displaystyle U_{k+1} =\displaystyle= UkQ[U~00I],\displaystyle U_{k}Q\left[\begin{array}[]{cc}\widetilde{U}&0\\ 0&I\end{array}\right],
Vk+1\displaystyle V_{k+1} =\displaystyle= [Vk00I](PkPk)T[V~00I].\displaystyle\left[\begin{array}[]{cc}V_{k}&0\\ 0&I\end{array}\right](P_{k}^{\prime}P_{k})^{T}\left[\begin{array}[]{cc}\widetilde{V}&0\\ 0&I\end{array}\right].

The matrices appearing in (2) are all of dimension d×dd\times d, the ones used in (2) of dimension nk+1×nk+1n_{k+1}\times n_{k+1}.

Remark 2.2

The re-computation of all singular values in (11) is unavoidable since, for example the interlacing property of singular values of an augmented matrix tells us that usually all the singular values will change.

Remark 2.3

Businger’s method as described in [4] and also the efficient methods in [5] treat only the case of adding a single row to the matrix. In the algebraic applications, especially in the multivariate version of Prony’s method, however, it is important to treat the addition of several columns at the same time and treat these columns as symmetric as possible.

Since in the applications we consider, the dimension dd and therefore the size of Ukd×dU_{k}\in\mathbb{R}^{d\times d} can be rather large, it is not reasonable to store UkU_{k} in dense form. Normally, this is done by the aforementioned thin SVD with Ud×rU\in\mathbb{R}^{d\times r}, Σr×r\Sigma\in\mathbb{R}^{r\times r} and Vr×nV\in\mathbb{R}^{r\times n}, where rr is the rank of the matrix A=UΣVTd×nA=U\Sigma V^{T}\in\mathbb{R}^{d\times n}. The storage requirement for such representations is dr+r2+rn=r(r+d+n)dr+r^{2}+rn=r(r+d+n) and thus only linear in the dominant direction dd.

To obtain a similar storage performance and be able to apply fast algorithms, we will store UkU_{k} as a factorization by means of Householder vectors instead, cf. [2]. Recall that for a vector ydy\in\mathbb{R}^{d} the Householder reflection matrix Hy=I2yyTyTyH_{y}=I-2\frac{yy^{T}}{y^{T}y} is a symmetric orthogonal matrix that can be used for obtaining the QR factorization. Indeed, since the QR factorization of YY has to annihilate a lot of numbers simultaneously in any step, it is reasonable to perform it by Householder reflections so that

Q=j=1p(IyjyjT)=:(Iy1y1T)(IypypT),yj2=2,j=1,,p,Q=\prod_{j=1\uparrow p}(I-y_{j}y_{j}^{T})=:\left(I-y_{1}y_{1}^{T}\right)\cdots\left(I-y_{p}y_{p}^{T}\right),\qquad\|y_{j}\|_{2}=\sqrt{2},\quad j=1,\dots,p, (28)

for some pp\in\mathbb{N}. Note that we write the noncommutative matrix products in a left-to-right way which means that

QT=(IypypT)(Iy1y1T)=:j=p1(IyjyjT),Q^{T}=\left(I-y_{p}y_{p}^{T}\right)\cdots\left(I-y_{1}y_{1}^{T}\right)=:\prod_{j=p\downarrow 1}(I-y_{j}y_{j}^{T}),

which is slight unconventional but convenient.

Lemma 2.4

If QQ is the orthogonal matrix from the QRQR factorization (8), then p=rk+1rkp=r_{k+1}-r_{k}.

Proof: The decomposition (6) of YY can be written as

Q~TYPT=[R00],Rp×p,\widetilde{Q}^{T}YP^{T}=\left[\begin{array}[]{cc}R^{\prime}&*\\ 0&0\end{array}\right],\qquad R^{\prime}\in\mathbb{R}^{p\times p},

if the column pivoting terminates after pp steps. Hence, by (10),

Rk+1=[ΣkR00],R_{k+1}=\left[\begin{array}[]{ccc}\Sigma_{k}^{\prime}&*&*\\ &R^{\prime}&*\\ &0&0\end{array}\right],

and therefore rk+1=rankRk+1=rk+pr_{k+1}={\mathop{\rm rank\,}\nolimits}R_{k+1}=r_{k}+p since rk+pr_{k}+p diagonal elements of the upper triangular matrix Rk+1R_{k+1} are nonzero. \Box

Since for any orthogonal matrix Ud×dU\in\mathbb{R}^{d\times d} one has

HyU=(IyyT)U=Uy(UTy)T=U(I(UTy)(UTy)T)=UHUTy,H_{y}U=(I-yy^{T})U=U-y(U^{T}y)^{T}=U\left(I-(U^{T}y)(U^{T}y)^{T}\right)=UH_{U^{T}y},

the matrix

Q[U~00I]=[U~00I]j=1rk+1rk(Iy~jy~jT)Q\left[\begin{array}[]{cc}\widetilde{U}&0\\ 0&I\end{array}\right]=\left[\begin{array}[]{cc}\widetilde{U}&0\\ 0&I\end{array}\right]\,\prod_{j=1\uparrow{r_{k+1}-r_{k}}}(I-\tilde{y}_{j}\tilde{y}_{j}^{T})

from (2) can be represented by U~nk+1×nk+1\widetilde{U}\in\mathbb{R}^{n_{k+1}\times n_{k+1}} and the vectors

y~j:=[U~T00I]yj,j=1,,rk+1rk.\tilde{y}_{j}:=\left[\begin{array}[]{cc}\widetilde{U}^{T}&0\\ 0&I\end{array}\right]y_{j},\qquad j=1,\dots,r_{k+1}-r_{k}.

Hence, if we assume that we already have computed a representation of the form

Uk=[U~k00I]j=1rk(IhjhjT),U_{k}=\left[\begin{array}[]{cc}\widetilde{U}_{k}&0\\ 0&I\end{array}\right]\prod_{j=1\uparrow r_{k}}(I-h_{j}h_{j}^{T}), (29)

where we store the Householder vectors as columns of a matrix

Hk:=[h1,,hrk]d×rk,H_{k}:=\left[h_{1},\dots,h_{r_{k}}\right]\in\mathbb{R}^{d\times r_{k}}, (30)

the update rule (2) becomes

Uk+1\displaystyle U_{k+1} =\displaystyle= UkQ[U~00I]\displaystyle U_{k}Q\left[\begin{array}[]{cc}\widetilde{U}&0\\ 0&I\\ \end{array}\right]
=\displaystyle= [U~k00I]j=1rk(IhjhjT)[U~00I]j=1rk+1rk(Iy~jy~jT)\displaystyle\left[\begin{array}[]{cc}\widetilde{U}_{k}&0\\ 0&I\end{array}\right]\prod_{j=1\uparrow r_{k}}(I-h_{j}h_{j}^{T})\,\left[\begin{array}[]{cc}\widetilde{U}&0\\ 0&I\\ \end{array}\right]\prod_{j=1\uparrow r_{k+1}-r_{k}}(I-\tilde{y}_{j}\tilde{y}_{j}^{T})
=\displaystyle= [U~k00I][U~00I]j=1rk(Ih~jh~jT)j=1rk+1rk(Iy~jy~jT)\displaystyle\left[\begin{array}[]{cc}\widetilde{U}_{k}&0\\ 0&I\\ \end{array}\right]\left[\begin{array}[]{cc}\widetilde{U}&0\\ 0&I\\ \end{array}\right]\prod_{j=1\uparrow r_{k}}(I-\tilde{h}_{j}\tilde{h}_{j}^{T})\prod_{j=1\uparrow r_{k+1}-r_{k}}(I-\tilde{y}_{j}\tilde{y}_{j}^{T})
=\displaystyle= [U~k00I][U~00I]j=1rk+1(Ih~jh~jT),\displaystyle\left[\begin{array}[]{cc}\widetilde{U}_{k}&0\\ 0&I\\ \end{array}\right]\left[\begin{array}[]{cc}\widetilde{U}&0\\ 0&I\\ \end{array}\right]\prod_{j=1}^{r_{k+1}}(I-\tilde{h}_{j}\tilde{h}_{j}^{T}),

which can be represented by the matrix

U~k+1=[U~k00I][U~00I]nk+1×nk+1\widetilde{U}_{k+1}=\left[\begin{array}[]{cc}\widetilde{U}_{k}&0\\ 0&I\\ \end{array}\right]\left[\begin{array}[]{cc}\widetilde{U}&0\\ 0&I\\ \end{array}\right]\in\mathbb{R}^{n_{k+1}\times n_{k+1}} (35)

and the rk+1r_{k+1} vectors

h~j=[U~T00I]{hj,j=1,,rk,yjrk,j=rk+1,,rk+1,\tilde{h}_{j}=\left[\begin{array}[]{cc}\widetilde{U}^{T}&0\\ 0&I\end{array}\right]\,\left\{\begin{array}[]{ccl}h_{j},&&j=1,\dots,r_{k},\\ y_{j-r_{k}},&&j=r_{k}+1,\dots,r_{k+1},\end{array}\right. (36)

or, in matrix notation,

Hk+1=[U~T00I][Hk,y1,,yrk+1rk].H_{k+1}=\left[\begin{array}[]{cc}\widetilde{U}^{T}&0\\ 0&I\end{array}\right]\,\left[H_{k},\,y_{1},\dots,y_{r_{k+1}-r_{k}}\right]. (37)

The storage requirement for the matrix Hk+1H_{k+1} on level k+1k+1 is therefore nk+1(d+nk+1)n_{k+1}\,(d+n_{k+1}) and the computational effort for the update step is O(nk+13)O(n_{k+1}^{3}) for the matrix-matrix product in (35) plus O(nk+12rk+1)O(n_{k+1}^{2}r_{k+1}) for the product in (36) since the last dnk+1d-n_{k+1} entries in each column of the product can simply be copied. Thus, we can estimate the computational effort by a total of O(nk+12(nk+1+rk+1))O\left(n_{k+1}^{2}(n_{k+1}+r_{k+1})\right).

Remark 2.5

Another advantage of storing the matrix UkU_{k} in Householder factorized form is the fact that it is automatically orthogonal. Especially when the rank remains relatively stable over many iterations, the “loss of orthogonality” described in [5] will not occur so easily.

For the computation of YY we note that, with a proper row partitioning of BkB_{k}, we get

[YY]\displaystyle\left[\begin{array}[]{c}Y^{\prime}\\ Y\\ \end{array}\right] =\displaystyle= UkTBk=j=rk1(IhjhjT)[U~kT00I][Bk,1Bk,2]\displaystyle U_{k}^{T}B_{k}=\prod_{j=r_{k}\downarrow 1}(I-h_{j}h_{j}^{T})\,\left[\begin{array}[]{cc}\widetilde{U}_{k}^{T}&0\\ 0&I\end{array}\right]\left[\begin{array}[]{c}B_{k,1}\\ B_{k,2}\end{array}\right]
=\displaystyle= j=rk1(IhjhjT)[U~kTBk,1Bk,2].\displaystyle\prod_{j=r_{k}\downarrow 1}(I-h_{j}h_{j}^{T})\,\left[\begin{array}[]{cc}\widetilde{U}_{k}^{T}B_{k,1}\\ B_{k,2}\end{array}\right].

To initialize the procedure for a column vector interpreted as a matrix A1d×1A_{1}\in\mathbb{R}^{d\times 1}, we determine h1dh_{1}\in\mathbb{R}^{d} such that (Ih1h1T)A1=A1Fe1(I-h_{1}h_{1}^{T})A_{1}=\|A_{1}\|_{F}\,e_{1}, hence

A1=(Ih1h1T)[A1F0],h12=2,A_{1}=(I-h_{1}h_{1}^{T})\left[\begin{array}[]{c}\|A_{1}\|_{F}\\ 0\end{array}\right],\qquad\|h_{1}\|_{2}=\sqrt{2}, (48)

which is a valid SVD of A1A_{1} with V=1V=1 and yields the initialization

U~1=[],H1=h1\widetilde{U}_{1}=[],\qquad H_{1}=h_{1} (49)

We summarize the procedure in Algorithm 1, which computes the SVDs of a series of augmented matrices.

Algorithm 1 Augmented SVD
1:Given: Matrices Bjd×mjB_{j}\in\mathbb{R}^{d\times m_{j}}, jj\in\mathbb{N}, and A1d×1A_{1}\in\mathbb{R}^{d\times 1}.
2:  (Initialization) Determine the Householder vector h1h_{1} such that (48) is satisfied and set
U~1=[],V~1=[1],nk=nk=1,Σk=[A1F]1×1\widetilde{U}_{1}=[],\,\widetilde{V}_{1}=[1],\qquad n_{k}=n_{k}^{\prime}=1,\qquad\Sigma_{k}^{\prime}=[\|A_{1}\|_{F}]\in\mathbb{R}^{1\times 1}
as well as H1=h1H_{1}=h_{1}.
3:for k=1,2,k=1,2,\dots do
4:   Compute Z=UkTBkZ=U_{k}^{T}B_{k} according to (2) by applying Householder reflections with the columns of HkH_{k} in reverse order to the matrix [U~kTBk,1Bk,2]\left[\begin{array}[]{c}\widetilde{U}_{k}^{T}B_{k,1}\\ B_{k,2}\end{array}\right].
5:   Compute the QR decomposition with column pivoting:
Zrk+1:d,:=QRP,Q=j=1p(IyjyjT)drk×drk,Z_{r_{k}+1:d,:}=QRP,\qquad Q=\prod_{j=1\uparrow p}(I-y_{j}y_{j}^{T})\in\mathbb{R}^{d-r_{k}\times d-r_{k}},
and Pmk×mkP\in\mathbb{R}^{m_{k}\times m_{k}} is a permutation. Set hj:=[0rkyj]h_{j}:=\left[\begin{array}[]{c}0_{r_{k}}\\ y_{j}\end{array}\right], j=1,,pj=1,\dots,p.
6:   Compute, by means of Algorithm 2, a thresholded singular value decomposition of the upper triangular matrix
[ΣkZ1:nk,:PTR]=UΣVT.\left[\begin{array}[]{cc}\Sigma_{k}^{\prime}&Z_{1:n_{k}^{\prime},:}P^{T}\\ &R\end{array}\right]=U\Sigma V^{T}.
7:    Define rk+1:=max{j:σj>0}r_{k+1}:=\max\{j:\sigma_{j}>0\} and Σk+1=Σ1:rk+1,1:rk+1\Sigma_{k+1}^{\prime}=\Sigma_{1:r_{k+1},1:r_{k+1}}.
8:   (Update) Set
U~k+1\displaystyle\widetilde{U}_{k+1} =\displaystyle= [U~k00I]U,\displaystyle\left[\begin{array}[]{cc}\widetilde{U}_{k}&0\\ 0&I\end{array}\right]\,U,
Vk+1\displaystyle V_{k+1} =\displaystyle= [Vk00I][Ink0000Inknk0PT0][V00I],\displaystyle\left[\begin{array}[]{cc}V_{k}&0\\ 0&I\end{array}\right]\left[\begin{array}[]{ccc}I_{n_{k}^{\prime}}&0&0\\ 0&0&I_{n_{k}-n_{k}^{\prime}}\\ 0&P^{T}&0\end{array}\right]\left[\begin{array}[]{cc}V&0\\ 0&I\end{array}\right],
Hk+1\displaystyle H_{k+1} =\displaystyle= [UT00I][Hk,h1,,hp].\displaystyle\left[\begin{array}[]{cc}U^{T}&0\\ 0&I\end{array}\right]\left[H_{k},\,h_{1},\dots,h_{p}\right].
9:end for
Lemma 2.6

In each step, Algorithm 1 computes an approximate SVD of AkA_{k}, and a precise SVD if τ=0\tau=0, where the kkth step requires

O(nk+13+dmk(rk+mk))O\left(n_{k+1}^{3}+dm_{k}(r_{k}+m_{k})\right) (53)

floating point operations and the memory consumption for AkA_{k} is bounded by O(nk2+rkd)O(n_{k}^{2}+r_{k}d).

Proof: The validity of the algorithm follows from the preceding exposition where the individual steps have been introduced. Let us count the computational effort in the individual steps of the iteration in 3). According to (2) we first compute in 4) a product of an nk×nkn_{k}\times n_{k} and an nk×mkn_{k}\times m_{k} matrix, while retaining Bk,2B_{k,2}, which needs O(nk2mk)O(n_{k}^{2}m_{k}) operations, and then rkr_{k} Householder reflections on a d×mkd\times m_{k} matrix, which contributes O(rkdmk)O(r_{k}dm_{k}) flops, hence the total effort is O(mk(nk2+drk))O\left(m_{k}(n_{k}^{2}+dr_{k})\right) flops. According to [2, Algorithm 5.2.1], Householder QRQR of the (drk)×mk(d-r_{k})\times m_{k} matrix Zrk+1:d,:Z_{r_{k}+1:d,:} in 5) needs O(mk2(drk))O\left(m_{k}^{2}(d-r_{k})\right) operations. In 6), the computation of Z1:rk,:PTZ_{1:r_{k},:}P^{T} requires O(rkmk2)O\left(r_{k}m_{k}^{2}\right) flops while the SVD itself, as SVD of an upper triangular matrix, can be done in O((rk+mk)3)O\left((r_{k}+m_{k})^{3}\right) operations, see Remark 3.6. Since U~k\widetilde{U}_{k} and VkV_{k} are nk×nkn_{k}\times n_{k} matrices, the effort for the first two updates in step 8) is another O((nk+mk)3)=O(nk+13)O\left((n_{k}+m_{k})^{3}\right)=O\left(n_{k+1}^{3}\right), while the update of Hk+1H_{k+1} can be done with at most O(nk+12(nk+1+rk+1))2=O(nk+13)O\left(n_{k+1}^{2}(n_{k+1}+r_{k+1})\right)^{2}=O\left(n_{k+1}^{3}\right) operations. With the obvious estimate rknk+1r_{k}\leq n_{k+1} and mknk+1m_{k}\leq n_{k+1}, we can sum up everything to give (53). The memory effort is clear since we only store the nk×nkn_{k}\times n_{k} matrices U~k\widetilde{U}_{k} and VkV_{k} and the Householder vectors HkH_{k} as a d×rkd\times r_{k} matrix, see Lemma 2.4. \Box

Remark 2.7

The main advantage of Algorithm 1 is that its effort in computation and memory depends only linearly on the column size dd which makes tailored for problems where small blocks of large columns are added to a matrix.

Remark 2.8

The complexity of our algorithm is comparable to that of the method proposed by Brand in [5] who reports O(rk3+drk)O(r_{k}^{3}+dr_{k}) for an update by a single column, i.e., mk=1m_{k}=1. The slightly higher nk+1n_{k+1} in (53) is reflecting the fact that we always compute the full matrix Vknk×nkV_{k}\in\mathbb{R}^{n_{k}\times n_{k}} since it immediately gives a basis for the kernel of the matrix. Note that in the special case of appending a single column to a thin SVD of a full rank matrix, our estimate coincides with the one from [5], but is slightly better in the case of appending several columns if the rank is increased during this process.

3 Thresholding

Now we attack the problem of choosing a proper threshold level for the upper triangular matrix R~\widetilde{R} in (6). To that end we assume that a square upper triangular matrix Rn×nR\in\mathbb{R}^{n\times n} can be partitioned as

R=[R11R210R22],R11m×m,R22(nm)×(nm).R=\left[\begin{array}[]{cc}R_{11}&R_{21}\\ 0&R_{22}\end{array}\right],\qquad R_{11}\in\mathbb{R}^{m\times m},\quad R_{22}\in\mathbb{R}^{(n-m)\times(n-m)}. (54)

with

|r11||rmm||rm+1,m+1||rnn|,|r_{11}|\geq\cdots\geq|r_{mm}|\geq|r_{m+1,m+1}|\geq\cdots\geq|r_{nn}|, (55)

and

|rjj||rj,j+1||rjn|,|r_{jj}|\geq|r_{j,j+1}|\geq\cdots\geq|r_{jn}|, (56)

which is guaranteed in the preceding section by computing a QR decomposition with column pivoting.

Given a threshold τ>0\tau>0, we want to use information on RR to threshold RR in such a way that only singular values of RR with στ\sigma\leq\tau are set to zero and that as many of the singular values >τ>\tau as possible are preserved.

To that end, let R=UΣVTR=U\Sigma V^{T} denote the singular value decomposition with σ1σn0\sigma_{1}\geq\cdots\geq\sigma_{n}\geq 0. As mentioned in [14], the interlacing property of singular values readily implies that

σm(R11)σmσ1(R22)σm+1,\sigma_{m}(R_{11})\leq\sigma_{m}\qquad\sigma_{1}(R_{22})\geq\sigma_{m+1}, (57)

so a good separation between the singular values is obtained if τ\tau is chosen such that σm(R11)\sigma_{m}(R_{11}) is large while σ1(R22)\sigma_{1}(R_{22}) is small. To that end, we first show that the threshold carries over up to a quantity that is linear in the number of thresholded diagonal values.

Lemma 3.1

For any given mm the partition (54) satisfies

σm+1<(nm)(nm+1)2rm+1,m+1.\sigma_{m+1}<\sqrt{\frac{(n-m)(n-m+1)}{2}}\,r_{m+1,m+1}. (58)

Proof: Since R22R_{22} contains (nm)(nm+1)2\frac{(n-m)(n-m+1)}{2} nonzero elements of modulus rm+1,m+1\leq r_{m+1,m+1}, we find that

σ12(R22)j=1nmσj2(R22)=R22Frm+1,m+12(nm)(nm+1)2\sigma_{1}^{2}(R_{22})\leq\sum_{j=1}^{n-m}\sigma_{j}^{2}(R_{22})=\|R_{22}\|_{F}\leq r_{m+1,m+1}^{2}\,\frac{(n-m)(n-m+1)}{2}

due to (55) and (56), and (58) follows directly from (57). \Box

Therefore, if we choose the index mm as

m=min{j:|rj+1,j+1|2(nj)(nj+1)τ}m=\min\left\{j:|r_{j+1,j+1}|\leq\sqrt{\frac{2}{(n-j)(n-j+1)}}\,\tau\right\} (59)

and pass the matrix

R^=[R1100]\hat{R}=\left[\begin{array}[]{cc}R_{11}&*\\ 0&0\end{array}\right] (60)

to the SVD computation, the above reasoning then shows that τσm+1(R)σn(R)\tau\geq\sigma_{m+1}(R)\geq\cdots\geq\sigma_{n}(R) while, by thresholding construction, σm+1(R^)==σn(R^)=0\sigma_{m+1}(\hat{R})=\cdots=\sigma_{n}(\hat{R})=0. In other words, the thresholding applied to RR only transforms singular values to zero that fall below the prescribed threshold level.

A reasonable lower estimate for σm\sigma_{m} based on a lower bound on |rmm||r_{mm}| alone is impossible, as the well–known matrix

[11111]n×n\left[\begin{array}[]{cccc}1&-1&\dots&-1\\ &\ddots&\ddots&\dots\\ &&\ddots&-1\\ &&&1\end{array}\right]\in\mathbb{R}^{n\times n}

shows, whose smallest singular value decays exponentially in the matrix dimension nn but all of whose diagonal elements are 11.

A checkable and even computable bound for σk\sigma_{k} is the following probably well–known fact that we prove for the sake of completeness.

Lemma 3.2

Let R11=D(IN)R_{11}=D(I-N) where D=diag(rjj:j=1,,m)D={\mathop{\rm diag\,}\nolimits}\left(r_{jj}:j=1,\dots,m\right) and NN is a nilpotent upper triangular matrix. Then

σm(R11)rmmj=0m1NjF1.\sigma_{m}(R_{11})\geq r_{mm}\,\left\|\sum_{j=0}^{m-1}N^{j}\right\|_{F}^{-1}. (61)

Proof: For any x0x\neq 0 we have

x2=R111R11x2R1112R11x2,\|x\|_{2}=\|R_{11}^{-1}R_{11}x\|_{2}\leq\|R_{11}^{-1}\|_{2}\|R_{11}x\|_{2},

hence

R11x2x2R11121R111F1,x0,\frac{\|R_{11}x\|_{2}}{\|x\|_{2}}\geq\|R_{11}^{-1}\|_{2}^{-1}\geq\|R_{11}^{-1}\|_{F}^{-1},\qquad x\neq 0,

which also holds for the minimum of this expression, which is the smallest singular value σk(R11)\sigma_{k}(R_{11}). Using the decomposition R11=D(IN)R_{11}=D(I-N) we then find that

R111Frmm1j=0m1NjF,\|R_{11}^{-1}\|_{F}\leq r_{mm}^{-1}\,\left\|\sum_{j=0}^{m-1}N^{j}\right\|_{F},

which is (61). \Box

The definition of mm in (59) then yields that

2(nm)(nm1)τ<|rmm|,\sqrt{\frac{2}{(n-m)(n-m-1)}}\,\tau<|r_{mm}|,

hence

σm(R)σm(R11)>2(nm)(nm1)j=0m1NjF1τ.\sigma_{m}(R)\geq\sigma_{m}(R_{11})>\sqrt{\frac{2}{(n-m)(n-m-1)}}\left\|\sum_{j=0}^{m-1}N^{j}\right\|_{F}^{-1}\,\tau. (62)

This estimate explains how the conditioning of R11R_{11} affects the leading kk singular values of RR. In particular, it can happen that the SVD detects further almost kernel elements of RR that are not found by the QR decomposition, which is another reason to prefer the SVD to the simpler rank revealing factorizations.

It has to be mentioned that there are improved pivoting strategies, described in [14], but since most of them require the computation of an SVD as an auxiliary tool, it is more efficient to stick with the SVD. Note, however, that clearly

σ1σ1(R11)τ\sigma_{1}\geq\sigma_{1}(R_{11})\geq\tau

and that the interlacing property of singular values, cf. [2], yields that, after thresholding, the thresholded matrix R^\hat{R} from (60) satisfies

σm(R^)σk(R11)>σm+1(R^)==σn(R^)=0.\sigma_{m}(\hat{R})\geq\sigma_{k}(R_{11})>\sigma_{m+1}(\hat{R})=\cdots=\sigma_{n}(\hat{R})=0.

The Wielandt–Hoffman theorem for singular values, [2, Theorem 8.6.4], shows that we get a reasonable approximation for the singular values of R^=R+E\hat{R}=R+E for some En×nE\in\mathbb{R}^{n\times n}:

j=1n(σj(R)σj(R^))2RR^F2<τ2,\sum_{j=1}^{n}\left(\sigma_{j}(R)-\sigma_{j}(\hat{R})\right)^{2}\leq\|R-\hat{R}\|_{F}^{2}<\tau^{2}, (63)

which immediately gives following result.

Lemma 3.3

If

σk(R11)τ+σ\sigma_{k}(R_{11})\geq\tau+\sigma

then σ1(R^)σk(R^)>σ\sigma_{1}(\hat{R})\geq\cdots\geq\sigma_{k}(\hat{R})>\sigma, that is, the rank of R^\hat{R} is observed correctly relative to the threshold τ\tau.

Proof: Since σk(R^)σk(R11)\sigma_{k}(\hat{R})\geq\sigma_{k}(R_{11}) and, by (63),

|σk(R^)σk(R)|(j=1n(σj(R)σj(R^))2)1/2τ,\left|\sigma_{k}(\hat{R})-\sigma_{k}(R)\right|\leq\left(\sum_{j=1}^{n}\left(\sigma_{j}(R)-\sigma_{j}(\hat{R})\right)^{2}\right)^{1/2}\leq\tau,

we get that σk(R)>σ\sigma_{k}(R^{\prime})>\sigma as claimed. \Box

The structure of the matrix

Rk+1=[Σk0R~]R_{k+1}=\left[\begin{array}[]{cc}\Sigma_{k}^{\prime}&*\\ 0&\widetilde{R}\end{array}\right]

from (10) allows us to draw further conclusions on the singular values of Rk+1R_{k+1} together with the inductive assumption that Σk\Sigma_{k}^{\prime} results from a thresholding process with threshold level τ\tau yielding that (Σk)jjτ(\Sigma_{k}^{\prime})_{jj}\geq\tau. Adding one column to Σk\Sigma_{k}^{\prime} obtaining the matrix

S=[Σk0],S=\left[\begin{array}[]{cc}\Sigma_{k}^{\prime}&*\\ 0&*\end{array}\right],

the interlacing property of singular values yields σnk(S)σnk(Σk)σnk+1(S)\sigma_{n_{k}^{\prime}}(S)\geq\sigma_{n_{k}^{\prime}}(\Sigma_{k}^{\prime})\geq\sigma_{n_{k+1}^{\prime}}(S), hence σk(S)τ\sigma_{k}(S)\geq\tau. By an inductive repetition of this argument it follows that

σnk(Rk+1)σnk(Σk)τ.\sigma_{n_{k}^{\prime}}(R_{k+1})\geq\sigma_{n_{k}^{\prime}}(\Sigma_{k}^{\prime})\geq\tau.

This reasoning remains unchanged if we decompose Rk+1R_{k+1} according to the thresholding strategy (59) into

Rk+1=[R11R120R22],R11m×m.R_{k+1}=\left[\begin{array}[]{cc}R_{11}&R_{12}\\ 0&R_{22}\end{array}\right],\qquad R_{11}\in\mathbb{R}^{m\times m}. (64)

Then mnkm\geq n_{k}^{\prime} since all diagonals of Σk\Sigma_{k}^{\prime} exceed τ\tau. Since the above reasoning depends only on adding columns to Σk\Sigma_{k}^{\prime}, we can draw the following conclusion.

Lemma 3.4

The thresholded matrix

R^k+1:=[R11R1200]\hat{R}_{k+1}:=\left[\begin{array}[]{cc}R_{11}&R_{12}\\ 0&0\\ \end{array}\right]

satisfies σnk(R^k+1)τ\sigma_{n_{k}^{\prime}}\left(\hat{R}_{k+1}\right)\geq\tau.

With this information at hand, we can fix our pivoting structure to compute the matrix Σk+1\Sigma_{k+1}^{\prime} in Algorithm 2.

Algorithm 2 SVD Thresholding
1:Given: matrix Rk+1R_{k+1} of the form [Σ0R]\left[\begin{array}[]{cc}\Sigma&*\\ 0&R\end{array}\right].
2:  Decompose Rk+1R_{k+1} according to (64) with the thresholding strategy (59).
3:  Set R22=0R_{22}=0.
4:  Compute the SVD
Rk+1=U[Σ000]VT,Σm×m,R_{k+1}^{\prime}=U\left[\begin{array}[]{cc}\Sigma&0\\ 0&0\end{array}\right]V^{T},\qquad\Sigma\in\mathbb{R}^{m\times m},
and truncate Σ\Sigma with threshold τ\tau. In other words, write
Σ=[Σk+100D],Σk+1nn+1×nk+1,\Sigma=\left[\begin{array}[]{cc}\Sigma_{k+1}^{\prime}&0\\ 0&D\end{array}\right],\qquad\Sigma_{k+1}^{\prime}\in\mathbb{R}^{n_{n+1}^{\prime}\times n_{k+1}^{\prime}},
such that all diagonal elements of Σk+1\Sigma_{k+1}^{\prime} are τ\geq\tau and all diagonal elements of DD are <τ<\tau.

Due to the above arguments this strategy has a very important property.

Lemma 3.5

The thresholding strategy is rank increasing, i.e., rk+1rkr_{k+1}\geq r_{k}.

Remark 3.6

Computing the SVD of the upper triangular matrix can be done in O((rk+mk)3)O\left((r_{k}+m_{k})^{3}\right) operations, see the comments on the R–SVD in [2, Chapter 5.4].

4 Applications and numerical experiments

To motivate and justify the development of the methods in the preceding sections, we finally point out two main applications where they turn out to be useful. Algorithm 1 has been implemented prototypically in octave [1]. The code can be downloaded for checking and verification from

www.fim.uni-passau.de/digitale-bildverarbeitung/forschung/ downloads

All tests and experiments in the following section refer to this software.

4.1 Absolute and relative thresholding

Before we describe a simple experiment and the applications, we must make clear that the thresholding and thus rank detection strategy indicated by Lemma 3.5 is not the usual numerical rank detection strategy as used, for example, by the rank command in octave. There a singular value σ\sigma of Am×nA\in\mathbb{R}^{m\times n}, mnm\geq n, is thresholded to zero if σmσ1u\sigma\leq m\sigma_{1}u, where uu is the unit roundoff that describes the numerical accuracy, cf. [15], and σ1=A2\sigma_{1}=\|A\|_{2} is the largest singular value of AA. Though this strategy is the only reliable general purpose rank detection one, especially since it is independent of normalization, there is a phenomenon that particularly affects the two applications below: the more the matrix grows, the larger the threshold level becomes and more and more singular values will be thresholded to zero. A direct application of the rank command in the Prony algorithm of [7] even gave decreasing ranks for augmented matrices sometimes. Another simple example would be video analysis: imagine that a still image, even a normalized one, is transmitted over a fairly long period, say NN times. Then the respective singular value will be N\sqrt{N}, where NN denotes the number of repetitions, hence the threshold level will grow at least like N3/2N^{3/2} and may become so large that standard rank methods will ignore almost any frame, even if it is significantly different. On the other, the computation of the matrix RR in Algorithm 2 depends on the singular vectors only, not on the singular values accumulated so far, hence the roundoff errors affecting this matrix would still be independent of NN and an absolute threshold will reliably detect the difference, in contrast to a relative one. Taking into account that, by the Wielandt–Hoffman theorem for singular values, cf. [2, Theorem 8.6.4],

j=1r(σj(A)σj(A))2AAF2\sum_{j=1}^{r}\left(\sigma_{j}(A^{\prime})-\sigma_{j}(A)\right)^{2}\leq\|A-A^{\prime}\|_{F}^{2}

perturbations of a matrix only affect the singular values in an additive way, it makes sense, especially in the applications below, to use methods that work with an absolute thresholding that sets singular values to zero if they fall below a certain absolute value τ\tau. This is the threshold strategy developed in the preceding section.

4.2 Video analysis

The first application is the computation of principal components for sequential data. Principal Component Analysis is a classical and frequently used technique in signal analysis and (unsupervised) machine learning, cf. [16], and essentially consists of finding the best low dimensional approximation to feature vectors ykdy_{k}\in\mathbb{R}^{d}, k=1,2,,nk=1,2,\dots,n. Arranging these features into a matrix Yd×nY\in\mathbb{R}^{d\times n}, the best low dimensional approximation with respect to the Euclidean norm corresponds to finding a matrix Xd×nX\in\mathbb{R}^{d\times n} of rank, say n<nn^{\prime}<n, such that the Frobenius norm YXF\|Y-X\|_{F} is minimized. This matrix, on the other hand, is obtained by choosing the first nn^{\prime} columns of UU in the SVD Y=UΣVTY=U\Sigma V^{T}. Especially in imaging applications, where the features can be the pixel values, color or greyscale, of an image, dd can be large and handling or processing the full matrix YY is difficult. Moreover, the features may not all be present at the beginning and storing them first will also cause complications.

Moreover, since the noise level in video images exceeds the unit roundoff error by orders of magnitude, a relatively high absolute threshold τ\tau in the SVD update is possible and also adds a denoising effect to the computations.

As an example application, we consider PCA analysis to detect moving objects in videos of fixed view cameras. To that end, we consider a set of 594 greyscale images from a webcam viewing the city hall of Passau on February 7, 2016. These images are handled in full 640×480640\times 480 resolution, yielding a matrix A307200×594A\in\mathbb{R}^{307200\times 594} of rank 578578 which were read in chunks of 3030 images. The octave implementation of the algorithm worked out of the box with a rate of about 7 frames per second. From the Householder representation, the ppth singular vectors can be easily and efficiently computed as

[U~00I]j=1rk(IhjhjT)[ep0],p=1,,rk.\left[\begin{array}[]{cc}\widetilde{U}&0\\ 0&I\end{array}\right]\prod_{j=1\uparrow r_{k}}(I-h_{j}h_{j}^{T})\left[\begin{array}[]{c}e_{p}\\ 0\end{array}\right],\qquad p=1,\dots,r_{k}.

As a simple example, Fig. 1 shows the dominant singular vector and the fairly irrelevant 473473rd singular vector of the video sequence.

Refer to caption
Refer to caption
Figure 1: First and 473473rd singular vector of the image sequence
Refer to caption
Refer to caption
Figure 2: The first 1515 singular values (left) of the image and the remaining ones (right). Note the scaling of the yy–axis.

Indeed, the singular values decay rapidly. This can be seen in Fig. 2, where we have decomposed the singular values into the dominant 15 and the remaining ones. The L-shape of this curve suggests to cut down to about 2020 singular values and to decompose the sequence by projecting on the first 2020 and on the remaining singular vectors. This essentially removes moving objects from the frames but still maintains more persistent features like shadows and illumination of the scenery which change over time, but in a slower and more persistent way. We show two example frames in Fig. 3 and Fig. 4, where the top left image is the original frame that is decomposed into a “still” image and an image with the “moving” parts. Note that the advantage of our algorithm is that, in contrast to methods like [6] which is based on [13], it allows to compute the projection of the frames to an arbitrary number of singular vectors, once the video is learned properly. Note that the number of relevant singular values can usually only be detected once the SVD is computed.

The original frames and video with the decomposition can also be downloaded for verification from the address given above.

Refer to caption
Figure 3: Frame #351, decomposition: Detection of large (boat) and small (bus) moving features at the same time.
Refer to caption
Figure 4: Frame #507, decomposition: Moving objects (bus) and light effects on the water caused by the afternoon sun. Note that the shadows are still reproduced in the “still” image.

4.3 Prony’s problem in several variables

The main motivation for Algorithm 1, however, was the multivariate version of Prony’s method [17] which has attracted some interest recently; besides being interesting by itself, it is the main mathematical problem behind the superresolution concept from [18], which in turn is motivated by studying point spread functions from microscopy. In a nutshell, Prony’s problem can be described as follows: given a function in ss variables of the form

f(x)=ωΩfωeωTx,fω,Ω(+i(/2π))s,#Ω<,f(x)=\sum_{\omega\in\Omega}f_{\omega}\,e^{\omega^{T}x},\qquad f_{\omega}\in\mathbb{C},\quad\Omega\subset\left(\mathbb{R}+i(\mathbb{R}/2\pi\mathbb{Z})\right)^{s},\,\#\Omega<\infty, (65)

recover the unknown frequencies ω\omega from the finite set Ω\Omega as well as the coefficients fωf_{\omega}, ωΩ\omega\in\Omega, from integer samples of ff, i.e., from f(A)f(A), AsA\subset\mathbb{Z}^{s}. Note that the restriction on the imaginary part of the frequencies is required to make the solution unique and the problem well–defined. The main assumption made when solving this problem is sparsity, which means that #Ω\#\Omega is small while no other assumptions on Ω\Omega are necessary, though of course the conditioning of the problem will depend on the geometry of Ω\Omega.

Though determining Ω\Omega is a nonlinear problem, it can be approached by methods from Numerical Linear Algebra. As pointed out in [7, 8], the Hankel matrices

FA,B:=[f(αβ):αAβB],A,B0s,F_{A,B}:=\left[f(\alpha-\beta):\begin{array}[]{c}\alpha\in A\\ \beta\in B\end{array}\right],\qquad A,B\subset\mathbb{N}_{0}^{s}, (66)

provide all information about the ideal

IΩ:={p[x1,,xs]:p(eω)=0,ωΩ},I_{\Omega}:=\left\{p\in\mathbb{C}[x_{1},\dots,x_{s}]:p(e^{\omega})=0,\,\omega\in\Omega\right\}, (67)

provided that AA and BB are sufficiently rich. Once a basis for IΩI_{\Omega} is determined, the common zeros and therefore the frequencies can be determined by methods from Computer Algebra. In particular, if AA is such that the monomials xαx^{\alpha}, αA\alpha\in A admit interpolation at eΩ:={eω:ωΩ}se^{\Omega}:=\{e^{\omega}:\omega\in\Omega\}\subset\mathbb{C}^{s}, then a polynomial belongs to IΩI_{\Omega} if and only if its coefficient vector is in the kernel of FA,BF_{A,B}. By increasing BB in a proper way, one can so construct Gröbner or H–bases for IΩI_{\Omega} with which the computation of the frequencies is reduced to an eigenvalue problem. The main observation from [7, 8] is now as follows.

Theorem 4.1

If A0sA\subset\mathbb{N}_{0}^{s} is sufficiently rich in the sense that

Π=IΩ+span {()α:αA},\Pi=I_{\Omega}+\mbox{{span}\,}\{(\cdot)^{\alpha}:\alpha\in A\},

then, with FA,BF_{A,B} as in (66),

  1. 1.

    [pα:αB]kerFA,B[p_{\alpha}:\alpha\in B]\in\ker F_{A,B} if and only if p(x)=pαxαIΩp(x)=\sum p_{\alpha}x^{\alpha}\in I_{\Omega}.

  2. 2.

    if rankFA,Γn=rankFA,Γn+1{\mathop{\rm rank\,}\nolimits}F_{A,\Gamma_{n}}={\mathop{\rm rank\,}\nolimits}F_{A,\Gamma_{n+1}}, then kerFA,Γn(x)\ker F_{A,\Gamma_{n}}(x) is a basis of IΩI_{\Omega}, where Γn:={α0s:|α|n}\Gamma_{n}:=\{\alpha\in\mathbb{N}_{0}^{s}:|\alpha|\leq n\}.

These two observations suggest the algorithm to solve Prony’s problem: first find a “good” set AA and then build successively the matrices

FA,Γ0,FA,Γ1,,FA,Γn,FA,Γn+1,F_{A,\Gamma_{0}},F_{A,\Gamma_{1}},\dots,F_{A,\Gamma_{n}},F_{A,\Gamma_{n+1}},\dots

until rankFA,Γn=rankFA,Γn+1{\mathop{\rm rank\,}\nolimits}F_{A,\Gamma_{n}}={\mathop{\rm rank\,}\nolimits}F_{A,\Gamma_{n+1}}. If

FA,Γk=UΣVT,F_{A,\Gamma_{k}}=U\Sigma V^{T},

then the components of VV belonging to zero singular values are, by Theorem 4.1, coefficient vectors of polynomials from the ideal, and once the rank stabilizes, a basis of the ideal has been found from which the set Ω\Omega can be computed. Hence, in contrast to the PCA application before, where the singular vectors in UU were of importance, we are now interested in the matrix VV and it’s capability to distinguish between the kernel of FA,ΓkF_{A,\Gamma_{k}} and its orthogonal complement.

There is one major drawback, however: in several variables, the geometry of eΩe^{\Omega} becomes increasingly relevant and usually, only #Ω\#\Omega or an upper bound for it are assumed to be known. The smallest known choice for AA that works unconditionally without any further assumptions on Ω\Omega has cardinality #Ω(log#Ω)s1\#\Omega\,\left(\log\#\Omega\right)^{s-1} which still grows quite fast for large ss. Moreover, it is known to be beneficial to oversample, i.e., to choose AA larger than needed, cf. [19]. Thus, Algorithm 1 addresses the two main issues here: how to handle large columns in a still efficient way and how to ensure that the rank is controlled well.

Acknowledgement

We want to thank the referee for the very critical but constructive report that significantly improved the paper and helped us a lot to clarify the main points of this method. This was exceptionally helpful.

References

References

  • [1] J. W. Eaton, D. Bateman, S. Hauberg, GNU Octave version 3.0.1 manual: a high-level interactive language for numerical computations, CreateSpace Independent Publishing Platform, 2009, ISBN 1441413006.
    URL http://www.gnu.org/software/octave/doc/interpreter
  • [2] G. Golub, C. F. van Loan, Matrix Computations, 3rd Edition, The Johns Hopkins University Press, 1996.
  • [3] P. Businger, Algol programming, contribution no. 26. Updating a singular value decomposition, BIT 10 (1970) 376–385.
  • [4] A. Björck, Numerical Methods for Least Squares Problems, SIAM, 1996.
  • [5] M. Brand, Fast low-rank modifications of the thin singular value decomposition, Linear Algebra Appl. 415 (2006) 20–30.
  • [6] P. Rodriguez, B. Wohlberg, Incremental principal component pursuit for video background modeling, J. Math. Imaging Vis. 55 (2016) 1–18.
  • [7] T. Sauer, Prony’s method in several variables, Numer. Math. 136 (2017) 411–438, arXiv:1602.02352. doi:10.1007/s00211-016-0844-8.
  • [8] T. Sauer, Prony’s method in several variables: symbolic solutions by universal interpolation, J. Symbolic Comput. 84 (2018) 95–112, arXiv:1603.03944. doi:10.1016/j.jsc.2017.03.006.
  • [9] G. W. Stewart, Updating a rank–revealing ULVULV decomposition, SIAM J. Matrix Anal. Appl. 14 (1993) 494–499.
  • [10] R. Schmidt, Multiple emitter location and signal parameter estimation, IEEE Transactions on Antennas and Propagation 34 (1986) 276–280.
  • [11] J. R. Bunch, C. P. Nielsen, Updating the singular value decomposition, Numer. Math. 31 (1978) 111–129.
  • [12] J. W. Daniel, W. B. Gragg, L. Kaufman, G. W. Stewart, Reorthogonalization and stable algorithms for updating the Gram-Schmidt QR factorization, Math. Comp. 30 (1976) 772–795.
  • [13] C. G. Baker, K. A. Gallivan, P. Van Dooren, Low-rank incremental methods for computing dominant singular subspaces, Linear Algebra Appl. 436 (2012) 2866–2888.
  • [14] S. Chandrasekaran, I. C. F. Ipsen, On rank-revealing factorizations, SIAM J. Matrix Anal. Appl. 15 (1994) 592–622.
  • [15] N. J. Higham, Accuracy and stability of numerical algorithms, 2nd Edition, SIAM, 2002.
  • [16] T. Hastie, R. Tibshirani, J. Friedman, The Elements of Statistical Learning, 2nd Edition, Springer, 2009.
  • [17] C. Prony, Essai expérimental et analytique sur les lois de la dilabilité des fluides élastiques, et sur celles de la force expansive de la vapeur de l’eau et de la vapeur de l’alkool, à différentes températures, J. de l’École polytechnique 2 (1795) 24–77.
  • [18] E. J. Candès, C. Fernandez-Granda, Towards a mathematical theory of super-resolution, Comm. Pure Appl. Math. 67 (2012) 906–956.
  • [19] D. Batenkov, Stability and super-resolution of generalized spike recovery, Appl. Comput. Harmon. Anal.In press, arXiv:1409.3137v2. doi:10.1016/j.acha.2016.09.004.