On the Randomized Kaczmarz Algorithm

Liang Dai, Mojtaba Soltanalian, Kristiaan Pelckmans

I Problem Statement

The KA can be described as follows. Let us define the hyperplane HiH_{i} as:

where the ii-th row of AA is denoted as aiT\mathbf{a}_{i}^{T} and the ii-th element of b\mathbf{b} is denoted as bib_{i}. Geometrically, the solution of (1) can be thought as the intersection of all hyperplanes {Hi}i=1m\{H_{i}\}_{i=1}^{m}, and the KA seeks to find the solution by successively projecting to the hyperplanes from an initial approximation x0\mathbf{x}_{0}. The process is mathematically written as

where i=mod(k,m)+1.i=mod(k,m)+1. Here we use the Matlab convention mod(⋅,⋅)mod(\cdot,\cdot) to denote the modulus after the division operation. Fig. 1 illustrates the algorithm in a low dimensional case.

The key difference between the RKA and the KA is that RKA chooses the rows following a specified probability distribution. More precisely, the probability for selecting aiT\mathbf{a}_{i}^{T} is given as ∥ai∥22∥A∥F2.\frac{\|\mathbf{a}_{i}\|_{2}^{2}}{\|A\|_{F}^{2}}. Note that this probability is proportional to the row norms.

Although the KA is simple to state, its rate of convergence is still not completely explored. While for the RKA, with the predescribed choice of the probability distribution, the following convergence result is set up in :

However, it is argued in that ’Assigning probabilities corresponding to the row norms is in general certainly not optimal’. In the follows, we will try to find an optimized probability distribution for selecting the rows from AA, so that a better performance can be obtained. The distribution vector is derived by minimizing an upper bound to the convergence rate which can be obtained by solving a convex optimization problem.

This note is organized as follows. The next section discusses the main results; In section 3, we discuss how to approximately solve the arising Semi-Definite-Programming (SDP) problem with smaller computational cost; In section 4, illustrative experiments will be conducted to verify the findings; Finally, we draw some conclusions in section 5.

II Optimized RKA

i.e. every row of the matrix BB is a normalized version of the corresponding row of matrix AA.

Assume that currently we have xk−1\mathbf{x}_{k-1}, and based on xk−1\mathbf{x}_{k-1}, the next approximation xk\mathbf{x}_{k} is given by (2), in which the index ii is chosen randomly according to p\mathbf{p}. By the property of the projection operation, we have that

in which αi\alpha_{i} denotes the angle between xk−1−x\mathbf{x}_{k-1}-\mathbf{x} and the selected bi\mathbf{b}_{i}, i.e. the normal direction of the chosen hyperplane.

Based on the previous formula, we have that

in which βi\beta_{i} denotes the angle between y\mathbf{y} and bi\mathbf{b}_{i}.

Based on the relations in (6), (7) and (8), we have that

By iterating the relations given in eq. (9) and eq. (10), the following results follow.

in which the expectations are taken with respect to all the random choices of the rows up to time kk.

Note that Ω1<1\Omega_{1}<1 can be guaranteed if p\mathbf{p} is a strictly positive vector. This can be proven by a contradiction argument as follows. If Ω1=1\Omega_{1}=1, and since sin⁡2(βi)≤1\sin^{2}(\beta_{i})\leq 1 for any ii and ∑i=1mpi=1\sum_{i=1}^{m}p_{i}=1, we have that sin⁡2(βi)=1\sin^{2}(\beta_{i})=1, i.e. cos⁡(βi)=0\cos(\beta_{i})=0 holds for all ii. Considering that rank(A)=nrank(A)=n, i.e. rank(B)=nrank(B)=n, hence xk−x\mathbf{x}_{k}-\mathbf{x} can not be orthogonal to the vectors {bi}i=1m\{\mathbf{b}_{i}\}_{i=1}^{m}, and the result follows. Based on this observation, we can see that exponential convergence in expectation can be obtained by a wide range of probability distribution vectors. This finding extends the result in , which only guarantees the exponential convergence for a given specific choice of the probability distribution vector. ■\blacksquare

According to Theorem 1, in order to get a better performance, we need to find a probability distribution vector, such that Ω1\Omega_{1} can be made as small as possible. When the optimized Ω1\Omega_{1} is obtained, we can also have a lower bound to the convergence speed of the RKA based on Ω2\Omega_{2}. In the following, we will first derive a closed form for Ω1\Omega_{1} and Ω2\Omega_{2}, and then introduce a convex optimization problem to calculate the probability distribution vector p^\hat{\mathbf{p}} which minimizes Ω1\Omega_{1}.

so in order to minimize Ω1\Omega_{1}, equivalently, we can maximize the following

If we restrict ∥y∥2=1\|\mathbf{y}\|_{2}=1, then we have that

in which σn(⋅)\sigma_{n}(\cdot) denotes the smallest singular value of the matrix. The previous discussions can be summarized as:

in which σ1(⋅)\sigma_{1}(\cdot) denotes the maximal singular value of the matrix.

Notice that minimizing Ω1\Omega_{1} is equivalent to maximizing σn(BTdiag⁡(p)B)\sigma_{n}(B^{T}\operatorname*{diag}(\mathbf{p})B), then we can solve the following problem instead:

This problem can be rewritten as the following SDP problem, in which t^\hat{t} denotes the optimized σn\sigma_{n} and p^\hat{\mathbf{p}} denotes the corresponding probability distribution vector:

After solving the optimization problem of (16), p^\hat{\mathbf{p}} is applied to the RKA to select the rows. Such a scheme will be abbreviated as ORKA in the following.

There exist cases such that Ω1=Ω2\Omega_{1}=\Omega_{2}, i.e. there exists a vector p\mathbf{p}, such that

i.e. BTdiag⁡(p)B=1nIn.B^{T}\operatorname*{diag}(\mathbf{p})B=\frac{1}{n}I_{n}. In such cases, Ω1=Ω2=1−1n\Omega_{1}=\Omega_{2}=1-\frac{1}{n}, and the optimized probability distribution obtained by solving eq. (16) is the same as suggested in . It can be verified that when the columns of AA are orthogonal and of equal norm, then such property will hold. ■\blacksquare

The optimization problem (16) can also be formulated as

in the sense that t^=11Tq^\hat{t}=\frac{1}{\mathbf{1}^{T}\hat{\mathbf{q}}} and p^=t^q^.\hat{\mathbf{p}}=\hat{t}\hat{\mathbf{q}}.

Since q\mathbf{q} in (17) is nonnegative, one has that 1Tq=∥q∥1\mathbf{1}^{T}\mathbf{q}=\|\mathbf{q}\|_{1}. It is known that the l1l_{1} norm minimization problem is likely to return sparse solutions, which gives that q^\hat{\mathbf{q}} is likely to be sparse. In the experiment section, we will also illustrate this phenomena. ■\blacksquare

Next, we discuss the relation between the ORKA and the RKA. It is obvious that the projection operations in (2) depend only on the corresponding normal vectors of the hyperplanes {Hi}i=1m\{H_{i}\}_{i=1}^{m}, so we can optimize κ(A)=∥A∥F∥A†∥2\kappa(A)=\|A\|_{F}\|A^{\dagger}\|_{2} subject to the norms of the rows of matrix AA. The optimization problem is given as

Set 1Tq=1\mathbf{1}^{T}\mathbf{q}=1 and notice the fact that ATA=BTdiag⁡(q)BA^{T}A=B^{T}\operatorname*{diag}(\mathbf{q})B, then we can rewrite the previous problem as follows

It can be observed that this optimization is equivalent to the problem given by (16).

We conclude this observation in the following theorem.

The ORKA can do at least as good as the RKA, in the sense that if we optimize κ(A)\kappa(A) over the norms of rows of AA, we obtain the same probability distribution vector as the one obtained by the ORKA.

III Further Discussions

Note that although the formulation in (16) is convex, it is still time consuming to solve this SDP optimization problem. In this section, we will discuss two possibilities to solve it approximately , which can alleviate some of the computational cost. One approximation of (16) is obtained by relaxing the constraint BTdiag⁡(p)B−tIn⪰0B^{T}\operatorname*{diag}(\mathbf{p})B-tI_{n}\succeq 0 by the following linear constraints:

In order to get a better relaxation, we introduce another approximation method which relates to the research of Optimal Input Design . Notice that tr(BTdiag⁡(p)B)=1tr(B^{T}\operatorname*{diag}(\mathbf{p})B)=1, i.e. the summation of all the singular values of BTdiag⁡(p)BB^{T}\operatorname*{diag}(\mathbf{p})B is fixed, then maximizing σn(BTdiag⁡(p)B)\sigma_{n}(B^{T}\operatorname*{diag}(\mathbf{p})B) means that we want all the singular values of BTdiag⁡(p)BB^{T}\operatorname*{diag}(\mathbf{p})B to be close. This leads us to consider maximizing the product of the singular values of BTdiag⁡(p)BB^{T}\operatorname*{diag}(\mathbf{p})B, or maximizing the determinant of BTdiag⁡(p)BB^{T}\operatorname*{diag}(\mathbf{p})B. As the log⁡\log function is monotonically increasing, we can optimize the following

in which ∣⋅∣|\cdot| denotes the matrix determinant. Optimizing this quantity subject to the same constraints of (15) boils down to solve the so-called D-Optimal Design problem. One simple iterative algorithm to solve such problem has been suggested in , which is given as

Here, pt\mathbf{p}^{t} denotes the estimation at time tt, and pitp_{i}^{t} denotes its ii-th element. It has been proven in that for this algorithm, log⁡∣BTdiag⁡(pt)B∣\log|B^{T}\operatorname*{diag}(\mathbf{p}^{t})B| decreases monotonically w.r.t. tt. We will make use of such property to approximately solve (15) when the objective function is replace by (20). More discussions will be given in next section.

IV Experiments

In this section, we will conduct experiments to illustrate the efficacy of the presented methods. The setup of our experiment is given as follows. The matrix AA is first generated by randn(m,n) in Matlab with m=200m=200 and n=20n=20, after that, each row is normalized, and then scaled with a random number which is uniformly distributed in $.Thereasonforgenerating. The reason for generatingAassuchisthatinthefirststage,thegeneratedrowsofas such is that in the first stage, the generated rows ofAwillhavedifferentdirectionswhichareuniformlydistributedonthespherewill have different directions which are uniformly distributed on the sphereS^{n-1};andinthesecondstage,differentrowsof; and in the second stage, different rows ofAwithbeassignedwithdifferentnorms,whichisdirectlyrelatedtotheprobabilitydistributionvectorchosenin.with be assigned with different norms, which is directly related to the probability distribution vector chosen in .\mathbf{x}isgeneratedbyrandn(n,1),andis generated by randn(n,1), and\mathbf{b}isgeneratedasis generated as\mathbf{b}=A\mathbf{x}.WewillcomparetheMeanSquareError(MSE)alongtheprojectionpathobtainedbyallthesemethods,thefirstistheonesuggestedin(abbreviatedasRKA),thesecondistheoneobtainedbytheSDPoptimizationgivenby(16)(abbreviatedasORKA)andthethirdistheoneobtainedbytheLPapproximationsgivenby(19)(abbreviatedasLPORKA),thelastistheoneobtainedbytheiterativemethodtosolvetheD−OptimalDesigncriteria(abbreviatedasITEORKA).Weiterate(21)for. We will compare the Mean Square Error (MSE) along the projection path obtained by all these methods, the first is the one suggested in (abbreviated as RKA), the second is the one obtained by the SDP optimization given by (16) (abbreviated as ORKA) and the third is the one obtained by the LP approximations given by (19) (abbreviated as LPORKA), the last is the one obtained by the iterative method to solve the D-Optimal Design criteria (abbreviated as ITEORKA). We iterate (21) for10timesinthisexperiment.Foreachmethod,weruntheexperiment2000timestogettheaveragedperformance.TheCVXtoolboxhttp://cvxr.com/isusedtosolvetheSDPandLPoptimizationproblems.Fromtheexperiment,wecanobservethatthetimeforsolvingtheLPprobleminLPORKAisclosetothetimeneededforthetimes in this experiment. For each method, we run the experiment 2000 times to get the averaged performance. The CVX toolboxhttp://cvxr.com/ is used to solve the SDP and LP optimization problems. From the experiment, we can observe that the time for solving the LP problem in LPORKA is close to the time needed for the10$ iterations of (21), and the time needed for solving (16) in ORKA is approximately 7 times as them.

V Conclusion

This note discusses the possibility and methodology to find a probability distribution vector for selecting the rows of AA to result in a better convergence speed of the Randomize Kaczmarz Algorithm. The lower bound and upper bound for the convergence speed is derived first. Then an optimized probability distribution vector is obtained by minimizing the upper bound, which turns to be given by solving a convex optimization problem. Properties of the approach are also discussed along the note.

References